Skip to content

Instantly share code, notes, and snippets.

View rcreasey's full-sized avatar
🎯
Focusing

Ryan C. Creasey rcreasey

🎯
Focusing
View GitHub Profile
#!/usr/bin/env ruby
require "rubygems"
require "erb"
require "fileutils"
require "json"
require "net/ssh"
require "net/scp"
require "optparse"
ruby-1.8.7-p299 > a = [1,2]
=> [1, 2]
ruby-1.8.7-p299 > b = a
=> [1, 2]
ruby-1.8.7-p299 > 3.times do
ruby-1.8.7-p299 > b.push b.shift
ruby-1.8.7-p299 ?> end
=> 3
ruby-1.8.7-p299 > b
=> [2, 1]
arkham:~ (ruby-1.8.7-p248) % knife ec2 server create "role[webserver]" -i ami-7ce51015 -G web,default -x centos5-gems -I ~/.ec2/arkham.local.pem
Instance ID: i-af1d03c5
Flavor: m1.small
Image: ami-7ce51015
Availability Zone: us-east-1b
Security Groups: web, default
SSH Key: arkham.local
Waiting for server................
Waiting 10 seconds for SSH Host Key generation on: ec2-184-73-36-219.compute-1.amazonaws.com
xe vm-shutdown vm=gst-prodweb-01.las1 &
xe vm-shutdown vm=gstmatch-onlivestor-01.las1 &
xe vm-shutdown vm=gstmatch-onlivestor-02.las1 &
xe vm-shutdown vm=gstmatch-onlivesvc-01.las1 &
xe vm-shutdown vm=gstmatch-onlivesvc-02.las1 &
xe vm-shutdown vm=gstmatch-prodstor-01.las1 &
xe vm-shutdown vm=gstmatch-prodstor-02.las1 &
xe vm-shutdown vm=gstmatch-prodstor-03.las1 &
xe vm-shutdown vm=gstmatch-prodstor-04.las1 &
xe vm-shutdown vm=gstmatch-prodstor-05.las1 &
execute "reload-sysctl" do
command "/sbin/sysctl -p"
action :nothing
end
template "/etc/sysctl.conf" do
source "gstmatch/sysctl.conf.erb"
owner "root"
group "root"
notifies :run, resources(:execute => "reload-sysctl")
[DEBUG] Made rrd filename: /var/lib/munin/example.com/test-02.example.com-open_inodes-max-g.rrd
[INFO]: Config update, ensuring type of '/var/lib/munin/example.com/test-02.example.com-open_inodes-max-g.rrd' is 'GAUGE'.
[ERROR] Tuning type of '/var/lib/munin/example.com/test-02.example.com-open_inodes-max-g.rrd' to 'GAUGE' failed.
[INFO]: Config update, ensuring max of '/var/lib/munin/example.com/test-02.example.com-open_inodes-max-g.rrd' is 'U'.
[ERROR] Tuning max of '/var/lib/munin/example.com/test-02.example.com-open_inodes-max-g.rrd' to 'U' failed.
[INFO]: Config update, ensuring min of '/var/lib/munin/example.com/test-02.example.com-open_inodes-max-g.rrd' is 'U'.
[ERROR] Tuning min of '/var/lib/munin/example.com/test-02.example.com-open_inodes-max-g.rrd' to 'U' failed.
[DEBUG] Made rrd filename: /var/lib/munin/example.com/test-02.example.com-open_inodes-used-g.rrd
[INFO]: Config update, ensuring type of '/var/lib/munin/example.com/test-02.example.com-open_inodes-used-g.rrd' is 'GAUGE'.
[ERROR] Tuning type
#!/bin/env ruby
vm_label = ARGV[0]
if vm_label.nil?
puts "You need to specify a new vm label."
puts "new_vm.rb <label> <path to json>"
exit
end
node_json = ARGV[1]
name 'gst-prodweb-01.las1'
run_list ['role[gst-web]']
set[:scaffold] = {
'hostname' => 'gst-prodweb-01',
'fqdn' => 'las1.colo.ignops.com',
'ip_address' => '10.93.56.67',
'net_device' => 'eth0',
'netmask' => '255.255.254.0',
'gateway' => '10.93.56.1',
'datacenter' => 'las1',
module PeopleHelper
def subnavigation
items = []
items << link_to('Person List', people_path, :class => 'list') unless params[:action].eql?('index')
items << link_to('Register Person', new_user_registration_path, :class => 'new') unless params[:action].eql?('new') or params[:action].eql?('show')
items << link_to('Edit Person', edit_person_path, :class => 'edit') if params[:action].eql?('show')
items << link_to('Delete Person', person_path, :confirm => 'Are you sure?', :method => :delete, :class => 'delete') if params[:action].eql?('show')
items = content_tag(:ul, items.collect{|n| content_tag(:li, n)})
content_tag(:div, items, :id => 'subnavigation')
end
{
"scaffold": {
"hostname": "gstmatch-prodstor-01",
"fqdn": "las1.colo.ignops.com",
"ip_address": "10.93.56.49",
"net_device": "eth0",
"netmask": "255.255.254.0",
"gateway": "10.93.56.1",
"datacenter": "las1",
"farm": {