Skip to content

Instantly share code, notes, and snippets.

View eliroca's full-sized avatar

Elisei Roca eliroca

  • Germany
  • 04:23 (UTC +02:00)
View GitHub Profile
@eliroca
eliroca / hue_dimmer_v2.yaml
Last active November 25, 2023 14:07
ZHA - Philips Hue Dimmer V2
blueprint:
name: ZHA - Philips Hue Dimmer V2
description:
"Control 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_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
#!/bin/bash
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
verbose_mode=false
test_mode=false
@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
@eliroca
eliroca / mediagoblin-deployment-opensuse.md
Last active December 2, 2020 11:40
MediaGoblin deployment on openSUSE

Deploy MediaGoblin

Due to locked dependencies in the project's setup.py, it only works on Leap 15.2 for now.

Install MediaGoblin and its requirements

For a production deployment, you’ll also need Nginx as frontend web server and RabbitMQ to store the media processing queue, as well as PostgreSQL as database. Since I've failed to configure PostgreSQL, it's not covered in this document. Nginx configuration will be added soon™.

sudo zypper addrepo https://download.opensuse.org/repositories/home:/eroca/openSUSE_Leap_15.2/home:eroca.repo
sudo zypper --gpg-auto-import-keys refresh
@eliroca
eliroca / updating-systemd-qa-testsuite-package-for-tw-leap-or-sle.md
Last active August 26, 2020 10:45
Updating systemd's QA testsuite package for Tumbleweed, Leap or SLE

Updating systemd's QA testsuite package for Tumbleweed, Leap or SLE

1. Branch a systemd package, but make sure it's the right one that you need

# For Tumbleweed, add --nodevelproject, otherwise osc branches Base:System/systemd
 osc branch --nodevelproject openSUSE:Factory systemd home:eroca:branches:openSUSE:Factory systemd-v245-testsuite

2. Checkout the newly created package