Skip to content

Instantly share code, notes, and snippets.

View bsiegert's full-sized avatar
🚩

Benny Siegert bsiegert

🚩
View GitHub Profile
@bsiegert
bsiegert / fonts.conf
Created January 8, 2019 19:22
Use Arimo instead of Helvetica
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- Put this file into ~/.config/fontconfig/fonts.conf -->
<fontconfig>
<match target="pattern">
<test qual="any" name="family"><string>helvetica</string></test>
<edit name="family" mode="assign" binding="same"><string>Arimo</string></edit>

Supporting Go modules in pkgsrc

Go 1.11 introduced a new way of building Go code that no longer needs a GOPATH at all. In due course, this will become the default way of building. What's more, sooner or later, we are going to want to package software that only builds with modules.

There should be some package-settable variable that controls whether you want to use modules or not. If you are going to use modules, then the repo should have a go.mod file. Otherwise (e.g. if there is a dep file or something), the build could start by doing go mod init (which needs to be after make extract).

@bsiegert
bsiegert / leaving-aws.md
Last active December 23, 2017 18:59
Leaving AWS

Leaving Amazon AWS

Today, I deleted my Amazon AWS account.

And done!

I had been on AWS since about 2011. My usage was mainly for two things:

  1. Saving large amounts of files (build logs and such) on S3;
  2. Running NetBSD VMs on EC2.
--- FAIL: TestGoTestJSON (5.26s)
go_test.go:5140: running testgo [test -json -short -v sleepy1 sleepy2]
go_test.go:5140: standard output:
go_test.go:5140: {"Time":"2017-11-15T20:09:17.552717199Z","Action":"run","Package":"sleepy1","Test":"Test1"}
{"Time":"2017-11-15T20:09:17.553128778Z","Action":"output","Package":"sleepy1","Test":"Test1","Output":"=== RUN Test1\n"}
{"Time":"2017-11-15T20:09:17.722215434Z","Action":"output","Package":"sleepy1","Test":"Test1","Output":"--- PASS: Test1 (0.20s)\n"}
{"Time":"2017-11-15T20:09:17.722400429Z","Action":"pass","Package":"sleepy1","Test":"Test1","Elapsed":0.2}
{"Time":"2017-11-15T20:09:17.722441635Z","Action":"output","Package":"sleepy1","Output":"PASS\n"}
{"Time":"2017-11-15T20:09:17.722909196Z","Action":"output","Package":"sleepy1","Output":"ok \tsleepy1\t0.209s\n"}
{"Time":"2017-11-15T20:09:17.722943333Z","Action":"pass","Package":"sleepy1","Ela
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/py-augeas/Makefile,v
retrieving revision 1.3
diff -u -d -r1.3 Makefile
--- Makefile 1 Nov 2017 08:23:42 -0000 1.3
+++ Makefile 3 Nov 2017 11:45:49 -0000
@@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.3 2017/11/01 08:23:42 wiz Exp $
@bsiegert
bsiegert / gist:dbd1364bb5738d1d5648ccc16a388c64
Created September 24, 2017 20:16
gopkg2url example output
$ ./gourl2pkg -local golang.org/x/build
2017/09/24 22:15:07 Remaining to package: [golang.org/x/build]
Depends of golang.org/x/build:
github.com/shurcooL/issues/maintner (UNRESOLVED)
github.com/jellevandenhooff/dkim (UNRESOLVED)
cloud.google.com/go/storage (UNRESOLVED)
grpc.go4.org (UNRESOLVED)
github.com/shurcooL/gofontwoff (UNRESOLVED)
cloud.google.com/go/bigquery (UNRESOLVED)
github.com/shurcooL/httpgzip (UNRESOLVED)
@bsiegert
bsiegert / gist:8740c08586ac881eacf7cde119ea0524
Created September 22, 2017 09:59
Index of Go packages in pkgsrc
collectd.org wip/go-collectd
git.torproject.org/pluggable-transports/goptlib.git wip/go-goptlib
git.torproject.org/pluggable-transports/obfs4.git wip/obfs4proxy
github.com/42wim/matterircd chat/matterircd
github.com/BurntSushi/toml www/go-toml-burntsushi
github.com/JamesClonk/vultr net/go-vultr
github.com/PuerkitoBio/purell devel/go-purell
github.com/agl/ed25519 wip/go-ed25519
github.com/alexcesaro/log wip/go-log
github.com/armon/consul-api devel/go-consul-api
@bsiegert
bsiegert / tmux.conf
Created July 15, 2017 19:30
Make tmux more like screen
unbind C-b
set -g prefix C-a
bind-key C-a last-window
bind a send-prefix
bind-key ' ' next-window
bind-key bspace previous-window

Making networking work on NetBSD on GCE needs the "Local Subnet" extension to DHCP from RFC 3442, which NetBSD's dhclient does not support.

In my example, the local IP is 10.240.0.4, the default gateway is supposed to be 10.240.0.1. The DHCP reply contains a netmask of 255.255.255.255 (/32), so the gateway is on a different "subnet". Here is the incantation to make the default route work:

route add -net 10.240.0.1/32 -link -cloning -iface vioif0
route add default -ifa 10.240.0.4 10.240.0.1

netstat -rnf inet then shows:

@bsiegert
bsiegert / gist:138b3b0c9f27c8d00187
Last active February 12, 2016 10:38
Current failure mode of buildlet VM
+ netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Interface
10.240.0.3 42:01:0a:f0:00:03 UHLl - - - lo0
10.240.0.3/32 link#1 UC - - - vioif0
127/8 127.0.0.1 UGRS - - 33648 lo0
127.0.0.1 lo0 UHl - - 33648 lo0