Skip to content

Instantly share code, notes, and snippets.

Avatar
🐫
Copyright 1987-2013, Larry Wall

Jon Williams wizardishungry

🐫
Copyright 1987-2013, Larry Wall
View GitHub Profile
@wizardishungry
wizardishungry / benchcmp
Created Mar 6, 2022
testing hls-await benchmarks on my raspberry pi 2 :-)
View benchcmp
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 Mar 6, 2022
oneliner to build a go package for every platform
View crap.sh
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 — forked from voutilad/vmm-alpine.sh
Installing Alpine Linux in OpenBSD's VMM Hypervisor and setup k3s
View vmm-alpine.sh
# 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 Sep 26, 2018
checkpoint jesse's vm bgp conf
View bgpd.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
View boot2docker-openbsd.sh
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
View README.md

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 Apr 7, 2018
knot-resolver subjective performance
View knot-resolver.md

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 Jan 14, 2018 — 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.
View community-builds-from-source.sh
#!/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 Feb 8, 2017 — forked from tadast/ssl_puma.sh
localhost SSL with puma
View ssl_puma.sh
# 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
@wizardishungry
wizardishungry / HOWTO.MD
Last active Jan 30, 2017
Setting up User Scripts
View HOWTO.MD

Setting up User Scripts and Extensions on Ungoogled Chromium

https://github.com/Eloston/ungoogled-chromium

  1. curl -L https://clients2.google.com/service/update2/crx\?response\=redirect\&prodversion\=48.0\&x\=id%3Ddhdgffkkebhmkfjojejmpbldmpobfkfo%26installsource%3Dondemand%26uc -o ~/Library/Application\ Support/Chromium/Default/Extensions/tapermonkey.crx
  2. open ~/Library/Application\ Support/Chromium/Default/Extensions/
  3. open chrome://extensions/
  4. Visit http://chromium-crx.stuff.admicos.cf/get.user.js
  5. Install user script