Skip to content

Instantly share code, notes, and snippets.

View paigeadelethompson's full-sized avatar
💭
🧫 making stuff

Paige Thompson paigeadelethompson

💭
🧫 making stuff
View GitHub Profile
[General]
cleanup=true
noauth=false
unpack=true
bootstrap=Debian
aptsources=Debian
[Debian]
packages=wine wine32
source=http://deb.debian.org/debian
@paigeadelethompson
paigeadelethompson / other crap
Last active July 11, 2023 16:22
irc bubbletea
/alias m exec -o python3 -c 'import itertools, textwrap, sys, random\; print("".join(["\x03{}{}".format(x, y) for x, y in zip(itertools.cycle([61, 85, 83, 59, 58, 69, 81, 80]), itertools.chain.from_iterable([(lambda t, tt: t + list(" " + tt + " ") + t)(random.sample([chr(y) for y in range(0x2580, 0x2585)] * 128, 8), "".join(a).strip()) for a in textwrap.wrap(" ".join(sys.argv[1:]), 50) ])) ]))' \"$*\"
#!/bin/bash
ip -j addr | jq -r '.[] | select(.ifname | startswith("tun")) | .ifname +" "+ .addr_info[0].local' | awk '{print $2"%"$1}' | parallel -u -j8 iperf --bind {} -c 10.1.0.1 -p 443 -i
1
@paigeadelethompson
paigeadelethompson / nftables.nft
Last active November 5, 2023 11:52
nftables jul 19 2023
flush ruleset
table inet filter { # handle 127
synproxy default-synproxy { # handle 37
mss 1460
wscale 7
timestamp sack-perm
}
synproxy identd-synproxy { # handle 38
def get_network_object(self, network, prefix_length):
net = ip_address(network)
if type(net) == IPv4Address:
return IPv4Network(net).supernet(new_prefix = prefix_length)
elif type(net) == IPv6Address:
return IPv6Network(net).supernet(new_prefix = prefix_length)
def network_object_to_uuid(self, network):
if type(network) == IPv4Network:
return uuid.UUID(bytes = bytes([0x00] * 12) + network.network_address.packed)
@paigeadelethompson
paigeadelethompson / .env
Last active December 4, 2023 06:10
dockerfile configuration automation / interpolation with Jinja2
DEBIAN_RELEASE=bookworm
@paigeadelethompson
paigeadelethompson / net.sh
Created December 13, 2023 20:52
NetNS / VRF with routes and ipv6
#!/bin/bash
/usr/bin/env ip netns delete _netcrave
/usr/bin/env ip link del vrf2
/usr/bin/env ip route flush table 2
/usr/bin/env ip rule add to 198.51.100.0/30 table 2
/usr/bin/env ip netns add _netcrave
/usr/bin/env ip netns exec _netcrave ip link set lo up
/usr/bin/env ip netns exec _netcrave ip link add ns0vrf2 type vrf table 2
@paigeadelethompson
paigeadelethompson / async_subprocess_with_logger.py
Last active December 18, 2023 07:42
asyncio subprocess command executor with python logging and stderr/stdio duplex
# IAmPaigeAT (paige@paige.bio) 2023
import logging
import asyncio.subprocess
import subprocess
import os, tempfile
from os import O_NONBLOCK
import itertools
from pathlib import Path
import sys
import time
cp /boot/config-5.10.0-22-amd64 .config
scripts/config -u CONFIG_SYSTEM_TRUSTED_KEYS
scripts/config -u CONFIG_BUILD_SALT
scripts/config -u CONFIG_CC_VERSION_TEXT
make olddefconfig
make V=1 -j4 all
make defconfig && mv .config config.defconfig
make allmodconfig && mv .config config.allmodconfig
cat config.defconfig | grep "=y" > .config
find lib/ crypto/ fs/ net/ drivers/ -type f -name "Kconfig" | xargs -i grep "^menuconfig " {} | grep -vP "(DEBUG|TEST)" | awk '{print "CONFIG_"$2}' | xargs -i scripts/config -e {}
cat config.allmodconfig | grep "=m" >> .config
make olddefconfig