Skip to content

Instantly share code, notes, and snippets.

View tasdomas's full-sized avatar

Domas Monkus tasdomas

View GitHub Profile
package main
import (
"log"
"net/http"
)
func main() {
http.Handle("/", http.HandlerFunc(auditHandler))
log.Fatal(http.ListenAndServe(":8080", nil))
@tasdomas
tasdomas / .cfg.sh
Created June 9, 2015 16:28
Switching go environments
#!/bin/sh
GOPATH=$(dirname $0)
GOBIN=$GOPATH"/bin"
PATH=$GOBIN:$PATH
tmux set-option -t ${SESSION} default-shell /bin/zsh
tmux set-option -t ${SESSION} history-limit 5000
tmux set-environment -t ${SESSION} JUJU_MONGOD /usr/lib/juju/bin/mongod
#tmux set-option -t ${SESSION} update-environment "GOPATH GOBIN PATH"
tmux set-environment -t ${SESSION} GOBIN $GOBIN
#! /bin/bash
mongo 127.0.0.1:37017/admin --ssl --username "admin" --password "`sudo grep oldpassword ~/.juju/local/agents/machine-0/agent.conf | cut -d' ' -f2`"
@tasdomas
tasdomas / gc.go
Created August 5, 2014 07:45
Demonstration of undetected test failures with incorrect usage of gocheck.C
package gc
import (
"launchpad.net/gocheck"
)
func Failure(c *gocheck.C) func() {
return func() {
// fails immediately
c.Fail()
@tasdomas
tasdomas / gist:e16a55d26f54039f9f5a
Created May 29, 2014 14:01
Juju deployer config for hadoop
hadoop:
series: precise
services:
hadoop-master:
charm: hadoop
branch: lp:charms/precise/hadoop
constraints: cpu-cores=4
expose: true
hadoop-slave:
charm: hadoop
@tasdomas
tasdomas / gc.go
Created July 19, 2012 07:09
simple SDL example
package gc
import (
"launchpad.net/gocheck"
)
func Failure(c *gocheck.C) func() {
return func() {
// fails immediately
c.Fail()