Skip to content

Instantly share code, notes, and snippets.

View shanemhansen's full-sized avatar

Shane Hansen shanemhansen

View GitHub Profile
panic: runtime error: index out of range
goroutine 37 [running]:
runtime.panic(0xc1d8a0, 0x14b0bdc)
/root/.gvm/gos/go1.3.1/src/pkg/runtime/panic.c:279 +0xf5
github.com/influxdb/influxdb/api/graphite.(*Server).getAuth(0xc2080465a0)
/root/gocodez/src/github.com/influxdb/influxdb/api/graphite/api.go:94 +0x88
github.com/influxdb/influxdb/api/graphite.(*Server).ListenAndServe(0xc2080465a0)
/root/gocodez/src/github.com/influxdb/influxdb/api/graphite/api.go:98 +0x32
created by github.com/influxdb/influxdb/server.(*Server).ListenAndServe
createdb:
cmd:
- run
- require:
- service:
- name: influxdb
- running
- name: |
curl -fsSX POST 'http://localhost:8086/db?u=root&p=root' -d '{"name": "collectd"}'
@shanemhansen
shanemhansen / gist:cb03cc78ad3a65401d26
Created November 26, 2014 18:42
salt-master-startup.log
close(14834) = -1 EBADF (Bad file descriptor)
close(14835) = -1 EBADF (Bad file descriptor)
close(14836) = -1 EBADF (Bad file descriptor)
close(14837) = -1 EBADF (Bad file descriptor)
close(14838) = -1 EBADF (Bad file descriptor)
close(14839) = -1 EBADF (Bad file descriptor)
close(14840) = -1 EBADF (Bad file descriptor)
close(14841) = -1 EBADF (Bad file descriptor)
close(14842) = -1 EBADF (Bad file descriptor)
close(14843) = -1 EBADF (Bad file descriptor)
@shanemhansen
shanemhansen / .gitconfig
Created September 18, 2014 14:58
Protip: Make go get work on github private repositories
# this makes go get github.com/foo/var work without
# monkeying with the credential cache or anything silly like that.
[url "git@github.com:"]
insteadOf = https://github.com/
#!/usr/bin/env python
from Tkinter import Tk
from tkFileDialog import askopenfilename, asksaveasfilename
Tk().withdraw()
FILE = open(askopenfilename())
OUTPUT = open(asksaveasfilename(), "w")
lines = FILE.readlines()
states = [4,5,6] # 4000, 5000, 6000
#!/usr/bin/env python
import re
version = re.compile('(?P<package>[a-zA-Z0-9_]+) \((?P<version>[^ ]+)\)')
#read release from changelog
l = open('debian/changelog').readline()[:-1]
m = re.match(version, l)
print m.group("version")
Incidentally, psychoanalysis is not a science: it is at best a medical process, and perhaps even more like witch-doctoring. It has a theory as to what causes disease—lots of different “spirits,” etc. The witch doctor has a theory that a disease like malaria is caused by a spirit which comes into the air; it is not cured by shaking a snake over it, but quinine does help malaria. So, if you are sick, I would advise that you go to the witch doctor because he is the man in the tribe who knows the most about the disease; on the other hand, his knowledge is not science. Psychoanalysis has not been checked carefully by experiment.
volume I; lecture 3, "The Relation of Physics to Other Sciences"; section 3-6, "Psychology"; p. 3-8
@shanemhansen
shanemhansen / gophers.slide
Created August 11, 2014 16:54
utahgophers
Go Golang
12 May 2014
Shane Hansen
Software Dude, Rakuten Mediaforge
shanemhansen@gmail.com
http://github.com/shanemhansen
@shanemhansen
* Welcome to Utah Gophers!
@shanemhansen
shanemhansen / something.sh
Created July 18, 2014 17:29
watch deamonize
#!/bin/bash
PIDFILE="na.pid"
nohup ./netacuity_server "$1" &
sleep 1
while test -e "$PIDFILE" ; do
if kill -0 $(cat $PIDFILE) 2>/dev/null; then
continue
else
echo "graceful shutdown"
exit
@shanemhansen
shanemhansen / ips.py
Created July 16, 2014 18:00
Enumerate IPS
#!/usr/bin/env python
import sys
(ip, mask) = sys.argv[1].split('/')
mask = int(mask)
def parseip(addr):
(a,b,c,d) = addr.split('.')
return int(d)*(256**0) + int(c)*(256**1) + int(b)*(256**2) + int(a)*(256**3)
def printip(numeric_ip):
d = numeric_ip&0xFF