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
| 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 |
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
| 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', |
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/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] |
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
| [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 |
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
| 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") |
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
| 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 & |
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
| 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 |
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
| 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] |
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/env ruby | |
| require "rubygems" | |
| require "erb" | |
| require "fileutils" | |
| require "json" | |
| require "net/ssh" | |
| require "net/scp" | |
| require "optparse" |
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
| include_recipe "git" | |
| node.run_state[:applications] = [] | |
| search(:apps) do |app| | |
| (app["server_roles"] & node.run_list.roles).each do |app_role| | |
| node.run_state[:applications] << {:app => app, :recipes => app["type"][app_role]} | |
| end | |
| end |