Skip to content

Instantly share code, notes, and snippets.

View wizardishungry's full-sized avatar
🐫
Copyright 1987-2013, Larry Wall

Jon Williams wizardishungry

🐫
Copyright 1987-2013, Larry Wall
View GitHub Profile
@wizardishungry
wizardishungry / go-tools.zsh
Created July 3, 2023 17:00
ZSH function to commands vendored in tools.go. `gt toolname` -> `go run example.com/tool/cmd/toolname`
function gt { go run $(go list -f '{{join .Imports "\n" }}' -tags tools tools.go | egrep "\/$1\$" ) }
@wizardishungry
wizardishungry / benchcmp
Created March 6, 2022 02:37
testing hls-await benchmarks on my raspberry pi 2 :-)
benchmark old ns/op new ns/op delta
BenchmarkScoreImage/gzip256 19301022 1543641522 +7897.72%
BenchmarkScoreImage/gif256 20331217 1507603817 +7315.22%
BenchmarkScoreImage/gif 257903567 18245462256 +6974.53%
BenchmarkScoreImage/png256 19827400 1367371356 +6796.37%
BenchmarkScoreImage/jpeg256 27591326 1800628285 +6426.07%
BenchmarkScoreImage/jpeg 6786711 402659528 +5833.06%
BenchmarkScoreImage/png 21518215 1025579140 +4666.10%
BenchmarkScoreImage/gzip 110047 5182135 +4609.02%
@wizardishungry
wizardishungry / crap.sh
Created March 6, 2022 02:23
oneliner to build a go package for every platform
go tool dist list |xargs -n 1 |sed -e 's#^\(.*\)/\(.*\)#GOOS=\1 GOARCH=\2 go build -o \1_\2 .#' |xargs -P 0 -n 1 -d \\n sh -c
@wizardishungry
wizardishungry / vmm-alpine.sh
Last active May 22, 2020 18:04 — forked from voutilad/vmm-alpine.sh
Installing Alpine Linux in OpenBSD's VMM Hypervisor and setup k3s
# Assuming you're a regular user that has doas allowances for vmctl
mkdir -p ~/vmm
cd ~/vmm
# Grab the the one of the virt iso's of Alpine Linux
curl http://dl-cdn.alpinelinux.org/alpine/v3.11/releases/x86_64/alpine-virt-3.11.6-x86_64.iso -o alpine-virt-3.11.6-x86_64.iso
# Make a new virtual disk image, change the size as needed. Make one for each node.
doas vmctl create -s 2G alpine-virt1.img
doas vmctl create -s 2G alpine-virt2.img
@wizardishungry
wizardishungry / bgpd.conf
Created September 26, 2018 06:07
checkpoint jesse's vm bgp conf
# global configuration
AS 64986
router-id 10.70.145.196
#holdtime 15
#keepalive 5
# listen on 127.0.0.1
# listen on ::1
fib-update yes
# route-collector no
log updates
GOOS=openbsd GOARCH=amd64 go get github.com/docker/cli/cmd/docker
GOOS=openbsd GOARCH=amd64 go get github.com/docker/machine/cmd/docker-machine
doas sysctl net.inet.ip.forwarding=1
wget "https://github.com/boot2docker/boot2docker/releases/download/v18.06.0-ce/boot2docker.iso"
vmctl create disk.img -s 4.5G
doas vmctl start docker -d ./boot2docker.iso -d ./disk.img -m 1024M -L -c
# -c is for console
@wizardishungry
wizardishungry / README.md
Created June 21, 2018 20:09
go lang teaser

So I just ran into this interesting situation in a select IO handler which is trapping control-C and listening for messages/errors from partitionConsumer. I’ve run into a case where I am unable to catch signals. The problem occurs when no one is consuming b.output but we enter the block for <-partitionConsumer.Messages()

Rest of functions ommited.

@wizardishungry
wizardishungry / knot-resolver.md
Last active April 7, 2018 17:48
knot-resolver subjective performance

Query local knot-resolver instance forwarding to 1.1.1.1 per these directions (3698.7 ms 😫 ):

kdig slashdot.org @127.0.0.1                                                                                                                                                                                master ‹2.3.0›
;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 17572
;; Flags: qr rd ra; QUERY: 1; ANSWER: 1; AUTHORITY: 0; ADDITIONAL: 0

;; QUESTION SECTION:
;; slashdot.org.       		IN	A

;; ANSWER SECTION:
@wizardishungry
wizardishungry / community-builds-from-source.sh
Last active January 14, 2018 03:06 — forked from Chaircrusher/community-builds-from-source.sh
This script pulls down the VCV Rack community repo, finds source urls, pulls down source repos, and builds plugins.
#!/usr/bin/env bash
#################################################################################################################################
# community-builds-from-source.sh
# by Jeremy Wentworth
#
# Modified by Kent Williams chaircrusher@gmail.com
# Modified by Jon Williams jon@jonwillia.ms
#
# This script pulls down the VCV Rack community repo, finds source urls, pulls down source repos, and builds plugins.
@wizardishungry
wizardishungry / ssl_puma.sh
Last active February 8, 2017 17:51 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -out server.key 2048
# 2) Generate the csr (Certificate signing request) (Details are important!)
$ openssl req -new -key server.key -out server.csr