Skip to content

Instantly share code, notes, and snippets.

amitkeret /
Last active May 2, 2022 12:20
Check peripheral connectivity to Raspberry Pi and report via MQTT
# -*- coding: utf-8 -*-
mqttuser = "*****"
mqttpwd = "*****"
mqtthost = "*****"
mqttport = 1883
mqttkeepalive = 60
piname = "*****"
amitkeret / Dockerfile
Created February 9, 2022 11:32
OwnTone Dockerfile
# OwnTone Dockerfile
# Use this to create an OwnTone docker image
# The Dockerfile will create an initial configuration (.conf) file and a fifo pipe
# Run the image with:
# docker run -it --privileged \
# --name=owntone --restart=unless-stopped \
# -p 3689:3689 -p 6600:6600 \
# -v /path/to/config/folder:/config -v /path/to/music:/music \
# -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket \
amitkeret / configuration.yaml
Created February 7, 2022 02:27
Zigbee2MQTT initial config
homeassistant: true
permit_join: true
base_topic: zigbee2mqtt
server: mqtt://[IP]:[PORT]
user: [USER]
password: [PASS]
port: /dev/ttyACM0
adapter: deconz
amitkeret / music_on_motion.yaml
Created November 3, 2021 05:12
Home Assistant - Motion-controlled multiroom speakers with manual override
# Inspired by PIR_light.yaml by @vanceb
# @see
name: Music on motion (OwnTone)
description: Turn on (= join the group) a OwnTone-controlled media player on motion detection
domain: automation
amitkeret /
Last active May 2, 2022 12:21
simplified RPi system sensors MQTT announcements (incl. Home Assistant auto-discovery)
# -*- coding: utf-8 -*-
# Simplified RPi system sensors MQTT announcements
# Inspired by the great work done by @Sennevds
# This script is meant to be executed via crontab.
# It does NOT maintain a persistent connection and/or employ a loop function to keep sending messages at defined intervals.
# Therefor, in order to make use of the LWT function, added the keepAlive flag to the connecion.
amitkeret / background.pug
Created December 8, 2019 04:54
CSS block element blurred background
.title Quia voluptas voluptatem sit
.text Ea eius cum dolor facere sequi. Veritatis architecto fugiat rerum maxime. Cupiditate facere explicabo corrupti. Aliquid voluptas vel sequi fugiat adipisci sit ut
.title Sint eveniet repellendus fuga
.text Eveniet animi neque ipsum nihil rerum laboriosam. Quod fugiat quis inventore laudantium qui doloremque. Ea et autem sed
amitkeret / browser-preprocess.html
Created June 22, 2019 09:06
Quick-and-dirty on-the-fly CoffeeScript + Stylus compiling in the browser
<meta charset="UTF-8">
<style language="stylus">
color red
amitkeret / image.styl
Created March 25, 2019 10:24
responsive blurred image background
display flex
width 30vw
height 80vh
margin auto
position relative
overflow hidden
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
amitkeret /
Created December 29, 2018 09:48
Nautilus script - Toggle .dot notation
file_name=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g' -e 's/.*\///g')
file_folder=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g' -e "s/$file_name//g")
case "$file_name" in
new_file_name=$(echo $file_name | sed -e 's/\.//')