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
| # ssh-known-hosts completion | |
| # | |
| _ssh_known_hosts() | |
| { | |
| local cur prev opts | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| prev="${COMP_WORDS[COMP_CWORD-1]}" | |
| if [ -n "$(echo ${cur} | grep '@')" ] ; then |
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
| yum update | |
| yum install mdadm | |
| yum install xfsprogs | |
| Attach your drives, ephemeral or EBS (/dev/sdf* here) | |
| mdadm --create /dev/md0 --verbose --metadata=1.1 --level=0 --chunk=256 --raid-devices=8 /dev/sdf1 /dev/sdf2 /dev/sdf3 /dev/sdf4 /dev/sdf5 /dev/sdf6 /dev/sdf7 /dev/sdf8 |
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
| # Template Block | |
| template "~/.ssh/config" do | |
| source "config.erb" | |
| owner "ubuntu" | |
| group "ubuntu" | |
| end | |
| [Wed, 01 Feb 2012 16:24:10 +0000] FATAL: Errno::ENOENT: template[~/.ssh/config] (my_cookbook::my_recipe line 85) had an error: Errno::ENOENT: No such file or directory - /tmp/chef-rendered-template20120201-10135-m1gp7t-0 or ~/.ssh/config |
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
| remote_file "my package" do | |
| path tmp_dpkg_location | |
| source "http://www.remotesite.com/packages/initial/#{node.appfirst_account_id}/package-#{arch}.#{extention}" | |
| ignore_failure true | |
| end | |
| dpkg_package "my package" do | |
| source "#{tmp_dpkg_location}" | |
| only_if "ls #{tmp_dpkg_location} > /dev/null" | |
| action :install |
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
| if [ ! -f /usr/local/bin/chef-client ]; then | |
| apt-get update | |
| apt-get install -y ruby1.9.1 ruby1.9.1-dev build-essential wget | |
| fi | |
| gem install ohai --no-rdoc --no-ri --verbose | |
| gem install right_aws --no-ri --no-rdoc --verbose | |
| gem install chef --no-rdoc --no-ri --verbose | |
| mkdir -p /etc/chef |
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
| service "apache2" do | |
| name "apache2" | |
| supports :restart => true, :reload => true | |
| action :enable | |
| # Hack to make sure we wait a little bit before restarting | |
| only_if "sleep 1" | |
| 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
| # Set up our disk | |
| include_recipe "data_volume::default" | |
| data_volume "/var/lib/redis" do | |
| action :create | |
| size 16 | |
| provider "data_volume" | |
| not_if "grep '/var/lib/redis' /etc/fstab > /dev/null" | |
| 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
| class Chef::Knife::Ec2ServerCreate < Chef::Knife | |
| alias :original_run :run | |
| def run | |
| @initial_sleep_delay = 30 | |
| original_run | |
| end | |
| option :attrs, | |
| :long => "--attrs ATTRS", |
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
| import sys, time, subprocess, socket, telnetlib | |
| from datetime import datetime | |
| from collections import defaultdict | |
| from boto.ec2.cloudwatch import CloudWatchConnection | |
| MAPPINGS = { | |
| # Memcached name: (AWS Name, AWS Metric Type, Calculation Method) | |
| 'uptime': ('Uptime', 'Count', 'gauge'), |
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/bash | |
| # A pre-commit hook that will stash any changes so that we are running our tests | |
| # against what we are committing, not what was on in memory. | |
| # Because I was having trouble getting trap to play nicely with any signal except | |
| # EXIT we just carry around our status and exit with it at the end | |
| status=0 |
OlderNewer