Skip to content

Instantly share code, notes, and snippets.

View korotin's full-sized avatar

Aleksei Korotin korotin

View GitHub Profile
@korotin
korotin / tuya_rotary_switch.yaml
Last active March 14, 2025 22:58 — forked from SpeedyGoneZales/tuya_rotary_switch.yaml
ZHA Tuya Rotary Switch _TZ3000_402vrq2i (TS004F)
blueprint:
name: Tuya Rotary Switch
description: Automate your Tuya rotary switch using ZHA events.
domain: automation
input:
tuya_rotary_dimmer_switch:
name: Tuya Rotary Dimmer Switch
description: Tuya Rotary Dimmer Switch
selector:
device:
@korotin
korotin / 10-ipset
Created May 16, 2019 11:23
ipset plugin for netfilter-persistent
#!/bin/sh
# Plugin for netfilter-persistent which makes ipset lists persistent.
#
# Make sure that you have netfilter-persitent and ipset installed,
# put this file in /usr/share/netfilter-persistent/plugins.d and make it executable.
set -e
rc=0
@korotin
korotin / fish_prompt.fish
Last active November 5, 2015 15:23
My fish prompt with system load, bg jobs count and current git branch name
function get_git_branch
set -g git_branch (git rev-parse --abbrev-ref HEAD ^ /dev/null)
if [ $status -ne 0 ]
set -ge git_branch
end
end
function get_system_load
set -g system_load (uptime | grep -oE 'average\: [[:digit:]]+\.[[:digit:]]+' | cut -d' ' -f2)
end