Skip to content

Instantly share code, notes, and snippets.

View schisamo's full-sized avatar

Seth Chisamore schisamo

View GitHub Profile
# Before running vagrant, export the shell variable for the organization on the platform and make sure
# the validator certificate is in ~/.chef.
#
# export ORGNAME=your_platform_organization
Vagrant::Config.run do |config|
config.vm.box = "lucid64"
config.vm.provisioner = :chef_server
# Set up some organization specific values based on environment variable above.
@schisamo
schisamo / gist:734344
Created December 9, 2010 04:35 — forked from jtimberman/gist:714944
tmux.conf
# this file is controlled by Chef
# feel free to copy it to your ~/.tmux.conf
unbind C-a
set -g prefix C-a
bind C-a send-prefix
set -g default-terminal screen-256color
setw -g xterm-keys on
set -g status-utf8 on
include_recipe "git"
node.run_state[:applications] = []
search(:apps) do |app|
(app["server_roles"] & node.run_list.roles).each do |app_role|
node.run_state[:applications] << {:app => app, :recipes => app["type"][app_role]}
end
end
require 'timeout'
include Rackspace::Proc
define :wait_on_proc, :timeout_sec => 60 do
include_recipe "rackspace"
begin
Timeout::timeout(params[:timeout_sec]) do
while getProcPid(params[:name])
sleep(5)
end
@schisamo
schisamo / definition.rb
Created January 4, 2011 20:50
veewee definition for creating a Vagrant box that mirrors the centos5-gems knife bootstrap template
Veewee::Session.declare( {
:cpu_count => '1',
:memory_size=> '384',
:disk_size => '10140',
:disk_format => 'VDI',
:disk_size => '10240' ,
:os_type_id => 'RedHat',
:iso_file => "CentOS-5.5-i386-netinstall.iso",
:iso_src => "http://mirror.bytemark.co.uk/centos/5.5/isos/i386/CentOS-5.5-i386-netinstall.iso",
:iso_md5 => "0172883a3039772165db073693debae5",
@schisamo
schisamo / definition.rb
Created January 4, 2011 20:52
veewee definition for creating a Vagrant box that mirrors the ubuntu10.04-gems knife bootstrap template
Veewee::Session.declare( {
:cpu_count => '1',
:memory_size=> '256',
:disk_size => '10140',
:disk_format => 'VDI',
:disk_size => '10240' ,
:os_type_id => 'Ubuntu',
:iso_file => "ubuntu-10.04.1-server-i386.iso",
:iso_src => "http://releases.ubuntu.com/10.04.1/ubuntu-10.04.1-server-i386.iso",
:iso_md5 => "01f72c846845e4e19aec8a45912e5dda",
i = gem_package "sys-proctable" do
action :nothing
end
i.run_action(:install)
require 'rubygems'
Gem.clear_paths
require 'sys/proctable'
Rackspace.is_proc("deployment.*sh", 300)
@schisamo
schisamo / gamespy.ohai.erb
Created June 29, 2011 22:59 — forked from rcreasey/gamespy.ohai.erb
You could put the ohai plugin file in /cookbooks/ohai/files/default/plugins and the ohai cookbook will distribute it for you.
provides "gamespy"
require_plugin "kernel"
require_plugin "network"
def get_ip_address(name, eth)
network[:interfaces][eth][:addresses].each do |key, info|
gamespy[name] = key if info['family'] == 'inet'
end
end
@schisamo
schisamo / command.sh
Created July 28, 2011 22:01 — forked from czottmann/ubuntu10.04-ruby192.erb
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
knife ec2 server create -G default -I ami-61be7908 -f m1.small \
-S schisamo -x ubuntu -d ubuntu10.04-ruby192
{
"name": "test2",
"default_attributes": {
"firewall": {
"rules": [
{
"25": { "port": "25", "protocol": "tcp" }
}
]
}