Skip to content

Instantly share code, notes, and snippets.

View turtlebender's full-sized avatar

Tom Howe turtlebender

  • Dell | Software
  • Chicago, IL
View GitHub Profile
@turtlebender
turtlebender / vagrant-net.rb
Created March 16, 2012 14:22
ohai plugin for setting the ipaddress to the eth1. This is particularly useful for running multi-vm vagrant with chef trying to connect the various boxes
provide "ipaddress"
require_plugin "#{os}::network"
network["interfaces"]["eth1"]["addresses"].each do |ip, params|
if params['family'] == ('inet')
ipaddress ip
end
end
@turtlebender
turtlebender / gitversion.py
Created February 21, 2012 18:51
get version number
#!/usr/bin/env python
from subprocess import Popen, PIPE
import re
import string
import datetime
import time
def get_version():
@turtlebender
turtlebender / init.sh
Created February 15, 2012 18:33
Initialize GO Box
#!/bin/bash
sudo apt-get install -y curl wget sudo
sudo apt-get install -y ruby rubygems ruby-dev git
sudo apt-get install -y libhaml-ruby1.8
sudo gem install json chef haml sass --no-ri --no-rdoc
for i in ~/chef-repo/cookbooks/* ; do echo "0.9.9" > $i/.version ; done
cat << 'EOF' > /tmp/solo.rb
file_cache_path "/var/chef-solo"
cookbook_path File.expand_path("~/chef-repo/cookbooks")
@turtlebender
turtlebender / globusonline.bind
Created February 15, 2012 18:13
globusonline.org bindfile
$ORIGIN globusonline.org.
@ 300 IN MX 10 mailgateway.anl.gov.
@ 172800 IN NS ns-110.awsdns-13.com.
@ 172800 IN NS ns-1396.awsdns-46.org.
@ 172800 IN NS ns-672.awsdns-20.net.
@ 172800 IN NS ns-2012.awsdns-59.co.uk.
@ 900 IN SOA ns-110.awsdns-13.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
graph.api 600 IN CNAME graph-api-prod-250363663.us-east-1.elb.amazonaws.com.
graph.qa.api 600 IN A 50.19.91.41
transfer.qa.api 600 IN A 184.73.230.188
@turtlebender
turtlebender / config.ini
Created February 14, 2012 16:23
tail client over stunnel
[authentication]
redis_host = logging.utils.globuscs.info
certfile = /home/user/.tailclient/username.crt
keyfile = /home/user/.tailclient/username.key
@turtlebender
turtlebender / logstash-collector.upstart
Created February 13, 2012 13:45
Logstash upstart files
description "logstash collector server"
start on runlevel [2345]
stop on runlevel [06]
# tell upstart we're creating a daemon
# upstart manages PID creation for you.
expect fork
script
@turtlebender
turtlebender / deploy.py
Created February 8, 2012 19:47
updated deployment
from fabric.api import *
from fabric.operations import *
from fabric.colors import *
import boto
machines = [("prod1.globuscs.info", "i-c248f4a0"), ("prod2.globuscs.info", "i-e3a80680"), ("prod3.globuscs.info", "i-05403a66")]
if __name__ == "__main__":
elb_conn = boto.connect_elb()
elbs = dict([(elb.name, elb) for elb in elb_conn.get_all_load_balancers()])
............get_count........................get_slice..........3policy_option__d7ea0ca6-9de7-46cd-9612-d25e72571d65.........!outbound____relationship__index__.............................................z........get_slice......................rdf:type__2e18f15f-4299-42ac-84d8-0df08f8708e2.......
.......rel_key......$2e18f15f-4299-42ac-84d8-0df08f8708e2
.....g..J.........rel_type.......rdf:type
.....g..J........
source__admin.......$bFalse
.....g..J.........source__key......$d7ea0ca6-9de7-46cd-9612-d25e72571d65
.....g..J.........source__members.......$bFalse
.....g..J.........source__parent.......$bFalse
.....g..J.........source__public.......$bTrue
.....g..J.........source__type......
@turtlebender
turtlebender / gist:1762376
Created February 7, 2012 22:02
pycassa profiling
1 0.001 0.001 1891.339 1891.339 {execfile}
1 0.000 0.000 1887.030 1887.030 fixture_loader.py:3(<module>)
1 0.000 0.000 1887.030 1887.030 fixture_loader.py:44(instantiate_fixtures)
1 0.000 0.000 1887.030 1887.030 fixture_loader.py:67(instantiate_fixtures_from_rdf)
1 0.000 0.000 1887.028 1887.028 graph.py:704(parse)
1 0.000 0.000 1887.028 1887.028 rdfxml.py:561(parse)
1 0.000 0.000 1887.028 1887.028 expatreader.py:100(parse)
10 0.024 0.002 1887.025 188.703 expatreader.py:196(feed)
6837 0.065 0.000 1880.578 0.275 expatreader.py:340(end_element_ns)
6837 0.063 0.000 1880.480 0.275 rdfxml.py:179(endElementNS)
@turtlebender
turtlebender / vim.rb
Created February 2, 2012 15:16 — forked from brucespang/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
# Get stable versions from hg repo instead of downloading an increasing
# number of separate patches.
url 'https://vim.googlecode.com/hg/', :revision => '992b24149a9e'
version '7.3.333'
homepage 'http://www.vim.org/'
head 'https://vim.googlecode.com/hg/'