Skip to content

Instantly share code, notes, and snippets.

View rberger's full-sized avatar

Robert J. Berger rberger

View GitHub Profile

My basic point is that currently, configuration management code manifests as a giant, unverifiable pile of mud. The languages we use lack types and are weak at making non-runtime assertions. With the modicum of sanity that a proper module system and types can bring to the table, we would be considerably better off.

@webframp
webframp / librato.rb
Created January 10, 2012 23:20
chef recipe for librato collectd plugin
#
# Cookbook Name:: collectd_plugins
# Recipe:: librato
#
# Copyright 2012, Sean Escriva <sean.escriva@gmail.com>
#
case node.platform
when "ubuntu", "debian"
package "libpython2.7"
#!/usr/bin/env ruby
require 'rubygems'
require 'sensu-handler'
require 'socket'
class Graphite < Sensu::Handler
def send_graphite(metric, msg)
host = 'graphite.host.com'
$hosts_table = {
:dbm => "192.168.86.101",
:app1 => "192.168.86.102",
:app2 => "192.168.86.103",
:lb => "192.168.86.104",
}
def bootstrap(config, host)
config.vm.box = "lucid64"
config.vm.network $hosts_table[host]
@threetee
threetee / nginx_unicorn.rb
Created June 15, 2011 22:03
chef nginx_unicorn recipe (part of modified application cookbook)
app = node.run_state[:current_app]
#unicorn
include_recipe "application::unicorn"
#nginx
include_recipe "nginx::source"
#nginx/unicorn proxy
socket = "/tmp/unicorn_#{app['id']}.sock"
@jtimberman
jtimberman / ubuntu10.04-gems.erb
Created June 3, 2011 04:49
gems/chef-0.10.0/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb
bash -c '
if [ ! -f /usr/bin/chef-client ]; then
apt-get update
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras
cd /tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar zxf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb --no-format-executable
fi
@jbz
jbz / knife.rb
Created February 16, 2011 17:08
knife.rb that switches Opscode orgs/validators based on git branch
# This knife.rb orig. provided by jtimberman@opscode.com - but any mistakes are mine!
current_dir = File.dirname(__FILE__)
platform = "https://api.opscode.com/organizations"
require 'grit'
branch = Grit::Repo.new("#{current_dir}/..").head.name
case branch