Skip to content

Instantly share code, notes, and snippets.

@brettowe
brettowe / wgphys.sh
Last active September 5, 2025 16:43
wireguard namespace script, based off the script found here https://www.wireguard.com/netns/, made more automatic for pulling info from wg-quick configs and deal with a system using NetworkManager
#!/bin/bash
# based off the basic script idea found here: https://www.wireguard.com/netns/
set -ex
# namespace name
ns=physical
# ethernet type device list, seperated by spaces
physeth="enp1s0"
# wifi devices
physwifi="wlp2s0"
@brettowe
brettowe / x48-gcc15.patch
Created September 5, 2025 01:32
compile fix for x48-0.6.4 with gcc 15.2
diff -ur src/src/debugger.c src-update/src/debugger.c
--- src/src/debugger.c 2011-11-14 19:03:40.000000000 -0800
+++ src-update/src/debugger.c 2025-09-04 18:19:21.821404084 -0700
@@ -1585,7 +1585,7 @@
saturn.mem_cntl[1].config[0] = ram_base;
saturn.mem_cntl[1].config[1] = ram_mask;
- return;
+ return 0;
}
@brettowe
brettowe / fido-shutdown.py
Created May 4, 2022 21:28
script that uses a yubikey on headless machines without a power button to initialize shutdown
#!/usr/bin/env python3
# this script listens for a yubikey to be plugged into a device and shutdown if the button is pressed on it
# handy for headless devices that have no power buttons but need to be shutdown
# no verification is done to see if its an authorized yubi key
# changelog
# 20220504 - initial release
import functools
import os.path