Skip to content

Instantly share code, notes, and snippets.

View bradfitz's full-sized avatar
On parental leave from Tailscale

Brad Fitzpatrick bradfitz

On parental leave from Tailscale
View GitHub Profile
View gist:ece099542079becafceff68f1c11b725
"Hostname": "tskrazy",
"Update": {
"Hostname": "",
"HTTPPassword": "xxxxx"
"Packages": [
View out.txt
=== RUN TestRepoStress
=== RUN TestRepoStress/normal
repo_test.go:61: after 10000, +131.322375ms
repo_test.go:61: after 20000, +145.117792ms
repo_test.go:61: after 30000, +157.902291ms
repo_test.go:61: after 40000, +156.549084ms
repo_test.go:61: after 50000, +155.986ms
repo_test.go:61: after 60000, +155.7875ms
repo_test.go:61: after 70000, +157.752625ms
repo_test.go:61: after 80000, +163.210541ms
View lil-connect-proxy.go
package main
import (
bradfitz / ossp-verify.go
Created June 1, 2022 19:52
OCSP verification tinkering
View ossp-verify.go
package main
import (
bradfitz / sock.txt
Created January 24, 2022 16:46
upgraded my NAS a bit
View sock.txt
############# free
total used free shared buff/cache available
Mem: 98774364 2635644 95638772 29756 499948 95242576
Swap: 7602172 0 7602172
############# lspci
00:00.0 Host bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 DMI2 (rev 02)
bradfitz / nardump.go
Created January 13, 2022 18:30
nix NAR dumper
View nardump.go
// nardump is like nix-store --dump, but in Go, writing a NAR
// file (tar-like, but focused on being reproducible) to stdout
// or to a hash with the --sri flag.
// It lets us calculate the Nix sha256 in shell.nix without the
// person running having Nix available.
package main
// For the format, see:
// See
bradfitz / tables.go
Last active August 5, 2021 02:11
View tables.go
const (
_ASCII_Hex_Digit = RangeTable("\x0f\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x000\x009\x00\x01\x00A\x00F\x00\x01\x00a\x00f\x00\x01\x00ASCII_Hex_Digit")
_Adlam = RangeTable("\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\xe9\x01\x00K\xe9\x01\x00\x01\x00\x00\x00P\xe9\x01\x00Y\xe9\x01\x00\x01\x00\x00\x00^\xe9\x01\x00_\xe9\x01\x00\x01\x00\x00\x00Adlam")
_Ahom = RangeTable("\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x17\x01\x00\x1a\x17\x01\x00\x01\x00\x00\x00\x1d\x17\x01\x00+\x17\x01\x00\x01\x00\x00\x000\x17\x01\x00?\x17\x01\x00\x01\x00\x00\x00Ahom")
_Anatolian_Hieroglyphs = RangeTable("\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00D\x01\x00FF\x01\x00\x01\x00\x00\x00Anatolian_Hieroglyphs")
_Arabic = RangeTable("\x06\x00\x00\x00\x00\x00\x00\x00\x15\x00\x00\x00\x1a\x00\x00\x00\x00\x06\x04\x06\x01\x00\x0
bradfitz / sqlplay.go
Created June 23, 2021 17:23
View sqlplay.go
package main
import (
View up-notes.txt
tailscale up
tailscale up --auth-key=xxxx
tailscale up --advertise-tags=tag:foo
tailscale up --advertise-tags=tag:foo --shields-up=true
tailscale up --advertise-tags= --shields-up=true # explicitly mentioned good
tailscale up --shields-up=true # ERROR: unmentioned thing is changing value
tailscale up [--init] --advertise-tags= --shields-up=true # init is fine
View homerunner.go
// homerunner is Brad's shitty Docker wrapper after he got tired of running
// HA nine-VM Kubernetes clusters. Earlier versions of this tried to use podman
// and fancy cloud-init and CNI stuff but then I decided to go to the other
// extreme and write something super specific to what I need and super dumb:
// run my containers from, and use my home Ceph cluster for mounts/state.
// This primarily runs Home Assistant, HomeSeer, an MQTT server, and some cameras.
// And some omitted misc stuff.
package main