Skip to content

Instantly share code, notes, and snippets.

View phobos182's full-sized avatar

Jeremy Carroll phobos182

View GitHub Profile
@phobos182
phobos182 / haproxy.conf
Created July 17, 2012 23:19
LogStash Configuration for HAProxy
input {
syslog {
type => "haproxy-access"
port => 514
}
}
filter {
grok {
type => "haproxy-access"
#!/bin/bash
#
# constants
IFACE=eth0
TX_QUEUE_LEN=5000
RPS_FLOW_CNT=32768
QUEUES=$(ls -d /sys/class/net/${IFACE}/queues/rx-* | wc -l)
RPS_FLOW_QUEUE=$((RPS_FLOW_CNT / QUEUES))
# set global flow queue
@phobos182
phobos182 / format.py
Last active December 16, 2015 12:58
Format ephemerals at EXT4 on boot (upstart)
#!/usr/bin/python
import boto
import boto.utils
import subprocess
import logging
import re
import sys
import os
import psutil
import time
@phobos182
phobos182 / diamond
Created November 20, 2012 22:48
diamond binary
#!/usr/bin/python
import os
import sys
import configobj
import pwd
import grp
for path in [
os.path.join('opt', 'diamond', 'lib'),
@phobos182
phobos182 / diamond.conf
Created November 20, 2012 22:47
Diamond Upstart File
# diamond - A system statistics collector for graphite
#
# Diamond is a daemon and toolset for gather system statistics
# and publishing them to graphite.
description "Diamond system statistics collector"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on [!12345]
@phobos182
phobos182 / diamond
Created November 20, 2012 21:57
diamond init script
#!/usr/bin/env python
import os
import sys
import configobj
import pwd
import grp
for path in [
os.path.join('opt', 'diamond', 'lib'),
@phobos182
phobos182 / alert.py
Created October 29, 2012 20:29
Server alert api
#!/usr/bin/env python
# Sample
from jira.client import JIRA
from optparse import OptionParser
from pagerduty import *
import hashlib
import hipchat
import simplejson as json
import socket
@phobos182
phobos182 / kafka_consumer.py
Created October 22, 2012 15:07
Kafka Graphite Consumer
#!/usr/bin/env python
from optparse import OptionParser
from brod.zk import *
import pickle
import struct
import socket
import sys
import time
@phobos182
phobos182 / kafka_consumer.py
Created October 22, 2012 14:57
Kafka Graphite Consumer
#!/usr/bin/env python
from optparse import OptionParser
from brod.zk import *
import pickle
import struct
import socket
import sys
import time
@phobos182
phobos182 / kafka_graphite.py
Created October 18, 2012 00:04
Kafka Pickle Consumer
#!/usr/bin/env python
from optparse import OptionParser
from brod.zk import ZKConsumer
import time
import socket
import struct
import sys
import pickle