Skip to content

Instantly share code, notes, and snippets.

require File.dirname(__FILE__) + '/../foo_page'
describe FooPage do
before(:all) do
html = File.open(File.dirname(__FILE__) + '/../fixtures/foo.html').read
doc = Capybara.string(html)
@page = FooPage(doc)
end
@hedgehog
hedgehog / ebs_raid.rb
Created November 11, 2011 03:59 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
@joelcogen
joelcogen / rails2_feature.feature
Created September 27, 2011 14:44
JS confirm dialog testing with Cucumber, Capybara, Rails 2 and 3
Then I expect to click "OK" on a confirmation box saying "Are you sure?"
And I press "Delete"
And the confirmation box should have been displayed
# Author:: Adam Jacob <adam@opscode.com>
# Author:: Joshua Timberman <joshua@opscode.com>
#
# Copyright 2009-2010, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@hedgehog
hedgehog / ubuntu10.04-ruby192.erb
Created June 15, 2011 06:03 — forked from czottmann/ubuntu10.04-ruby192.erb
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
bash -c '
if [ ! -f /usr/local/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev
cd /usr/src
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.bz2
tar xjf ruby-1.9.2-p180.tar.bz2
cd ruby-1.9.2-p180
./configure
@hedgehog
hedgehog / chef-010-apt.erb
Created June 15, 2011 06:02 — forked from jtimberman/chef-010-apt.erb
Bootstrap template for chef 0.10 with apt.opscode.com, save as ~/.chef/bootstrap/chef-010-apt.erb
bash -c '
if [ ! -f /usr/bin/chef-client ]; then
echo "chef chef/chef_server_url string <%= Chef::Config[:chef_server_url] %>" | debconf-set-selections
[ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com `lsb_release -cs`-0.10 main" > /etc/apt/sources.list.d/opscode.list
wget -O- http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add -
fi
apt-get update
apt-get install -y chef
<% unless Chef::Config[:validation_client_name] == "chef-validator" -%>
@hedgehog
hedgehog / deploy.rake
Created June 6, 2011 23:41 — forked from sandro/deploy.rake
WIP Whiskey Disk deployment with db backup and lesscss generation
require 'whiskey_disk/rake'
require 'whiskey_disk/helpers'
namespace :deploy do
ENV['to'] ||= 'staging'
def verbose_cmd(cmd)
system %(set -x && #{cmd})
end
@hedgehog
hedgehog / dba-user.json
Created June 2, 2011 23:03 — forked from lusis/dba-user.json
Managing MySQL user accounts with Chef
{
"id":"dbauser",
"uid":506,
"comment":"DBA User",
"shell":"/bin/bash",
"groups": [
"sysadm",
"dba"
],
"ssh_key": "XXXXXXXXXX"
@nesquena
nesquena / apps.rb
Created May 17, 2011 23:53
Padrino session snippet
# config/apps.rb
Padrino.configure_apps do
enable :sessions
# $ padrino rake gen
# $ rake secret
set :session_secret, "long secret key pasted here"
end
Vagrant::Config.run do |global_config|
aptdir = (ENV['APTCACHE'] or "#{ENV['HOME']}/aptcache/")
checkout = (ENV['COOKBOOKS'] or "#{ENV['HOME']}/openstack-cookbooks")
ip_prefix = (ENV['IP_PREFIX'] or "192.168.76.")
mac_prefix = (ENV['MAC_PREFIX'] or "080027076")
fixed = (ENV['FIXED'] or "10.0.76.0/24")
global_config.vm.define :chef do |config|
suffix = "100"
ip = "#{ip_prefix}#{suffix}"
config.vm.box = "base"