Skip to content

Instantly share code, notes, and snippets.

arnehormann / brew-sigmavpn.rb
Created May 8, 2014
A (broken) brew for sigmavpn
View brew-sigmavpn.rb
require "formula"
class Sigmavpn < Formula
homepage ""
url ""
sha1 "49020d4db52878756fbbc45c05c2deeedaa7b6d2"
head do
url ''
View error.go
package mysql
import (
var trace = false
arnehormann / vpngen.rb
Last active Dec 17, 2019
Configuration file generator for OpenVPN which also sets up a ca and generates keys.
View vpngen.rb
#!/usr/bin/env ruby
# Just call this without arguments. It will show a friendly help text.
# For xterm-256color, it will even use colors for some commands!
class AppConfig
@@default_remote = ''
@@default_networks = '>'
@@default_subject = '/C=US/ST=CA/L=San Francisco/O=Example/OU=/CN={{name}}'
arnehormann / puttygen.go
Last active May 11, 2020
convert openssl pem private key files to putty ppk files (stdin -> stdout)
View puttygen.go
package main
import (
arnehormann / benchmark-datetime_test.go
Last active Dec 31, 2015
benchmark another way to format mysql date and datetime into a `[]byte`
View benchmark-datetime_test.go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at
package mysql
arnehormann /
Last active Dec 29, 2015
some reflection magic to help writing table based tests
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import static org.junit.Assert.assertEquals;
import static;
public final class TestHelper {
public static void test(Object[][] tests, Object target, String methodName, Class<?>...argsTypes) throws Exception {
arnehormann / errcheck.go
Created Nov 15, 2013
reduce noise in example programs
View errcheck.go
type closer interface {
Close() error
type errorMessage string
func (err errorMessage) Error() string {
return string(err)
arnehormann / gzipstream.go
Last active Sep 27, 2017
A pretty small Go application compressing from stdin to stdout as gzip.
View gzipstream.go
package main
import (
arnehormann /
Created Oct 24, 2013
ansible with virtualenv bootstrap script
# exit on error, undeclared variables and pipe failures
set -e -u -o pipefail
# ansible is made for python 2.7+
# TODO: check version(s) and provide better errors if anything fails
# install virtualenv if it's not installed yet
which -s virtualenv || (sudo easy_install pip && sudo pip install virtualenv)