Skip to content

Instantly share code, notes, and snippets.

View gretel's full-sized avatar
🚀
the jitter does know where it is at none time

Tom Hensel gretel

🚀
the jitter does know where it is at none time
View GitHub Profile
@gretel
gretel / humanscanner.yaml
Last active May 27, 2025 22:41
ESPHome configuration for a 'Seeed MR60BHA2' presence radar that visualizes detected heart rate with an adaptive brightness LED heartbeat effect
---
substitutions:
devicename: 'humanscanner'
upper_devicename: 'HumanScanner'
logger_level: 'INFO'
esphome:
min_version: 2025.5.0
name: "${devicename}"
comment: 'https://esphome.io/components/seeed_mr60bha2.html'
#!/usr/bin/env python3
"""
pdf2json - Convert PDF documents to structured JSON using Kreuzberg
Usage: pdf2json input.pdf [output.json]
"""
import sys
import os
import json
import asyncio
@gretel
gretel / pdf2json_pymupdf.py
Last active May 14, 2025 10:26
Convert PDF documents to structured JSON (using PyMuPDF)
#!/usr/bin/env python3
"""
pdf2json - Convert PDF documents to structured JSON
Usage: pdf2json input.pdf [output.json]
"""
import sys
import os
import json
import argparse
@gretel
gretel / prepare-commit-msg
Created May 13, 2025 16:50
Git hook that uses LLMs via OpenWebUI to automatically generate conventional commit messages from staged changes
#!/bin/sh
# 1. Save as .git/hooks/prepare-commit-msg in your repository
# 2. Make executable with chmod +x .git/hooks/prepare-commit-msg
# 3. Set required environment variables:
# export OPENWEBUI_API_URL="https://your-openwebui-instance.com"
# export OPENWEBUI_API_TOKEN="your_token_here"
# export OPENWEBUI_API_MODEL="claude-3-7-sonnet" # Optional
# 4. Stage your changes with git add and commit normally with git commit
# Get the commit message from the temporary file
@gretel
gretel / check-for-updates.txt
Last active May 2, 2025 18:27
mikrotik routeros update check script - based on https://ondra.sluka.cz/posts/2023-06-13-mikrotik-check-for-updates/ but more robust
# Check for updates and mail admin if available
:local emailAddress "[email protected]"
# Set the update channel and check for updates
/system package update set channel=development
/system package update check-for-updates
# Get current version information
:local currver [/system package update get installed-version]
:local newver [/system package update get latest-version]
@gretel
gretel / Makefile
Last active November 21, 2024 01:10
control 'cm108' based radio interfaces on openbsd (inspired by https://github.com/twilly/cm108)
# CM108 GPIO control utility for OpenBSD
PROG= cm108
SRCS= cm108.c
MAN= # empty, no manpage yet
BINDIR= /usr/local/bin
BINOWN= root
BINGRP= bin
BINMODE= 555
@gretel
gretel / videodate.sh
Created July 11, 2024 00:15
Video File Date Adjustment Script - set file data according to the metadata of the video content
#!/bin/sh
# Video File Date Adjustment Script
#
# This script traverses a directory (and its subdirectories) to process video files
# (mp4, avi, mkv, mov) and their containing directories. For each video file, it:
#
# 1. Extracts the creation date from the file's metadata, prioritizing:
# a) com.apple.quicktime.creationdate
# b) container metadata
@gretel
gretel / printer.cfg
Created January 28, 2024 18:19
creality ender 3 2020 klipper configuration
# This line includes all the standard macros.
[include klipper-macros/*.cfg]
# Uncomment to include features that require specific hardware support.
# LCD menu support for features like bed surface selection and pause next layer.
[include klipper-macros/optional/lcd_menus.cfg]
# Optimized bed leveling
[include klipper-macros/optional/bed_mesh.cfg]
[include macro.cfg]
@gretel
gretel / .config
Last active October 31, 2023 21:29
openwrt diff configuration for a pcengine apu2 based dual minipcie 2.4/5ghz access point bridge providing wpa3
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_64=y
CONFIG_TARGET_x86_64_DEVICE_generic=y
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_ATH10K_LEDS=y
CONFIG_ATH10K_THERMAL=y
CONFIG_ATH9K_HWRNG=y
CONFIG_ATH9K_SUPPORT_PCOEM=y
@gretel
gretel / pico_w.yaml
Last active January 6, 2025 18:56
ESPHome on Raspberry Pi Pico W
---
substitutions:
devicename: 'picow'
upper_devicename: 'PicoWireless'
logger_level: 'INFO'
esphome:
name: ${devicename}
project:
name: "jitter.eu"