Skip to content

Instantly share code, notes, and snippets.

View pavax's full-sized avatar

Patrick D. pavax

  • schaltstelle
  • Bern, Switzerland
View GitHub Profile
@pavax
pavax / update-mkv.sh
Last active February 8, 2025 13:13
script to check for optical drive changes and update docker-compose files
#!/bin/sh
# Path to the Docker Compose file
DOCKER_COMPOSE_FILE="/volume2/mkv/makemkv-docker/docker-compose.yml"
find_device_paths_from_compose() {
echo "Searching for device paths in the Docker Compose file..."
device_path_sr=$(grep -o '/dev/sr[^:"]*' "$DOCKER_COMPOSE_FILE" | head -n1)
device_path_sg=$(grep -o '/dev/sg[^:"]*' "$DOCKER_COMPOSE_FILE" | head -n1)
@pavax
pavax / nsfw.oisd.nl
Created December 29, 2024 17:52
nsfw.oisd.nl having the ctag=user_child applied
This file has been truncated, but you can view the full file.
[Adblock Plus]
! Version: 202412291713
! Title: oisd nsfw
! Description: Block. Don't break.
! Syntax: Adblock Plus Filter List
! Entries: 329315
! Last modified: 2024-12-29T17:13:57+0000
! Expires: 1 hours
! License: https://github.com/sjhgvr/oisd/blob/main/LICENSE
! Maintainer: Stephan van Ruth
@pavax
pavax / creative-stage-se-esphome.yaml
Created October 13, 2024 15:44
IR Transmitter Commands to Control the Creative Stage SE Soundbar using ESPHome
button:
- platform: template
name: "${name} Power"
on_press:
- remote_transmitter.transmit_nec:
address: 0xB683
command: 0xB24D
command_repeats: 1
- platform: template
acme-v01.api.letsencrypt.org
acme-staging.api.letsencrypt.org
acme-v02.api.letsencrypt.org
acme-staging-v02.api.letsencrypt.org
outbound1a.letsencrypt.org
outbound1b.letsencrypt.org
outbound1c.letsencrypt.org
outbound1d.letsencrypt.org
outbound1e.letsencrypt.org
outbound1f.letsencrypt.org
@pavax
pavax / natpmpc-transmission-update.sh
Last active February 20, 2024 17:03
Bash script to open a port using natpmpc and update the opened port in transmission-daemon
#!/bin/bash
# The gatway to send the natpmp commands
natpmp_ip="10.2.0.1"
# Path to the lock file
lock_file="/tmp/transmission_update.lock"
# Path to the Transmission settings.json file
settings_file="/etc/transmission-daemon/settings.json"
@pavax
pavax / udpbroadcastrelay
Last active July 30, 2024 21:17
udpbroadcastrelay freebsd service
#!/bin/sh
# How to use:
# Place this file in /usr/local/etc/rc.d/
# Make the file executable: chmod +x /usr/local/etc/rc.d/udpbroadcastrelay2
# Adjust the command_args to your needs
# Add udpbroadcastrelay_enable="YES" to /etc/rc.config
# Start using the command: service udpbroadcastrelay start
. /etc/rc.subr
@pavax
pavax / z2m_aqara_trv_external_temperature.yaml
Last active February 18, 2025 07:33
z2m_aqara_trv_external_temperature.yaml
blueprint:
name: Aqara TRV E1 External Temperature Control
description: >
This automation allows the Aqara TRV E1 Smart Radiator Thermostat to use temperature readings from an external sensor rather than its internal sensor. Whenever the temperature sensor reports a new value, it is sent to the TRV for more accurate climate control.
domain: automation
source_url: "https://gist.github.com/pavax/8d6ed250765d89cb281d4a1762b8d2e8"
input:
external_temp_sensor:
name: External Temperature Sensor
@pavax
pavax / illuminance_aware_cover_control.yaml
Last active July 28, 2023 10:10
illuminance_aware_cover_control.yaml
blueprint:
name: Illuminance aware cover control
description: >
Close cover based on a illuminance sensor.
Allow manual control to open the cover again, but reactivate the automatic control again after a defined time.
Optional defined state sensors to prevent re-opening again. For Example when a media_player is playing
domain: automation
source_url: https://gist.github.com/pavax/ed424e1d7bbb1c69b7e33e60d1415b5a
input:
cover_control:
@pavax
pavax / cec-tv-status.sh
Last active July 24, 2023 21:49
cec-tv-status.sh
#/bin/bash
if [[ $1 == "turn-on" ]]; then
command=$(echo 'on 0.0.0.0' | cec-client -s -d 1)
elif [[ $1 == "turn-off" ]]; then
command=$(echo 'standby 0.0.0.0' | cec-client -s -d 1)
elif [[ $1 == "status" ]]; then
#command=$(echo 'pow 0.0.0.0' | cec-client -s -d 1)
readarray -t lines < <(echo 'pow 0.0.0.0' | cec-client -s -d 1)
<?php
/**
* HOW-TO INSTALL
* - Download and edit the DEFINE-ME variables in this file
* - Upload the file to your server (for example into your WordPress installation directory)
* - Go to the Amelia Settings Page and click on Integrations.
* - Go to the "Webhooks" Tab
*
* URL: Provide your URL that matches to where you uploaded this php file on your server.