Skip to content

Instantly share code, notes, and snippets.

View eliroca's full-sized avatar

Elisei Roca eliroca

  • Germany
  • 00:16 (UTC +02:00)
View GitHub Profile
@eliroca
eliroca / hue_dimmer_v2_dual.yaml
Last active November 11, 2023 20:11 — forked from brodock/HueDimmer_RWL022.yaml
ZHA - Philips Hue Dimmer V2 Dual
blueprint:
name: ZHA - Philips Hue Dimmer V2 Dual
description:
"Control two lights with a Philips Hue Dimmer V2 (RWL022)"
domain: automation
input:
remote:
name: Philips Hue Dimmer
description: Pick a V2 Dimmer (RWL022)
selector:
@eliroca
eliroca / hue_dimmer_v1.yaml
Last active November 11, 2023 20:03 — forked from stefanroelofs/hue_dimmer_switchV2.yaml
ZHA - Philips Hue Dimmer V1
blueprint:
name: ZHA - Philips Hue Dimmer V1
description: |
Control lights with a Philips Hue Dimmer Switch.
The top "on" button behaviour is adjustable. By default it behaves like this:
- Press it while the light is off, and the light will turn on to the last set brightness.
- Press it again while the light is on, the light will turn to the fixed brightness setting.
Dim up/down buttons will change the brightness smoothly and can be pressed
@eliroca
eliroca / .screenrc
Created October 17, 2022 08:06 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@eliroca
eliroca / merger.py
Created December 9, 2021 20:47 — forked from emakarov/merger.py
Python script that can resolve all git conflicts in some file marked with conflicts based on chosen strategy
accept = 'ours' # ours for 'HEAD' #theirs for other's - choose strategy here for all conflicts
filename = 'enter your filename here'
fresult = '{}.{}'.format(filename, 'merged') # result will be near your file with name `original_filename.ext.merged`
with open(filename) as f:
content = f.readlines()
res = open(fresult, 'w')
to_write = True
merging = False
@eliroca
eliroca / bt-headset-hack.sh
Created April 23, 2021 19:17 — forked from s-leon/bt-headset-hack.sh
bt-headset-hack.sh
#!/bin/bash
# add pulseaudio-modules-bt from home:MasterPatricko for ldac codec
echo -e "pair 38:18:x:xx:xx:xx\nyes" | bluetoothctl
sleep 2
bluetoothctl -- trust 38:18:x:xx:xx:xx
bluetoothctl -- connect 38:18:x:xx:xx:xx
sleep 2
bluetoothctl -- disconnenct 38:18:x:xx:xx:xx
sleep 2
pulseaudio -k && pulseaudio --start
#/usr/bin/env sh
# Get the Zone ID from: https://www.cloudflare.com/a/overview/<your-domain>
DNS_ZONE=***
# Get the existing identifier for DNS entry:
# https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
IDENTIFIER=***
# Get these from: https://www.cloudflare.com/a/account/my-account