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/sh | |
# Demo how your can merge opscode chef-repo & cookbooks | |
# and perm. keep up to date with opscode cookbooks (list line) | |
% git clone git://github.com/opscode/chef-repo.git | |
Initialized empty Git repository in /home/tim/src/chef-repo/.git/ | |
remote: Counting objects: 107, done. | |
remote: Compressing objects: 100% (99/99), done. | |
remote: Total 107 (delta 45), reused 0 (delta 0) | |
Receiving objects: 100% (107/107), 16.14 KiB, done. | |
Resolving deltas: 100% (45/45), done. |
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
# Check this out, rvm use rbx | |
ruby_block "rvm use rbx" do | |
block do | |
Chef::Mixin::Command.popen4('bash -l -c "rvm use 1.9.1 && env"') do |p,i,o,e| | |
o.each_line do |line| | |
env_bits = line.split("=") | |
ENV[env_bits[0]] = env_bits[1] | |
end | |
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
# Chef Client Config File | |
# Automatically grabs configuration from ohai ec2 metadata. | |
require 'ohai' | |
require 'json' | |
o = Ohai::System.new | |
o.all_plugins | |
chef_config = JSON.parse(o[:ec2][:userdata]) | |
if chef_config.kind_of?(Array) |
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
users Mash.new unless attribute?("users") | |
groups Mash.new unless attribute?("groups") | |
ssh_keys Mash.new unless attribute?("ssh_keys") | |
roles Mash.new unless attribute?("roles") | |
groups[:admin] = {:gid => 113} | |
roles[:chef] = {:groups => [:admin], :sudo_groups => [:admin]} | |
roles[:staff] = {:groups => [:admin], :sudo_groups => [:admin]} |
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
def initialize(name, collection=nil, node=nil) | |
super(name, collection, node) | |
puts "Overridden initialize" | |
@provider = Chef::Provider::Tomcat6Application | |
end | |
actions :create, :delete | |
attribute :name, :kind_of => String, :name_attribute => true | |
attribute :config_dir, :kind_of => String |
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
queue_host "localhost" | |
queue_password "" | |
queue_port 61613 | |
queue_retry_count 5 | |
queue_retry_delay 5 | |
queue_user "" | |
queue_prefix nil |
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
set.users({ | |
:bob => { | |
:gecos => "Brash Deploy User", | |
:shell => "/bin/bash", | |
:home => "/home/deploy" | |
} | |
} | |
) |
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
try | |
{ | |
DataTable dt = new DataTable(); | |
if (d.ItemsSource is IEnumerable) | |
{ | |
IEnumerable items = d.ItemsSource as IEnumerable; | |
List<string> propertyNames = new List<string>(); | |
foreach (object o in items) | |
{ |
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
ase node[:platform] | |
when "debian", "ubuntu" | |
%w{automake autoconf libtool subversion-tools help2man build-essential erlang libicu38 libicu-dev libreadline5-dev checkinstall libmozjs-dev wget libcurl4-gnutls-dev}.each {|pkg| package(pkg) } | |
end | |
execute "download_couchdb" do | |
user "root" | |
cwd "/tmp" | |
command "wget http://mirror.public-internet.co.uk/ftp/apache/couchdb/0.9.1/apache-couchdb-0.9.1.tar.gz" | |
creates "/tmp/apache-couchdb-0.9.1.tar.gz" |
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
#!/usr/bin/ruby | |
# Requirements | |
require "csv" | |
file = File.open("/tmp/play.dot","w") | |
file.puts "graph G { " | |
#file.puts "\trankdir=LR " | |
file.puts "\tratio=expand;" |