Skip to content

Instantly share code, notes, and snippets.

View asssaf's full-sized avatar

Assaf Berg asssaf

View GitHub Profile
@asssaf
asssaf / service-serial.tcz.list
Created August 16, 2025 17:31
picore-service-serial
usr/local/init.d/services/service-serial/log/run
usr/local/init.d/services/service-serial/log/supervise
usr/local/init.d/services/service-serial/run
usr/local/init.d/services/service-serial/supervise
usr/local/tce.installed/service-serial
@asssaf
asssaf / timed_irrigation.yaml
Last active August 10, 2025 17:03
Timed irrigation home assistant automation blueprint
blueprint:
name: Timed Irrigation
description: ""
author: asssaf
domain: automation
input:
switch:
name: Switch
description: The switch that controls the irrigation valve
selector:
@asssaf
asssaf / s3feather-01.yaml
Last active January 5, 2025 03:06
ESPHome config for Adafruit ESP32-S3 Feather with INA228 power sensor and SSD1306 display
esphome:
name: s3feather-01
friendly_name: s3feather-01
esp32:
board: adafruit_feather_esp32s3
framework:
type: arduino
# Enable logging
@asssaf
asssaf / snoozable_notification.yaml
Last active August 27, 2024 04:28
Snoozable notification home assistant automation blueprint
blueprint:
name: Snoozable notification
description: Notify when a binary sensor changes state, and allow snoozing the notification for a set amount of time
author: asssaf
domain: automation
input:
notify_message:
name: Notification message
description: The message to include in notifications
default: Some event
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.103 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.104 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.105 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.107 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.109 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.109 29].[11.109 44]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.174 3].[11.179 13]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.176 3].[11.179 13]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.177 3].[11.179 13]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.178 5].[11.178 47]>
:: Uptime monitor
!:
|%
++ move {bone card}
++ card
$% {$wait wire @da}
{$poke wire [* term] * action}
==
++ action
$% {$state $~}
@asssaf
asssaf / _etc_fstab
Created February 23, 2017 19:26
zram swap through udev
/dev/zram0 none swap defaults 0 0
/dev/zram1 none swap defaults 0 0
@asssaf
asssaf / apple-sysrq
Created February 22, 2017 21:59
setup magic sysrq on macbookpro5,5 using the eject button
#!/usr/bin/env bash
# enable all sysrq functions
echo 1 > /proc/sys/kernel/sysrq
# map eject key to SysRq
echo "786616 99" | keyfuzz -s -d /dev/input/by-id/usb-Apple_Inc._Apple_Internal_Keyboard___Trackpad-event-kbd
@asssaf
asssaf / javaexec.md
Last active January 22, 2017 22:22
Bash script for executing java one liners

It saves you from writing the boiler plate class file, compiling and executing it yourself (and is lighterweight than installing groovy/bsh).

Examples:

$  echo 'System.out.println("hello");' | ~/bin/javaexec 
hello

$ echo 'String.format("%02d", 5)' | ~/bin/javaexec -p
05
@asssaf
asssaf / ffsplit.sh
Created November 28, 2016 19:21
a quick-and-dirty media splitter shell script using FFmpeg
#!/bin/bash
# **ffsplit** is a quick-and-dirty media splitter using FFmpeg
# It takes an input media file, extracts the audio and splits it to constant-length segments
# enable exit on error
set -e
#/ Usage: ffsplit <input>
#/
#/ <input> media file to split