Skip to content

Instantly share code, notes, and snippets.

View fujin's full-sized avatar

AJ Christensen fujin

  • Rotorua, New Zealand
View GitHub Profile
aj@AJ-Christensens-MacBook (branch: master) ~/Development/chef$ sudo irb
>> require 'rubygems'
=> false
>> Gem.available? "mixlib-cli"
=> false
>> `gem install mixlib-cli`
=> "Successfully installed mixlib-cli-1.0.4\n1 gem installed\nInstalling ri documentation for mixlib-cli-1.0.4...\nInstalling RDoc documentation for mixlib-cli-1.0.4...\n"
>> Gem.available? "mixlib-cli"
=> false
>> Gem.refresh
<% if @node[:chef][:client_log] -%>
log_location "<%= @node[:chef][:client_log] %>
<% else -%>
log_location STDOUT
<% end -%>
#!/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;"
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"
@fujin
fujin / hehe.cs
Created August 10, 2009 13:07 — forked from anonymous/gist:165179
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)
{
@fujin
fujin / gist:168556
Created August 16, 2009 04:32 — forked from damm/gist:168555
set.users({
:bob => {
:gecos => "Brash Deploy User",
:shell => "/bin/bash",
:home => "/home/deploy"
}
}
)
queue_host "localhost"
queue_password ""
queue_port 61613
queue_retry_count 5
queue_retry_delay 5
queue_user ""
queue_prefix nil
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
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]}
@fujin
fujin / client.rb
Created December 30, 2009 10:56 — forked from brynary/client.rb
the Chef client.rb config that sucks instance data
# 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)