This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts spec.to_s.inspect | |
# => "development" | |
puts configurations.keys.inspect | |
# => [ "development", "test", "cucumber", "production" ] | |
puts configurations.keys.include?(spec.to_s) | |
# => false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failure/Error: it { should_not redirect_to("/login") } | |
Expected response to be a <:redirect>, but was <200>. | |
Expected block to return true value. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chosen_server = nil | |
ruby_block "choose server" do | |
block do | |
chosen_server = `hideous java command` | |
end | |
end | |
puts chosen_server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/config' | |
require 'chef/node' | |
Chef::Config.from_file(File.join("etc", "chef", "client.rb")) | |
node = Chef::Node.load("node_name") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ...snip... | |
get '/users' do | |
@users = User.all | |
erb :users | |
end | |
get '/users/new' do | |
@user = User.new | |
erb :user_form | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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) { |