Skip to content

Instantly share code, notes, and snippets.

@stephenlauck
stephenlauck / joyent-smartos.erb
Created June 26, 2012 22:57 — forked from benjaminws/joyent-smartos.erb
joyent-smartos.erb
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
# works with joyent images:
# 01b2c898-945f-11e1-a523-af1afbe22822 smartos 1.6.3 smartos smartmachine
# f9e4be48-9466-11e1-bc41-9f993f5dff36 smartos64 1.6.3 smartos smartmachine
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
pkgin -f update
pkgin -y install gcc-compiler gcc-runtime gcc-tools scmgit-base scmgit-docs gmake ruby193-base ruby193-yajl-ruby
@stephenlauck
stephenlauck / gist:3640366
Created September 5, 2012 17:18
SmartOS 1.7.2 Chef Bootstrap
# Joyent SmartOS Base64 1.7.2
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
pkgin -f update
pkgin -y install gcc47 gcc47-runtime scmgit-base scmgit-docs gmake ruby193-base ruby193-yajl-ruby ruby193-nokogiri ruby193-readline emacs-nox11 pkg-config-0.25nb1
gem update --system
gem install --no-ri --no-rdoc ohai
export PS1='\w$(__git_ps1 "(%s)") > '
@stephenlauck
stephenlauck / joyent-smartos-base64-1.8.1.erb
Created October 4, 2012 22:08
Joyent SmartOS Base64 1.8.1 Knife Bootstrap
# Joyent SmartOS Base64 1.8.1
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
pkgin -f update
pkgin -y install gcc47 gcc47-runtime scmgit-base scmgit-docs gmake ruby193-base ruby193-yajl ruby193-nokogiri ruby193-readline emacs-nox11 pkg-config
gem update --system
gem install --no-ri --no-rdoc ohai
@stephenlauck
stephenlauck / migration.sh
Created January 29, 2013 23:38
Migrate node across hosted chef servers
# update gems
sudo gem update --no-rdoc --no-ri
# edit client.rb with correct validation key and chef server
# also set the environment
log_level :info
log_location STDOUT
chef_server_url "https://api.opscode.com/organizations/modcloth-comments"
validation_client_name "modcloth-comments-validator"
node_name "comments-standalone-01.demo.modcloth.com"
@stephenlauck
stephenlauck / 3_floyds_zombie_dust.beerspec
Created August 13, 2013 04:18
Beer recipe for 3 Floyd's Zombie Dust for collaboration.
3 Floyd’s - Zombie Dust
Batch Size: 6 gallons
Estimated Original Gravity: 1.065
Estimated Final Gravity: 1.018
Estimated Color: 8.5 SRM
Bitterness: 65.9 IBU
Mash Temp: 154 F
60 min boil
@stephenlauck
stephenlauck / workstation_history
Created August 21, 2013 06:14
Configure remote workstation for development
1 sudo passwd
2 ls
3 uname -a
4 apt-get install build-essenatial git
5 apt-get install build-essential git
6 curl -L https://www.opscode.com/chef/install.sh | sudo bash
7 echo 'export PATH="/opt/chef/embedded/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile
8 mkdir -p /var/chef/cache /var/chef/cookbooks/emacs
9 : wget -qO- https://github.com/opscode-cookbooks/chef-server/archive/master.tar.gz | tar xvzC /var/chef/cookbooks/chef-server --strip-components=1
10 wget -qO- https://github.com/opscode-cookbooks/emacs/archive/master.tar.gz | tar xvzC /var/chef/cookbooks/emacs --strip-components=1
@stephenlauck
stephenlauck / gist:7740869
Created December 1, 2013 21:12
Juicer Bloody Mary
Juicer Bloody Marys (8-10 servings)
8-10 large roma or medium slicer tomatoes
1 stalk of celery (use small ribs and leaves as garnish)
1 large cucumber
1 green bell pepper
1 jalapeno (pull out the seeds and ribs if you like it mild)
2 carrots
1 clove of garlic
2 limes
@stephenlauck
stephenlauck / cookbook_migrate.rb
Created December 19, 2013 01:00
Migrates cookbooks out of chef repo to own git repo org
#!/usr/bin/env ruby
require 'rubygems'
require 'chef'
require 'chef/knife/cookbook_metadata_from_file'
require 'chef/knife/cookbook_metadata'
require 'mixlib/shellout'
require 'json'
require 'pp'
require 'highline/import'
#!/usr/bin/env ruby
require 'rubygems'
require 'chef/knife'
Chef::Config.from_file(File.join(Chef::Knife.chef_config_dir, 'knife.rb'))
rest = Chef::REST.new(Chef::Config[:chef_server_url])
Chef::Node.list.each do |node|
%w{read update delete grant}.each do |perm|