Skip to content

Instantly share code, notes, and snippets.

View mortn's full-sized avatar
🐙

Morten Abildgaard mortn

🐙
  • IKEA
  • Europe, mostly
View GitHub Profile
@mortn
mortn / hickorydns.container
Last active September 12, 2025 21:57
HickoryDNS Podman Quadlet (rootless, yea baby!)
# .config/containers/systemd/hickorydns.container
[Container]
ContainerName=hickorydns
Image=docker.io/hickorydns/hickory-dns:latest
PublishPort=53:53/udp
UserNS=keep-id:uid=100,gid=100
Volume=%h/hickory/etc:/etc:ro
Volume=%h/hickory/zones:/var/named:ro
AutoUpdate=registry
AddCapability=NET_BIND_SERVICE
@mortn
mortn / cloudhv@.service
Last active August 28, 2025 21:18
Systemd template unit for controlling Cloud-hypervisor guests
[Unit]
Description=Cloud-Hypervisor for %i
After=network.target
After=local-fs.target
After=remote-fs.target
After=systemd-logind.service
After=systemd-machined.service
Wants=network.target
[Service]
@mortn
mortn / nft.sh
Created April 1, 2016 21:33
nftables example - blatantly nicked from gentoo.org
#!/bin/bash
nft="/sbin/nft";
# ruleset, masquerade and full reject support are available starting with Linux Kernel 3.18
${nft} flush ruleset;
export LAN_IN=enp3s6
export LAN_ML=enp2s0
export WAN=ppp0
@mortn
mortn / gnome-terminal-ubuntu-profile.toml
Last active March 20, 2025 21:57
Gnome terminal with Ubuntu colours and palette
[/]
default='aaaaaaaa-8fd6-47c6-a14e-6b2769bf2e5e'
list=['aaaaaaaa-8fd6-47c6-a14e-6b2769bf2e5e']
[:aaaaaaaa-8fd6-47c6-a14e-6b2769bf2e5e]
audible-bell=false
background-color='#300924'
bold-is-bright=true
foreground-color='#FFFFFF'
palette=['#2E3436', '#CC0000', '#4E9A06', '#C4A000', '#3465A4', '#75507B', '#06989A', '#D3D7CF', '#555753', '#EF2929', '#8AE234', '#FCE94F', '#729FCF', '#AD7FA8', '#34E2E2', '#EEEEEC']
@mortn
mortn / 10-wgsrv.netdev
Created March 15, 2025 15:53
Wireguard setup with plain systemd networkd
# /etc/systemd/network/10-wgsrv.netdev
[NetDev]
Name=wgsrv
Kind=wireguard
Description=WireGuard wgsrv
[WireGuard]
ListenPort=51820
PrivateKeyFile=[path-to-private-key]
@mortn
mortn / flatpak-setup-gnome.sh
Created March 11, 2025 20:02
Flatpak setup on Debian-based distro with Gnome
sudo apt install flatpak gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# reboot system, and all flatpaks are available
@mortn
mortn / dhcp-leases.py
Created March 11, 2025 18:40
Show current DHCP leases for all interfaces when using systemd networkd as DHCP server
#!/usr/bin/env python3
import json
from os import listdir, path
from datetime import datetime
# this is the default path on Debian-based distros
DHCP_DIR = '/var/lib/systemd/network/dhcp-server-lease'
def main():
lfiles = [path.join(DHCP_DIR,lf) for lf in listdir(DHCP_DIR)]
@mortn
mortn / jellyfin.container
Last active February 7, 2025 22:43
Jellyfin Quadlet
[Container]
Image=docker.io/jellyfin/jellyfin:latest
ContainerName=jellyfin
AutoUpdate=registry
PublishPort=8096:8096
Volume=%h/jellyfin/cache:/cache:Z
Volume=%h/jellyfin/config:/config
Volume=/data/video:/media/video
#Mount=type=bind,source=/data/audio,destination=/media/audio,ro=true
@mortn
mortn / postgres.container
Last active December 2, 2024 21:53
Postgres quadlet
[Container]
Image=docker.io/postgres:latest
ContainerName=postgres
UserNS=keep-id:uid=999,gid=999
AutoUpdate=registry
PublishPort=5432:5432/tcp
Volume=%h/pgdata:/var/lib/postgresql/data
EnvironmentFile=%h/.config/containers/systemd/postgres.env
[Service]
@mortn
mortn / kubernetes.sources
Last active November 25, 2024 22:38
Kubernetes Debian/Ubuntu APT repo in deb822 format
Types: deb
Architectures: amd64
URIs: https://pkgs.k8s.io/core:/stable:/v1.31/deb/
Suites: /
Signed-By:
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBGMHoXcBCADukGOEQyleViOgtkMVa7hKifP6POCTh+98xNW4TfHK/nBJN2sm
u4XaiUmtB9UuGt9jl8VxQg4hOMRf40coIwHsNwtSrc2R9v5Kgpvcv537QVIigVHH
WMNvXeoZkkoDIUljvbCEDWaEhS9R5OMYKd4AaJ+f1c8OELhEcV2dAQLLyjtnEaF/