6.0K
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):
dinogame: 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 utilityllmstuff: 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 examplesipstuff: SIP caller — phone calls with WAV playback or piper TTS via PJSUA2, with silence detection, call recording, and speech-to-text transcription via faster-whisperucmstuff: monitor and control a Grandstream UCM6204 IP‑PBX — real‑time call events over WebSocket plus request/response control via the HTTPS APIHelper.py, configs (config.yaml, config.py, optional config.local.yaml), scriptsmqttstuff 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)nfs-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.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.K3s kubeconfig credential synchronization utility. Fetches the kubeconfig from a remote K3s server via SSH, compares user credentials and cluster CA data against the local ~/.kube/config, and interactively updates any differences.
k3shelperstuff/update_local_k3s_keys.pypython -m k3shelperstuff.update_local_k3s_keys
python -m k3shelperstuff.update_local_k3s_keys -H myserver -c my-k3s-context
~/.kube into the container (read‑write, since the script updates the local kubeconfig). The script SSHs to the remote host, so ~/.ssh must also be accessible.SIP caller module using PJSUA2. Registers with a SIP/PBX server, dials a destination, plays a WAV file or synthesizes speech via piper TTS on answer, and hangs up. Designed for headless/container operation (null audio device, no sound card required).
Features:
de_DE-thorsten-high. Optional ffmpeg resampling to SIP‑friendly rates (8000/16000 Hz).--record), transcribe via faster‑whisper (--transcribe) with Silero VAD pre‑filtering. Outputs a JSON call report with segment timestamps, audio duration, and language probability.--wait-for-silence delays playback until the callee finishes speaking (RMS‑based SilenceDetector on the incoming audio stream).--public-address for K3s/SNAT scenarios where auto‑detection returns an unreachable IP.--repeat, --pre-delay, --post-delay, --inter-delay.CLI usage:
# WAV playback
python -m sipstuff.cli call --server pbx.local --user 1000 --password secret \
--dest +491234567890 --wav alert.wav
# Text-to-speech
python -m sipstuff.cli call --server pbx.local --user 1000 --password secret \
--dest +491234567890 --text "Achtung! Wasserstand kritisch!"
# Record, transcribe, and wait for callee to finish speaking
python -m sipstuff.cli call --server pbx.local --user 1000 --password secret \
--dest +491234567890 --wav alert.wav \
--record /tmp/recording.wav --transcribe --wait-for-silence 1.0
# With NAT traversal and TLS transport
python -m sipstuff.cli call --server pbx.local --user 1000 --password secret \
--dest +491234567890 --wav alert.wav \
--transport tls --srtp mandatory \
--stun-servers stun.l.google.com:19302 --ice
SIP_* environment variables, or direct CLI arguments. Priority: CLI overrides > env > YAML.make_sip_call() for one‑off calls, SipCaller context manager for multiple calls, generate_wav() for standalone TTS, transcribe_wav() for standalone STT.pjsua2 (PJSIP Python bindings, built from source in Docker), pydantic, ruamel.yaml, loguru.Monitor and control a Grandstream UCM6204 IP‑PBX from Python. The UCM exposes two independent interfaces with different session models, and this module talks to both:
/websockify): the UCM pushes real‑time events (ActiveCallStatus, ExtensionStatus, PbxStatus, …). Handled by UCMEventClient (auto‑reconnect + heartbeat), authenticated with a web user./api): request/response control and queries (acceptCall, refuseCall, Hangup, dialExtension, CDR, …). Handled by UCM6204, authenticated with an API user. UCM6204Rest adds a named, typed method for every HTTPS‑API action (trunks, routes, IVRs, queues, paging, accounts, users, dialing/transfer, …).To both monitor and control calls you run both clients together (the "coordinated" setup); TrunkCallRouter / IncomingCall route incoming calls on a trunk to a caller‑based branch.
ucmstuff/ucm6204_api.py (core + Typer CLI + /healthz server for K8s probes), ucm6204_api_rest.py (full typed API), example_router.py.--trunk; omit for monitor‑only):python -m ucmstuff.ucm6204_api \
--host ucm.example.lan --port 8089 \
--web-user webuser --web-password '…' \
--api-user cdrapi --api-password '…' \
--trunk MyTrunk
requests, typer, websocket-client.somestuff_ucm6204_deployment.yml — one pod = events + control, outbound‑only to the UCM (no service/ingress), /healthz on port 8070 backs the liveness/readiness probes. Config with real credentials goes in *.local.* (gitignored); commit only the .example variants.@SECLEVEL=1) automatically. Real‑time events use the WebSocket model — the url report‑push parameter in Grandstream's older PDF guide is a dead legacy field on current firmware.The Flickr photo backup functionality has been moved to a standalone repository: github.com/vroomfondel/flickrtoimmich
The Docker image is still available at Docker Hub: xomoxcc/flickr-download.
Helper.py: JSON helpers including a ComplexEncoder to serialize datetimes, UUIDs, and custom objects with repr_json()/as_string().config.py: config loader/merger; use config.local.yaml to keep secrets out of VCS and override defaults.scripts/update_badge.py: helper used in CI to update the clones badge.tests/: basic test scaffold.There is a single Docker image defined by the repo‑root Dockerfile. It uses a three‑stage multi‑stage build:
python:3.14-slim-trixie): compiles PJSIP 2.16 with Python bindings (pjsua2) and stages the shared libraries.python:3.12-slim-trixie): creates a self‑contained Python 3.12 venv with piper-tts (piper‑phonemize has no Python 3.14 wheels). The portable Python 3.12 runtime and venv are copied into the final image at /opt/python312 and /opt/piper-venv.python:3.14-slim-trixie):
htop, dnsutils, tini, ffmpeg, etc.) and audio runtime libraries (libasound2, libssl3, libopus0).requirements.txt.pythonuser, configurable via build args UID, GID, UNAME)./app and sets PYTHONPATH accordingly.GITHUB_REF, GITHUB_SHA, BUILDTIME.tini --, default CMD tails the log (adjust for your workload).Why this is useful:
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.
.github/workflows/buildmultiarchandpush.yml builds and pushes multi‑arch images on CI..github/workflows/mypynpytests.yml runs mypy + pytest..github/workflows/checkblack.yml checks code style..github/workflows/update-clone-badge.yml updates the clones badge.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.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:7ba9b91ab…
Size
183.3 MB
Last updated
about 1 hour ago
docker pull xomoxcc/somestuff:python-3.14-slim-trixie