Skip to content

Instantly share code, notes, and snippets.

@EClaesson
EClaesson / .config__containers__systemd__docker_in_docker.container
Created July 2, 2026 15:19
Forgejo runner with DinD under rootless Podman
[Unit]
Description=Docker-in-Docker for Forgejo Runner
Wants=network-online.target
After=network-online.target
[Container]
Image=docker.io/library/docker:29.5.2-dind
ContainerName=docker_in_docker
Network=runner_internal.network
AddHost=forgejo.example.com:10.11.12.13 # Manual mapping of domain if runners are on same machine as Forgejo.
@EClaesson
EClaesson / export_secret.sh
Created July 2, 2026 15:07
Using a Podman secret outside of a container
export SECRET="$(podman secret inspect --showsecret <name> --format '{{.SecretData}}')
@EClaesson
EClaesson / reconnect_gluetun_vpn.sh
Created July 2, 2026 15:05
Gluetun VPN tunnel reconnection
#!/usr/bin/env bash
set -u
# EXEC_CONTAINER must share gluetun's netns (Network=container:gluetun) AND have curl.
# The gluetun image itself has no curl (only wget without PUT support), which is why a sidecar is used for the API calls.
EXEC_CONTAINER="my-container"
GLUETUN_CONTAINER="gluetun"
GLUETUN_CONTROL_API_BASEURL="http://127.0.0.1:8000"
MAX_CONN_WAIT_SEC=180
@EClaesson
EClaesson / update_infra.sh
Created July 2, 2026 14:44
Rootless Podman Git repository reconciler
# update_infra.sh — pull-based GitOps reconciler for a single-user, rootless
# systemd/Quadlet setup. Syncs a git repo to the filesystem and reconciles the
# affected `systemd --user` units. Intended to run on a schedule (cron/timer).
#
# Behaviour:
# - Repo lives at ~/infra and tracks origin/main. Each run fetches; if
# origin/main advanced it does `git reset --hard origin/main` (local repo
# changes are discarded) and applies only the diff since the last run.
# - Path mapping — ONLY these two prefixes are synced, everything else ignored:
# <user>/... -> ~/... (e.g. <user>/.config/foo -> ~/.config/foo)
import bpy
#########################################
# Configuration #
#########################################
# If True, key modifiers will be skipped (always set to NONE).
IGNORE_KEY_MODIFIER = False