Skip to content

Instantly share code, notes, and snippets.

View bsiegert's full-sized avatar
🚩

Benny Siegert bsiegert

🚩
View GitHub Profile
@bsiegert
bsiegert / w32glob.go
Created March 14, 2012 11:27
"Native" Glob function for Windows. Very old code (2009 or 2010).
package w32glob
import (
"container/vector"
"os"
"strings"
"syscall"
)
func Glob(patterns []string) ([]string, os.Error) {
# Set the prefix to ^A.
unbind C-b
set -g prefix ^Q
bind q send-prefix
# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
@bsiegert
bsiegert / clean.theme
Created February 7, 2013 04:53
clean theme for irssi
# clean theme for irssi 0.8.4 by sabi <irssi@sabi.net>
# 1.0.9 of 15 June 2002
# very loosely based on IamCyan.theme by marmot
replaces = { };
abstracts = {
##
## generic
##
#!/bin/sh
#
# install and configure SSL root certificates on NetBSD with pkgsrc
set -e
pkgin install mozilla-rootcerts
cd /etc/openssl/certs # Default SSLCERTS path for NetBSD
mozilla-rootcerts extract
mozilla-rootcerts rehash
@bsiegert
bsiegert / unixtest.go
Created November 18, 2013 13:23
Test unix domain sockets in Go.
package main
import (
"fmt"
"io"
"log"
"net"
"os"
"time"
)
@bsiegert
bsiegert / go14.diff
Created December 21, 2015 09:49
lang/go14 patch for OpenIndiana
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/go14/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- Makefile 27 Sep 2015 00:36:02 -0000 1.5
+++ Makefile 21 Dec 2015 09:47:13 -0000
@@ -4,6 +4,7 @@
DISTNAME= go${GO14_VERSION}.src
  • add a target to package-install OR replace, depending on whether the package is already installed.
  • Update direnv to newest version and consider importing from wip (https://github.com/direnv/direnv/releases)
    • needs go-dotenv
  • Create a package for ast-ksh from the current git version -- completely new build system
  • gcloud-golang is now https://github.com/GoogleCloudPlatform/google-cloud-go/, import path has also changed.
    • create new packages
    • move users over
    • remove old
  • PLIST conflict between hunspell and go-tools (bin/analyze)
From 6aada241d440dc06b9ce10a51a527fbd301c5c60 Mon Sep 17 00:00:00 2001
From: Benny Siegert <bsiegert@NetBSD.org>
Date: Sun, 31 Jan 2016 13:09:23 +0000
Subject: [PATCH] New (unfinished) port, delve.
Needs porting to BSD systems, Linux and Darwin only for now.
From DESCR:
Delve is a debugger for the Go programming language. The goal of the
project is to provide a simple, full featured debugging tool for Go.
@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

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: