Skip to content

Instantly share code, notes, and snippets.

@fnichol
fnichol / README.md
Created December 28, 2011 17:41
Vagrantify: Create a chef-solo enabled Vagrant virtual machine for development

Installation

gem install thor
mkdir -p ~/vagrants && cd ~/vagrants
curl -LO https://raw.github.com/gist/1528832/vagrantify
chmod 755 vagrantify

Usage

./vagrantify init webserver

require 'mixlib/cli'
EXIT_CODES = {
'OK' => 0,
'WARNING' => 1,
'CRITICAL' => 2,
'UNKNOWN' => 3,
}
class Sensu
@joemiller
joemiller / http_helpers.rb
Created November 28, 2011 19:25
infrastructure smoketest example (rspec)
require 'open-uri'
# simple wrapper around open-uri's open() that will
# fetch an HTTP or HTTPS resource including follow redirects.
# Returns a hash with 2 members:
#
# response[:meta] = the original open-uri response object. Use this to
# access metadata such as status code. See
# http://ruby-doc.org/stdlib-1.9.2/libdoc/open-uri/rdoc/OpenURI/Meta.html
# for a list of attributes and methods available.
@rottenbytes
rottenbytes / cookbooks-tests-libraries-noah.rb
Created October 23, 2011 18:21
Integrating noah into chef
module Noah
def noah_get_host(hostname)
require "net/http"
require "json"
noah_server="http://10.251.12.10:9292"
url = URI.parse("#{noah_server}/hosts/#{hostname}")
req = Net::HTTP::Get.new(url.path)
resp = Net::HTTP.new(url.host, url.port).start do |http|
@GregMefford
GregMefford / setup-statsd-centos.sh
Last active April 10, 2022 15:31 — forked from collegeman/setup-statsd.sh
Install Graphite and StatsD on CentOS (updated for 6.4 x86_64)
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI)
# This should be performed as root since it's going to be installing a bunch of stuff
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached
@botchagalupe
botchagalupe / gist:788627
Created January 20, 2011 20:47
Knife Report1

This is an example report running from knife exec

This example uses google spreadsheets to store the results.

You will first need to install the google spreadsheet GEM

$ gem sources -a http://gemcutter.org
$ sudo gem install google-spreadsheet-ruby

More information about this GEM can be found at

@dje
dje / report.rb
Created October 28, 2010 05:27
a chef report to google docs
require 'rubygems'
require 'chef'
require 'fog'
require 'google_spreadsheet'
Chef::Config.from_file("~/.chef/knife.rb")
ec2 = Fog::AWS::EC2.new(:aws_access_key_id => ENV["AWS_KEY"],
:aws_secret_access_key => ENV["AWS_SECRET"] )
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#