Skip to content

Instantly share code, notes, and snippets.

View reyo's full-sized avatar

reyo

  • Reiven Solutions
  • Estonia
  • 04:03 (UTC +02:00)
View GitHub Profile
@thomasmaxson
thomasmaxson / remote_philips_hue_tap_dial.yaml
Last active September 7, 2025 16:55
Home Assistant Blueprint to control your devices with a Philips Hue Tap Dial Switch using the MQTT integration.
# This blueprint uses a Philips Hue Tap Dial Remote Control connected through MQTT.
# This blueprint allows you to run custom actions with the remote's buttons
#
# | Button Type | Interaction | Action Choices |
# | ----------- | ----------------- | ------------------- |
# | One Dot | Press | - Toggle light |
# | | | - Turn on light |
# | | | - Turn off light |
# | | | - Run custom action |
# | ----------- | ----------------- | ------------------- |
@reyo
reyo / automations.yaml
Created December 26, 2024 17:42
Automatically extend LG WebOS Developer Mode with Home Assistant
- alias: Extend TV dev mode every night
trigger:
# Run this automation every night at 4 AM.
- platform: time
at: 04:00:00
condition:
# Run only if TV is off.
- condition: template
value_template: '{{ is_state("media_player.webos_tv", "off") }}'
action:
@helinwang
helinwang / unraid_mount.md
Last active December 25, 2024 14:06
Unraid: mount a unraid share using the unraid mount tag in Ubuntu

Mounting the shared path You can mount the shared folder using

mount -t 9p -o trans=virtio [mount tag] [mount point] -oversion=9p2000.L

mount tag: As specified in Qemu commandline. mount point: Path to mount point. trans: Transport method (here virtio for using 9P over virtio) version: Protocol version. By default it is 9p2000.u . Other options that can be used include:

@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@kekru
kekru / Docker connect to remote server.md
Last active March 21, 2025 01:29
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@jaredmichaelwilliams
jaredmichaelwilliams / Quickly Add 5GB Swap File
Last active July 13, 2024 21:47
Quick Add 5GB Swap File, and add to fstab
dd if=/dev/zero of=/mnt/swap bs=1024 count=5242880;
mkswap /mnt/swap;
chown root:root /mnt/swap ;
chmod 0600 /mnt/swap ;
swapon /mnt/swap;
echo "/mnt/swap swap swap defaults 0 0" >> /etc/fstab;
@v0lkan
v0lkan / nginx.conf
Last active December 2, 2025 18:08
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@orlovmax
orlovmax / base64 placeholder
Created August 2, 2014 20:09
Base64 1px placeholder
Transparent 1px image placeholder
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
And black one:
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=">
@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
@RIAEvangelist
RIAEvangelist / Install Cloud9 on local or remote computer, server, or raspberry pi
Last active June 6, 2023 03:37
This gist will help you install Cloud9 on your local or remote computer, server, or even your raspberry pi. Many people are having issues at the time of this Gist's creation.
Complete installation process:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
sudo apt-get update
sudo apt-get upgrade
cd ~
mkdir git
cd ~/git