Skip to content

Instantly share code, notes, and snippets.

View SpaghettiBorgar's full-sized avatar

Colin Kubon SpaghettiBorgar

View GitHub Profile
@SpaghettiBorgar
SpaghettiBorgar / portforward
Last active January 15, 2026 23:34
NAT-PMP multi port symmetric forwarding script for wireguard connections
#!/bin/bash
### Wireguard NAT-PMP port forwarding script
# https://gist.github.com/SpaghettiBorgar/83dccbcec9edcd2951bbd5debde67136
# Default values
: ${PMP_ROUTER:=10.2.0.1}
: ${PMP_INTERVAL:=50} # nat-pmp request lifetime will be set to PMP_INTERVAL+10
: ${PMP_PORT_PREFIX:=5000} # maps to local por1ts 50001-50009
: ${PMP_TUN:=tun0}
: ${PMP_PORT_UP_CMD1:='echo Port 1 is $PORT'} # use $PORT for the forwarded port and be sure to escape the entire command as a bash command string
@SpaghettiBorgar
SpaghettiBorgar / Layout Piano Colemak.scr
Last active May 8, 2023 11:56
Colemak keyboard layout for FL Studio. Place in "FL Studio/System/Config/Typing to piano/Layout Piano Colemak.scr"
LOCK
61
63
LOCK
66
68
70
LOCK
73
75
@SpaghettiBorgar
SpaghettiBorgar / mpv-clip.lua
Created April 5, 2020 18:42
mpv script to quickly create gifs, video clips, and sound clips
-- Create animated GIFs with mpv
-- Requires ffmpeg, gifski, exiftool, and vorbis-tools.
-- Based on github.com/Scheliux/mpv-gif-generator
-- Usage: "g" to set start frame, "G" to set end frame,
-- "Ctrl+g" to create gif
-- "Ctrl+v" to create video clip
-- "Ctrl+a" to create audio clip
-- Metadata about the filename and timestamps will be written in the comment tag
local msg = require 'mp.msg'