View lil-connect-proxy.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"os" | |
) |
View ossp-verify.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/tls" | |
"crypto/x509" | |
"io/ioutil" | |
"log" | |
"net/http" |
View sock.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############# 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) |
View nardump.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 git-pull-oss.sh having Nix available. | |
package main | |
// For the format, see: | |
// See https://gist.github.com/jbeda/5c79d2b1434f0018d693 |
View tables.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View sqlplay.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"flag" | |
"fmt" | |
"html" | |
"io" | |
"io/ioutil" | |
"log" |
View up-notes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tailscale up | |
tailscale up --auth-key=xxxx | |
FIX: | |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 gcr.io, 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 |
View tailscale-acl.cue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "net" | |
#Policy | |
#Policy: { | |
ACLs: [...#ACLRow] | |
Groups: #Groups | |
Hosts: #Hosts | |
TagOwners: [#TagName]: [...#TagOwner] | |
Tests: [...#ACLTest] |
View gist:7493e5b4d88a78e6430338bd9bde90de
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sqlite3 | |
sqlite> .mode csv | |
sqlite> .import brad-2016-2020.csv items | |
sqlite> .import brad-2021-ytd.csv items | |
sqlite> .mode column | |
sqlite> .width 40 | |
sqlite> .header on | |
sqlite> CREATE VIEW money_cat AS select Category, sum(Cast(Ltrim("Item Total", "$") as decimal)) as "Sum", count(*) from items group by Category; | |
sqlite> select category, round(100 * sum / (select sum(sum) from money_cat), 2) as "percent", "count(*)" from money_cat order by 2 desc limit 50; | |
Category percent count(*) |
NewerOlder