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
Jill | |
Jack | |
Jim | |
Jane | |
Frank | |
Bob | |
Joe | |
Nancy | |
Alex | |
Somebody |
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
require 'ap' | |
$pair_size = (ENV['PAIR_SIZE'] || 2).to_i | |
def pairs(participants) | |
pairs = participants.shuffle.each_slice($pair_size).to_a | |
if pairs.last.size == 1 | |
loner = pairs.pop | |
pairs.last << loner.first |
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
host SOMEDOMAIN.COM | |
# where ns1.isp.com is one of your ISP DNS servers | |
nslookup SOMEDOMAIN.COM ns1.isp.com | |
dig SOMEDOMAIN.COM @ns1.isp.com | |
traceroute SOMEDOMAIN.COM | |
# on MAC flush dns cache |
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
# given a file with a number on each line | |
# 1) add a comma to the end of each | |
q a # record and store in 'a' | |
A,<esc>j # Go to end of line in insert mode, type , go to next line | |
q # stop recording | |
50@a # run the recording 50 times | |
# 2) put all on a single line | |
:1,50j |
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
# 1) install puppet locally | |
# - install modules to local modules directory | |
# puppet module install puppetlabs/postgresql --force -i modules | |
# puppet module install puppetlabs/stdlib --force -i modules | |
# puppet module install puppetlabs/firewall --force -i modules | |
# puppet module install puppetlabs/apt --force -i modules | |
# puppet module install ripienaar/concat --force -i modules | |
# OR | |
# download tar file from https://forge.puppetlabs.com/puppetlabs/postgresql | |
# and place into modules directory |
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
exec { | |
"apt-get update": | |
path => "/usr/bin" | |
} | |
# manage_package_repo => true will satisfy apt_postgresql_org | |
# include postgresql::package_source::apt_postgresql_org | |
class { 'postgresql': | |
version => '9.2', |
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
Vagrant.configure("2") do |config| | |
# assumes your chef.json files are in cookbooks or site-cookbooks directory | |
servers = [ | |
{ | |
id: :db1, | |
ip: "172.16.2.111", | |
node_json: "master-db.json" | |
}, | |
{ | |
id: :db2, |
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 "usermod jenkins -aG postgres" do | |
not_if "groups jenkins | grep postgres" | |
end | |
execute "createuser jenkins --superuser --no-password" do | |
user "postgres" | |
group "postgres" | |
cwd "/var/lib/postgresql" | |
not_if "psql postgres -tAc \"SELECT 1 FROM pg_roles WHERE rolname='jenkins'\" | grep 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
class ExampleMailer < ActionMailer::Base | |
default from: "[email protected]" | |
# default layout for ExampleMailer | |
layout "customer_email" | |
# the order ready is sent to the customer and uses the default layout - customer_email | |
def order_ready | |
@greeting = "Hi" | |
mail to: "[email protected]" | |
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
mail.header['X-MSMail-Priority'].value.should == 'High' |