Skip to content

Instantly share code, notes, and snippets.

View jellybob's full-sized avatar

Jon Wood jellybob

View GitHub Profile
puts spec.to_s.inspect
# => "development"
puts configurations.keys.inspect
# => [ "development", "test", "cucumber", "production" ]
puts configurations.keys.include?(spec.to_s)
# => false
#get the war files from the git repo
branch = "release-12"
bash "name_git_repo" do
user "username"
cwd "path/to/repo"
code "git checkout -b #{branch}-#{DateTime.now} origin/#{branch}"
action :nothing
end
@jellybob
jellybob / kimsufi-bootstrap.sh
Created December 15, 2010 20:15
Bootsraps a Kimsufi i7-4T
#!/bin/bash
echo 'deb http://apt.opscode.com/ lucid main' | tee /etc/apt/sources.list.d/opscode.list
wget -qO - http://apt.opscode.com/[email protected] | apt-key add -
apt-get update
apt-get install chef -y
echo -e "chef\tchef/chef_server_url\tselect" > /tmp/chef.preseed
debconf-set-selections /tmp/chef.preseed
update-rc.d chef-client disable
Failure/Error: it { should_not redirect_to("/login") }
Expected response to be a <:redirect>, but was <200>.
Expected block to return true value.
chosen_server = nil
ruby_block "choose server" do
block do
chosen_server = `hideous java command`
end
end
puts chosen_server
require 'chef/config'
require 'chef/node'
Chef::Config.from_file(File.join("etc", "chef", "client.rb"))
node = Chef::Node.load("node_name")
unless ARGV[0] && ARGV[1]
puts "Usage: set_password.rb username password"
exit 1
end
require 'chef'
require 'chef/config'
require 'chef/webui_user'
Chef::Config.from_file(File.expand_path("~/.chef/knife.rb"))
@jellybob
jellybob / gist:478222
Created July 16, 2010 10:46
A snippet of the Sinatra app I'm using to interact with chef databags
# ...snip...
get '/users' do
@users = User.all
erb :users
end
get '/users/new' do
@user = User.new
erb :user_form
end
service "slapd" do
supports :restart => true, :status => true
action [ :enable, :start ]
end
# ... some shit ...
unless node[:slapd][:some_shit_has_been_done]
service "slapd" do
action :stop
<!DOCTYPE html>
<html>
<head>
<script src="http://www.google.com/jsapi?key=ABQIAAAAFGHbizpn9jfT8F79BhK2CRQBcqlJQAiZ8qPJLW0U41gaFClPGxSlTQ2kK3woukL0OnUH00YrxzWNeg"></script>
<script>
google.load("feeds", "1");
function init() {
var feed = new google.feeds.Feed("http://twitter.com/statuses/user_timeline/25873473.rss")
feed.load(function (result) {