Skip to content

Instantly share code, notes, and snippets.

View thehar's full-sized avatar

Harley Alaniz thehar

View GitHub Profile
# references
# http://wiki.opscode.com/display/chef/Chef+Repository
# http://blog.ibd.com/howto/deploy-wordpress-to-amazon-ec2-micro-instance-with-opscode-chef/
# on laptop
$ sudo gem install chef
$ sudo gem install net-ssh net-ssh-multi highline fog
$ mkdir ~/git
$ cd ~/git
AIR PRICES:
• Compressed Air or CO2
• One fill $5.00 (any size tank)
• Unlimited fills $10.00 (must be playing at facility)
We have compressed air available, up to 4500 psi*
*No Scubas are allowed on premises or in parking lot*
PAINT PRICES:
*Paintballs:
@thehar
thehar / ebs_raid6_provider.rb
Created September 27, 2011 21:32 — forked from fujin/ebs_raid6_provider.rb
aws_ebs_raid6 lwrp
include Chef::Mixin::Command
action :create do
size = new_resource.size
volumes = new_resource.volumes.times.map{|i| (i == 0 ? "/dev/sdf" : "/dev/sdf#{i}") }
setra = new_resource.blockdev_setra
volume_group = new_resource.volume_group
logical_volume = new_resource.name
mdadm_device = new_resource.mdadm_device
mount_point = new_resource.mount_point
@thehar
thehar / ebs_raid.rb
Created September 27, 2011 21:32 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
pool_members_search = search(:node, "roles:loadbalancer AND chef_environment:#{node.chef_environment}")
pool_members = pool_members_search.map { |ip| ip[:ipaddress] }
currentdir = File.dirname(FILE_)
sys_user = ENV["USER"]
log_level :info
log_location STDOUT
node_name sys_user
client_key "#{ENV["HOME"]}/.chef/#{ENV["KNIFE_ENV"]}/#{ENV["USER"]}.pem"
validation_client_name "chef-validator"
validation_key "#{ENV["HOME"]}/.chef/#{ENV["KNIFE_ENV"]}/validator.pem"
# Cookbook Name:: jenkins
# Recipe:: default
# Copyright 2012, Lookout Inc.
# All rights reserved - Do Not Redistribute
include_recipe("apt")
apt_repository "jenkins" do
uri "http://pkg.jenkins-ci.org/debian"
components ["binary"]
#!/usr/bin/env ruby
# Wrapper file for smoke check for Pingdom Dashboard
require 'rubygems'
pwd = File.dirname(File.expand_path(__FILE__))
file = pwd + '/smoke-check.rb'
# Path of the WWW page for Pingdom status check
@thehar
thehar / gist:5640651
Created May 24, 2013 01:01
Disown is hot
^Z
[1]+ Stopped rsync -avz /mnt/[redacted]/mysql-backup/2013-05-22_17-27-15/ server:/mnt/das0/mysql-backup/
deployer@server:~$ bg
[1]+ rsync -avz /mnt/server/mysql-backup/2013-05-22_17-27-15/ server:/mnt/das0/mysql-backup/ &
deployer@server:~$ jobs
[1]+ Running rsync -avz /mnt/server/mysql-backup/2013-05-22_17-27-15/ server:/mnt/das0/mysql-backup/ &
deployer@server:~$ disown 1
-bash: disown: 1: no such job
deployer@server:~$ disown %1
deployer@server:~$ jobs
@thehar
thehar / gist:5854817
Created June 24, 2013 23:59
Workflow for nagios multi-opsen
1. Bare repo lives as a bare repo hosted up by #{web_server} in /srv/nagios.git
2. Clone it over to /etc/nagios3
3. Write a script to make magical git pull --rebase origin master and merge local changes with commits
4. Does a verbose check of nagios configs and halts script if 1 not 0.
5. Happiness in nagios configs after -v restart it.