9.9K
Various small but useful Python utilities, experiments, and scripts collected in one place. Some are stand‑alone command‑line tools, others are small libraries or demo apps. A Docker image is provided to bundle the collection for easy, reproducible execution on multiple CPU architectures.
Quick links:
Dockerfile and published via multi‑arch buildsContents overview (Python packages/modules):
broadlinkstuff: Broadlink RM4 IR/RF blaster — learn/send codes and compute the full Coolix (Midea) climate matrixdinogame: pathfinding/visualization playground inspired by “The Farmer Was Replaced”dnsstuff: SPF resolution helper and ipset updater for allow‑listing email senders (e.g. pcbway.com)ecowittstuff: simple client/types for Ecowitt weather station APIgcalstuff: CLI tool for creating Google Calendar events with day‑view confirmationhydromailstuff: assemble and send "hydro"/weather summary emails, pulling data from MQTT/Netatmok3shelperstuff: K3s kubeconfig credential synchronization, user-certificate issuing, a Keel image-drift checker and a version-pin drift checkerllmstuff: helpers for working with LLM APIs and local OCRmqttstuff: tiny MQTT wrapper utilitydhcpstuff: DHCP discover tool and diagnostic script for unwanted DHCP on Linuxnetatmostuff: Netatmo data fetch helper and deployment exampleoepnvstuff: GTFS‑Realtime coverage checker — validates whether an open GTFS‑RT feed actually carries real‑time data for configurable lines/stations, with watch mode, departure board and MQTT publishingmqttwebstuff: live web view onto arbitrary MQTT streams — mountable mapper plugins (filter/map per message), server‑side last‑value cache, SSE push to an htmx/PicoCSS frontend; ships an oepnv departure‑board plugin and a generic view (indented topic tree by default, flat JSON cards via --view flat)ucmstuff: monitor and control a Grandstream UCM6204 IP‑PBX — real‑time call events over WebSocket plus request/response control via the HTTPS APIuptimekumastuff: provision, migrate and back up Uptime Kuma 2.x declaratively — idempotent YAML apply, Ansible module, full export/import, direct Socket.IO clientHelper.py, configs (config.yaml, config.py, optional config.local.yaml), scriptssipstuff (vroomfondel/sipstuff), flickrdownloaderstuff (vroomfondel/flickrtoimmich, image xomoxcc/flickr-download)mqttstuff and reputils (via PyPI)Standalone Docker image sub‑projects (each with own Dockerfile and build.sh):
tangstuff: Tang server for LUKS/Clevis network‑bound disk encryptionmosquitto-2.1: Mosquitto 2.1 MQTT broker with dynamic securitypython314jit: Python 3.14 base image with JIT supportpython314pandasmultiarch: Python 3.14 base image with pandas (multi‑arch)f2bapistuff: fail2ban plus a remote ban API (xomoxcc/f2b-api) — client sidecar and server in one imagepostfixpgsqlstuff: Postfix with PostgreSQL maps and policyd-spf for a Kubernetes mail podnfs-subdir-external-provisioner: Kubernetes NFS provisioner (external submodule with local overlay)Local prerequisites:
python:3.14-slim-trixie)pip and a virtualenv of your choiceInstall dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt -r requirements-dev.txt
Configuration:
config.yaml contains sample/defaults. Do not commit secrets. If needed, create config.local.yaml to override locally (kept out of the image by default). Some modules read credentials/API keys from here (e.g. Ecowitt, Netatmo, MQTT, email settings). Adjust as needed before running modules that require it.Run tests and type checks:
pytest -q
mypy .
DHCP discovery and diagnostic tools. Includes a Python DHCP Discover sender that displays all responses (including Proxy DHCP/PXE boot servers) and a bash diagnostic script for finding unwanted DHCP on physical interfaces (Ubuntu Server).
sudo python -m dhcpstuff -i eth0 -a efi64
-i interface, -t timeout, -m MAC, -a PXE architecture (bios, efi64, efi64-http).diagnose-dhcp.sh checks cloud-init, netplan, systemd-networkd, NetworkManager, kernel cmdline, leases, and hooks for unwanted DHCP sources.Talk to Broadlink RM4 IR/RF blasters: address devices without a broadcast, learn IR/RF codes, send stored or raw codes, and compute Midea/Coolix air-conditioner codes instead of learning all 280 mode x fan x temperature combinations by hand.
broadlinkstuff/broadlinkhelper.pypython -m broadlinkstuff.broadlinkhelper devices
python -m broadlinkstuff.broadlinkhelper learn-ir Lounge
python -m broadlinkstuff.broadlinkhelper climate Lounge --mode heat --temp 23
python -m broadlinkstuff.broadlinkhelper special Lounge swing
config.yaml — broadlinkstuff/broadlink.yaml (documented sample, committed) with broadlink.local.yaml (real devices, gitignored, taken from the current working directory) merged over it. No devices configured means every command falls back to a broadcast search; discover prints a ready-made YAML block to paste in.learn-ir can be piped.selftest verifies the Coolix generator against the learned reference codes; decode analyses any packet without touching hardware.Pathfinding toy project and visualization to prototype search/planning strategies on a grid world, loosely inspired by “The Farmer Was Replaced”. Useful to experiment with A* heuristics and safe‑move constraints while visualizing planning vs execution.
dinogame/dinogame.py contains a main() that renders a GIF of a planning/execution sequence.matplotlib, numpy (matplotlib is commented out in requirements.txt by default; enable it to use this module).python -m dinogame.dinogame
This saves an animated GIF (via pillow) to your desktop by default; see code comments to tweak world size and frame count.
Script to crawl SPF records (including nested include: chains) for one or more domains, resolve them to IPv4 ranges/addresses, then update an ipset. The ipset can be used by your MTA/firewall to allowlist specific SMTP sources. Originally motivated by receiving mails from pcbway.com while using country‑based IP blocks.
python -m dnsstuff.spf_ipset_updater [--ipset-name NAME] [--ipset-type TYPE] [--dry-run] [domain ...]
UID 0), updates/swap‑refreshes the target ipset (default: smtpallowlist) using pyroute2.ipset.dnspython, pyroute2.Small client types and functions to call the Ecowitt API and parse real‑time weather data into typed models.
ecowittstuff/ecowittapi.py defines pydantic models (e.g. WeatherStationResponse) and get_realtime_data().ecowitt.application_key, ecowitt.api_key, ecowitt.mac, URLs in config.yaml.python -c "from ecowittstuff.ecowittapi import get_realtime_data; print(get_realtime_data())"
CLI tool for creating Google Calendar events via OAuth2 Desktop flow. Shows all existing events for the target day across all user calendars and requires explicit confirmation before creating the new event.
gcalstuff/gcal_event.py~/.config/gcal/credentials.json. On first run the browser‑based OAuth flow creates ~/.config/gcal/token.json.python -m gcalstuff.gcal_event "Meeting" 2025-07-15 14:00
python -m gcalstuff.gcal_event "Lunch" 2025-07-15 12:00 -d 90 --description "Team lunch"
google-auth, google-auth-oauthlib, google-api-python-client.~/.config/gcal into the container (read‑write, since the token gets refreshed).Compose and send a status email summarizing recent measurements (e.g., water level, rain totals, ambient data). Pulls latest values from MQTT topics and Netatmo.
hydromailstuff/hydromail.py → do_main_stuff().mqtt.*), and Netatmo credentials under netatmo.* in config.yaml.hydromailstuff/somestuff_hydromail_cronjob.yml.Helper utilities to interact with LLM providers or local OCR pipelines.
llmstuff/llmhelper.py, llmbatchhelper.py, ollamadeepseekocr.py.google.* and anthropic.* in config.yaml if you want to call those providers.Minimal MQTT wrapper(s) and helpers.
mqttstuff/mosquittomqttwrapper.py.mqtt.* and mqtt_topics.* in config.yaml (topics include metadata such as subscribe flag and default metadata).Read Netatmo measurements and provide a deployment example.
netatmostuff/lnetatmo.py, deployment example somestuff_netatmo_deployment.yml.netatmo.username/password/client_id/client_secret (and optional module IDs) in config.yaml.Helpers around a K3s/Kubernetes cluster: kubeconfig credential synchronization, client certificates for new users, a Keel image-drift checker and a version-pin drift checker.
k3shelperstuff/update_local_k3s_keys.py, k8s_user_cert.py, keel_drift.py, pin_drift.pypython -m k3shelperstuff.update_local_k3s_keys -H myserver -c my-k3s-context
python -m k3shelperstuff.k8s_user_cert extern-admin --role view -o /tmp/extern.yaml
python -m k3shelperstuff.keel_drift --drift-only --fix-command
python -m k3shelperstuff.pin_drift --updates-only
update_local_k3s_keys fetches the kubeconfig from a K3s server via SSH and interactively syncs credentials/CA into ~/.kube/config; k8s_user_cert issues a CSR-signed user certificate with optional (Cluster)RoleBinding and merges it into a kubeconfig; keel_drift compares the digest a pod runs against the digest its tag points at (exit 1 on drift); pin_drift checks version pins from pin_drift.yml against the newest GitHub/Forgejo release.~/.kube (and ~/.ssh for the SSH fetch) read-write; keel_drift also runs in-cluster as a Job/CronJob.Monitor and control a Grandstream UCM6204 IP‑PBX from Python, over both of its interfaces: the WebSocket (/websockify) pushes real‑time events (UCMEventClient, auto‑reconnect + heartbeat, web user), the HTTPS API (/api) takes control requests such as acceptCall, refuseCall, Hangup, dialExtension and CDR queries (UCM6204, API user; UCM6204Rest adds a typed method per API action). TrunkCallRouter / IncomingCall route incoming trunk calls on a caller‑based branch.
ucmstuff/ucm6204_api.py (core + Typer CLI + /healthz for K8s probes), ucm6204_api_rest.py, example_router.py.python -m ucmstuff.ucm6204_api --host ucm.example.lan --port 8089 \
--web-user webuser --web-password '…' --api-user cdrapi --api-password '…' --trunk MyTrunk
somestuff_ucm6204_deployment.yml — outbound‑only pod, /healthz on 8070; real credentials in *.local.* (gitignored).@SECLEVEL=1 automatically.Provision, migrate and back up Uptime Kuma 2.x declaratively and idempotently instead of clicking monitors together in the web UI (nothing here monitors anything itself).
uptimekuma_client.py: KumaClient, a direct Socket.IO client with fresh reads and idempotent upsert_monitor/upsert_notification (the PyPI uptime-kuma-api cannot write against 2.x and reads from a stale cache).uptimekuma_apply.py: desired state from YAML, re‑runnable, names instead of IDs, --check and --prune.uptimekuma_monitor.py: Ansible module for per‑monitor management with full check mode.uptimekuma_simpleapi.py: full export/import (monitors, notifications, tags, status pages) for backup and migration.python -m uptimekumastuff.uptimekuma_apply -f kuma_state.local.yml --check
python -m uptimekumastuff.uptimekuma_simpleapi export --url https://kuma.example.lan --out state.local.json
uptimekuma.local.env, env vars or --username/--password (API keys only work for /metrics).Validate whether an open GTFS‑Realtime feed actually carries real‑time data for specific lines at a specific station — aggregators like gtfs.de merge whatever agencies deliver, often schedule only. One‑shot check or --watch poll loop (conditional HTTP requests, staleness detection via FeedHeader.timestamp), pluggable on_* handlers and an optional MQTT bridge (per‑line status, departure board, alerts, stale events).
oepnvstuff/check_realtime.py (Typer CLI); core in monitor.py, gtfs_static.py, gtfs_realtime.py, mqtt_bridge.py.python -m oepnvstuff.check_realtime --lines "195,295" --station Ellerbek --show-stops
python -m oepnvstuff.check_realtime --watch --mqtt
OEPNV_* env var; the static feed (~250 MB) is cached with HTTP validators. Exit codes: 0 realtime, 2 schedule only/stale, 3 line/stop unknown, 1 error.somestuff_oepnv_deployment.yml with OEPNV_STOP_ON_STALE=1 as self‑healing.A live web view onto arbitrary MQTT streams: the server subscribes to the broker, runs every message through a mapper plugin (a plain Python file, in Kubernetes mounted via ConfigMap) and pushes rendered HTML fragments to the browsers via Server‑Sent Events; frontend htmx + PicoCSS, all assets vendored. A server‑side last‑value cache makes non‑retained streams browsable; without a plugin a generic mode shows any topic tree as an indented hierarchy (or flat JSON cards via --view flat).
serve.py (Typer CLI), hub.py, plugin_api.py (ViewEvent contract), webapp.py (FastAPI: /, /stream, /healthz).python -m mqttwebstuff.serve --mapper mqttwebstuff/plugins/oepnv_view.py --mqtt-host broker.example.org
python -m mqttwebstuff.serve --mapper "" --topics 'nodered/#' --item-ttl 0 --mqtt-host broker.example.org
MQTTWEB_* env var; deployment somestuff_mqttweb_deployment.yml (behind nginx‑ingress: no proxy buffering, long read timeout).There is a single Docker image defined by the repo‑root Dockerfile. It is a plain single‑stage build on python:3.14-slim-trixie (the PJSIP/piper build stages left together with sipstuff, which is now a standalone repo):
htop, procps, vim, tini, bind9-dnsutils, ipset, git, exiftool, iputils-ping.de_DE.UTF-8 locale and the Europe/Berlin timezone.requirements.txt.pythonuser, UID 1200, configurable via build args UID, GID, UNAME) and runs as that user./app and sets PYTHONPATH=/app.GITHUB_REF, GITHUB_SHA, BUILDTIME.tini --, default CMD tails the log (adjust for your workload).docker build \
--build-arg buildtime="$(date +'%Y-%m-%d %H:%M:%S %Z')" \
-t xomoxcc/somestuff:python-3.14-slim-trixie \
.
Run interactively (example):
docker run --rm -it \
-v $(pwd)/config.yaml:/app/config.yaml:ro \
xomoxcc/somestuff:python-3.14-slim-trixie \
python -m dnsstuff.spf_ipset_updater pcbway.com
This repo includes a helper script build.sh that:
DOCKER_TOKENUSER and DOCKER_TOKEN in env on first run)buildx builder exists (and installs binfmt/qemu if needed)docker buildx build --platform linux/amd64,linux/arm64 --push with tagsdocker_build_local.logUsage:
./build.sh # multi‑arch build & push
./build.sh onlylocal # local build only (no push)
The script also sets DOCKER_CONFIG to the bundled docker-config/ directory so the builder state is isolated per‑repo. The primary tag is xomoxcc/somestuff:python-3.14-slim-trixie and an additional :latest tag is automatically added if missing.
Each sub‑project has its own Dockerfile, build.sh, and README.md:
Python 3.14 base image with JIT support for experimenting with Python 3.14's new features and performance.
python314jit/README.md for details.Python 3.14 base image with pandas pre‑installed, built for multi‑arch (amd64 + arm64).
python314pandasmultiarch/README.md for details.Mosquitto 2.1 MQTT broker with dynamic security plugin, multi‑arch build.
mosquitto-2.1/README.md for details.Tang server for LUKS/Clevis network‑bound disk encryption (NBDE), enabling automatic disk unlock on trusted networks.
tangstuff/README.md for details.fail2ban 1.1.0 plus a remote ban API in one image: the client side runs as a fail2ban sidecar whose bans are posted to the API, the server side owns the jails remote-<client> and the host firewall.
f2bapistuff/README.md for details.Postfix with PostgreSQL maps and the SPF policy daemon; configuration is mounted by the deployment.
postfixpgsqlstuff/README.md for details.Kubernetes NFS external provisioner (git submodule from upstream). Local modifications are stored in overlays/nfs-subdir-external-provisioner/ and applied at build time.
make build-nfs (applies overlay, then builds)This is a living collection; no strict semantic versioning. Expect occasional breaking changes. A rough, humorous version might be “-0.42”.
This project is licensed under the LGPL where applicable/possible — see LICENSE.md. Some files/parts may use other licenses: MIT | GPL | LGPL. Always check per‑file headers/comments.
This is a development/experimental project. For production use, review security settings, customize configurations, and test thoroughly in your environment. Provided "as is" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. Use at your own risk.
Content type
Image
Digest
sha256:67af9468a…
Size
200 MB
Last updated
about 17 hours ago
docker pull xomoxcc/somestuff