Skip to content

Instantly share code, notes, and snippets.

View bsiegert's full-sized avatar
🚩

Benny Siegert bsiegert

🚩
View GitHub Profile
@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
@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 / 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)
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 $
--- 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
@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.

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 / 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>
@bsiegert
bsiegert / kdump-amd64.out
Last active February 16, 2019 17:16
TestPassFD debugging
11889 1 ktrace EMUL "netbsd"
11889 1 ktrace CALL execve(0x7f7fff3b0772,0x7f7fff3b01b0,0x7f7fff3b01c8)
11889 1 ktrace NAMI "/home/bsiegert/./syscall.test"
11889 1 ktrace NAMI "/usr/libexec/ld.elf_so"
11889 1 syscall.test EMUL "netbsd"
11889 1 syscall.test RET execve JUSTRETURN
11889 1 syscall.test CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,0x1002<PRIVATE,,,>,0xffffffff,0,0)
11889 1 syscall.test RET mmap 140187597238272/0x7f7ff7ef7000
11889 1 syscall.test CALL open(0x7f7ff7c0bf0c,0,0x7f7ff7e11768)
11889 1 syscall.test NAMI "/etc/ld.so.conf"
@bsiegert
bsiegert / mailparser.go
Created March 22, 2019 09:50
Parse cloudmailin emails
package mailparser
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
)