Skip to content

Instantly share code, notes, and snippets.

View tobstarr's full-sized avatar

Tobias Schwab tobstarr

View GitHub Profile
@tobstarr
tobstarr / gist:8440876
Last active January 3, 2016 09:09
unicorn.conf
start on startup
chdir /app/current
script
eval $(cat /proc/1/environ | tr "\000" "\n" | sed 's/=/="/' | sed 's/$/"/' | while read env; do echo export $env; done)
bundle exec unicorn -c ./config/unicorn_config.rb
end script
$ cat test.go
package main
import (
"log"
"math/rand"
)
func main() {
log.Print(rand.Int())
class Indexer
def initialize(clazz)
@clazz = clazz
end
def index(line)
i = @clazz.new
i.parse(line)
i
end
@tobstarr
tobstarr / test.go
Last active December 26, 2015 08:29
package main
import (
"net/http"
"os"
"syscall"
)
func main() {
var proto string
$ jb
USAGE
jb backups create id Create manual backup from box
jb backups list List all running boxes
jb distributions list
jb plans list
jb servers clone id
--plan-id DEFAULT: "20" Plan id
--name DEFAULT: "" Name of the new box
jb servers create Create new JiffyBox

Socoded Docker

command! Gotags :call Gotags()
function! Gotags()
exec ':silent !gotags $(find . -name "*.go" | grep -v "/test/" | xargs) 2> /dev/null > tags.tmp && mv tags.tmp tags'
redraw!
endfunction
@tobstarr
tobstarr / output.txt
Last active December 22, 2015 19:39
Golang Heisenberg
Committed_AS: 3607224 kB
Committed_AS: 3872632 kB
Committed_AS: 3607156 kB
@tobstarr
tobstarr / Dockerfile
Last active December 20, 2015 14:29
Dockerfile for running OpenTSDB
FROM ubuntu
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl build-essential git-core
RUN if [ ! $(grep universe /etc/apt/sources.list) ]; then sed 's/main$/main universe/' -i /etc/apt/sources.list && apt-get update; fi
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-6-jdk
RUN mkdir -p /opt/downloads && cd /opt/downloads && curl -SsfLO "http://www.apache.org/dist/hbase/hbase-0.94.10/hbase-0.94.10.tar.gz"
RUN cd /opt && tar xvfz /opt/downloads/hbase-0.94.10.tar.gz
RUN mkdir -p /data/hbase
RUN mkdir -p /root/.profile.d
RUN mkdir -p /root && echo Zm9yIHByb2ZpbGVfcGF0aCBpbiAkKGZpbmQgL3Jvb3QvLnByb2ZpbGUuZC8gLXR5cGUgZik7IGRvIHNvdXJjZSAkcHJvZmlsZV9wYXRoOyBkb25lCg== | base64 -d > /tmp/wunderscale.e4e4b9a9fbb0a7813a4707407606ccb195999effc1d27eac75a879113a4a017b && mv /tmp/wunderscale.e4e4b9a9fbb0a7813a4707407606ccb195999effc1d27eac75a879113a4a017b /root/.profile
RUN mkdir -p /root/.profile.d && echo ZXhwb3J0IEpBVkFfSE9NRT0vdXNyL2xpYi9qdm0vamF2YS02LW9wZW5qZGstYW1kNjQK | base64 -d > /tmp/wundersc
@tobstarr
tobstarr / Makefile
Created July 22, 2013 10:15
Golang SSH client
default:
@go get code.google.com/p/go.crypto/ssh
go build -o bin/test_ssh_client *.go