Skip to content

Instantly share code, notes, and snippets.

View arachsys's full-sized avatar
💭
Please contact me by email

Chris Webb arachsys

💭
Please contact me by email
View GitHub Profile
@arachsys
arachsys / reverse-chatgpt
Last active January 5, 2025 19:42
Reverse ChatGPT
#!/bin/bash
set -o pipefail
shopt -s extglob
export LANG=C.UTF-8
export API=${API:-https://api.openai.com/v1/chat/completions}
export KEY=${KEY:-$(< ~/.config/secrets/openai)}
export MODEL=${MODEL:-gpt-4o}
@arachsys
arachsys / neighbour.c
Last active October 31, 2025 11:56
Monitor neighbour status
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <net/if.h>
#include <sys/socket.h>
@arachsys
arachsys / wgtunnel.md
Last active November 8, 2025 22:02
Quick wireguard tunnel instructions

Quick wireguard tunnel setup

This is a simple point-to-point tunnel between two hosts with no address restrictions on traffic routed through it. Fixed link-local addresses of fe80::1 and fe80::2 are assigned to the endpoints, suitable for running RFC 5549 link-local BGP.

Generate the secret and public keys

@arachsys
arachsys / debian.md
Last active June 6, 2026 20:57
Downloading a Debian root filesystem

Downloading a Debian root filesystem

This note is mainly for my own benefit but might be handy for others too.

Whenever I want an ad hoc Debian root filesystem to build and test my software on a mainstream consumer Linux distribution, I am frustrated by my struggle to find and download one.

Search engines turn up lots of documentation, but everything seems to involve weird Debian-specific tooling like debootstrap. Please stop!

@arachsys
arachsys / pwgen.py
Last active August 10, 2026 09:03
Generate phonetic passwords with reliable entropy
#!/bin/python
import functools, math, os, secrets, sys
letters = list('abcdefghijklmnopqrstuvwxyz')
digits = list('0123456789')
vowels = list('aeiou')
consonants = [ c for c in letters if c not in vowels ]
clusters = { c + 'y' for c in consonants if c not in 'qy' } | {