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
@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 / .env
Last active December 4, 2023 06:10
dockerfile configuration automation / interpolation with Jinja2
DEBIAN_RELEASE=bookworm
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 / 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
#!/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 / 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) ])) ]))' \"$*\"
[General]
cleanup=true
noauth=false
unpack=true
bootstrap=Debian
aptsources=Debian
[Debian]
packages=wine wine32
source=http://deb.debian.org/debian

Keybase proof

I hereby claim:

  • I am paigeadelethompson on github.
  • I am iampaigeat (https://keybase.io/iampaigeat) on keybase.
  • I have a public key ASDC_-i0e75eNJJ4_VK39VFRUYTXLbJElFBvDP3dQBjjpgo

To claim this, I am signing this object:

table inet filter { # handle 43
limit udp_in_log_lim { # handle 33
rate 1024/minute
}
limit udp_fwd_log_lim { # handle 34
rate 1024/minute
}
limit udp_out_log_lim { # handle 35