Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Joshua Timberman jtimberman

🚀
View GitHub Profile
@jtimberman
jtimberman / ec2.rb
Created Oct 17, 2008 — forked from adamhjk/ec2.rb
undefined
View ec2.rb
task :classify_nodes do
@dns_names.each do |description|
description =~ /^(.+?)\..+$/
hostname = $1
node = @ic.get_node(hostname)
if exists?(:puppet_env)
EC2_DATA[:iclassify_attribs]["puppet_env"] = puppet_env
end
node.tags = EC2_DATA[:iclassify_tags]
EC2_DATA[:iclassify_attribs].each do |name, values|
View gist:31487
[Wed, 03 Dec 2008 03:13:34 -0700] INFO: Ran execute[chef-indexer-down] successfully
[Wed, 03 Dec 2008 03:13:35 -0700] INFO: Ran execute[chef-server-down] successfully
[Wed, 03 Dec 2008 03:13:35 -0700] INFO: Ran execute[stompserver-down] successfully
execute "#{params[:name]}-down" do
command "/etc/init.d/#{params[:name]} down"
only_if params[:only_if]
end
runit_service "chef-indexer" do
View gist:31762
[Wed, 03 Dec 2008 15:49:53 -0800] DEBUG: Loading Recipe chef::server
[Wed, 03 Dec 2008 15:49:53 -0800] DEBUG: Found recipe server in cookbook chef
[Wed, 03 Dec 2008 15:49:53 -0800] DEBUG: {"apache2::mod_mime"=>true, "apache2::mod_setenvif"=>true, "apache2::mod_negotiation"=>true, "apache2::mod_authz_groupfile"=>true, "apache2::mod_auth_basic"=>true, "apache2::mod_autoindex"=>true, "apache2::mod_authz_host"=>true, "apache2::mod_authz_user"=>true, "apache2::mod_env"=>true, "apache2::mod_alias"=>true, "apache2"=>true, "apache2::mod_status"=>true, "apache2::mod_authn_file"=>true, "apache2::mod_dir"=>true, "apache2::mod_authz_default"=>true}
[Wed, 03 Dec 2008 15:49:53 -0800] DEBUG: Found recipe default in cookbook runit
/var/lib/gems/1.8/gems/chef-0.0.1/lib/chef/recipe.rb:128:in `method_missing': (eval):1:in `method_missing': uninitialized constant Chef::Resource::Validate (NameError)
from /srv/chef/cache/cookbooks/runit/definitions/runit_service.rb:26:in `eval'
from /var/lib/gems/1.8/gems/
View gist:34980
$ /srv/ree/bin/irb
irb(main):001:0> $: << "/usr/lib/rub/gems/1.8"
=> ["/srv/ree-1.8.6-20081205/lib/ruby/site_ruby/1.8", "/srv/ree-1.8.6-20081205/lib/ruby/site_ruby/1.8/i686-linux", "/srv/ree-1.8.6-20081205/lib/ruby/site_ruby", "/srv/ree-1.8.6-20081205/lib/ruby/1.8", "/srv/ree-1.8.6-20081205/lib/ruby/1.8/i686-linux", ".", "/usr/lib/rub/gems/1.8"]
irb(main):002:0> require 'rubygems'
=> true
irb(main):003:0> require 'tzinfo'
LoadError: no such file to load -- tzinfo
from /srv/ree-1.8.6-20081205/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /srv/ree-1.8.6-20081205/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from (irb):3
View gist:35018
GEM_PATH not set:
$ gem list hoe
*** LOCAL GEMS ***
hoe (1.4.0)
$ /srv/ree/bin/gem list hoe
*** LOCAL GEMS ***
View gist:54908
group "sysadmin" do
gid 33
users ["aj", "jtimberman"]
end
user "aj" do
action :create
comment "Leet hax0r"
uid 1337
shell "/bin/zsh"
View gist:55335
On local system, ~root/.ssh/config:
Host chef_server
IdentityFile /root/.ssh/chef_tunnel
User chef_client
Hostname gateway.example.com
Port 2022 # open port 2022 on your firewall to NAT to 22 on chef server
LocalForward 4400 my-chef-server:4000 # chef
LocalForward 4401 my-chef-server:4001 # openid
### end .ssh/config ###
View gist:55354
$ ssh-keygen -f some_key -C 'this key is awesome'
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in some_key.
Your public key has been saved in some_key.pub.
The key fingerprint is:
9c:28:d3:69:81:a7:37:8b:1f:21:48:0d:05:72:55:40 this key is awesome
The key's randomart image is:
+--[ RSA 2048]----+
View gist:57785
"interfaces": {
"vmnet1": {
"flags": [
"UP",
"BROADCAST",
"SMART",
"RUNNING",
"SIMPLEX",
"MULTICAST"
],
View gist:59675
define :php_app, :docroot, :canonical_hostname => nil, :template => "php/php.conf.erb" do
application_name = params[:name]
include_recipe "apache2"
include_recipe "apache2::mod_rewrite"
include_recipe "apache2::mod_deflate"
include_recipe "apache2::mod_headers"
template "/etc/apache2/sites-available/#{params[:name]}.conf" do