Skip to content

Instantly share code, notes, and snippets.

@k5njm
k5njm / index-ha-shopping-list.md
Created August 24, 2026 14:41
Index 01 ring → Home Assistant shopping list: uncheck completed items instead of duplicating

Index 01 → Home Assistant shopping list (uncheck completed items, don't duplicate)

I wired my Index 01 ring so "add eggs to my shopping list" lands on Home Assistant's Shopping List. If Eggs is already there and checked off, it unchecks that row instead of adding a second Eggs. New items are added. Non-shopping recordings are ignored.

No custom Pebble build. Official Index webhook (transcription only) → HA webhook automation → a script that fuzzy-matches against todo.shopping_list.

Works on the stock iOS/Android Pebble app (coredevices/mobileapp, open source). The webhook fires alongside the Index agent, so the in-app list still gets the item too. One-way only; reverse sync is extra work.

What you get

@k5njm
k5njm / gist:590e7fdab18cf01fb3455a0d563a4f40
Created August 23, 2025 12:07
Systemd for balloon docker conpose
sudo tee /etc/systemd/system/ground-station.service >/dev/null <<'EOF'
[Unit]
Description=Balloonatics Ground Station (docker compose)
Requires=docker.service network-online.target
After=docker.service network-online.target
[Service]
Type=oneshot
WorkingDirectory=/home/nick/repos/balloonatics/ground_station
# Optional: give wifi a moment to come up
import RPi.GPIO as GPIO
import datetime
import os
import time
BUTTON_PIN = 17
SHORT_PRESS_TIME = 0.5 # Less than 0.5 seconds
REPEAT_TIMEOUT = 0.5 # Repeat short presses should be within 1s
MEDIUM_PRESS_TIME = 2 # Less than 2.0 seconds
import RPi.GPIO as GPIO
import datetime
def my_callback(channel):
if GPIO.input(channel) == GPIO.HIGH:
print('\n▼ at ' + str(datetime.datetime.now()))
else:
print('\n ▲ at ' + str(datetime.datetime.now()))
try:
#!/bin/bash
# Get the number of rows available in the terminal
ROWS=$(tput lines)
# Generate your nmcli content
CONTENT=$(nmcli -f SSID,RATE,CHAN,SIGNAL,BARS dev wifi list | awk '!seen[$1]++')
# Check if the content exceeds the available rows
if [ $(echo "$CONTENT" | wc -l) -gt $ROWS ]; then
@k5njm
k5njm / gist:b50a25279a2b2623264d7a2690c95c13
Created August 26, 2023 22:00
Beepy tmux WiFi status
nick@beepy:~ $ cat .tmux.conf
#set -g monitor-silence 5
#set-hook alert-silence 'run-shell "echo hello"'
set-option -g status-interval 15
set-option -g status-right "#(~/bin/wifi_status.sh) "
set-option -ag status-right "#(~/repos/beepy-battery/src/battery.sh ) "
set-option -ag status-right "#(vcgencmd measure_temp | cut -c6-9 )C"
@k5njm
k5njm / convert.py
Created January 14, 2019 05:56
Proof of concept AWS Transcribe Diarization Display
from __future__ import print_function
import json
# Proof of concept AWS Transcribe Diarization Display
# Expects "asrOutput.json" to be in the same directory as thie file
# https://docs.aws.amazon.com/transcribe/latest/dg/how-it-works.html#how-diarization
with open('asrOutput.json', 'r') as f:
data = f.read()
{
"launches": [
{
"Test Launch 1": {
"Date": "Today",
"Type": "Falcon 9"
}
},
{
"Test Launch 2": {
if [ -z "$1" ]
then
region_list=($(aws ec2 describe-regions --query 'Regions[].RegionName[]' --output text | gsed -e 'y/\t/\n/' | gsed '1!G;h;$!d'))
else
region_list=$1
fi
clear
for i in "${region_list[@]}"
package ca.uwo.csd.cs2212.USERNAME;
public class BankAccount {
private double balance;
public BankAccount(double balance) {
this.balance = balance;
}