This file contains 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
define launch_3_tier_v13_3(@srv_lb, @srv_app, @srv_db_master, @srv_db_slave, $staging) return @srv_lb, @srv_app, @srv_db_master, @srv_db_slave do | |
task_label("Launch 3-Tier Application") | |
# Since we want to launch these in concurrent tasks, we need to use global resources | |
# Tasks (like a "sub" of a concurrent block) get a copy of the resource scoped only | |
# to that task. Since we want to modify these particular resources, we copy them | |
# into global scope and copy them back at the end | |
@@launch_task_lb = @srv_lb | |
@@launch_db_master = @srv_db_master |
This file contains 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
node[:ec2][:instance_id] |
This file contains 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
# Install private key for git pull | |
file "/root/.ssh/git_ssh_key" do | |
content node[:ssh_key][:attribute] | |
mode "0400" | |
owner "root" | |
group "root" | |
end | |
git "/path/to/repo" do | |
repository "git://github.com/path/repo.git" |
This file contains 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
rightscale_marker :begin | |
log "Removing appserver IP address from firewall" | |
execute "iptables -D FWR -s #{node[:social][:ip_address_to_remove]} --destination 0.0.0.0/0 -p tcp --dport 5432 -j ACCEPT" do | |
cwd "/tmp" | |
end | |
rightscale_marker :end |
This file contains 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
# | |
# How to install automatically Oracle Java 7 under Salt Stack | |
# | |
# Thanks Oracle for complicating things :( | |
# | |
# 1. Create a java/ folder in your salt master | |
# 2. Paste this file in init.sls | |
# 3. salt '*' state.sls java | |
# | |
# Source: |
This file contains 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/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
This file contains 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
aws s3 ls s3://bucket --recursive | grep -v -E "(Bucket: |Prefix: |LastWriteTime|^$|--)" | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024/1024" GB"}' |
This file contains 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
presto:default> select count(*) from wiki_orc; | |
_col0 | |
------------- | |
56521097302 | |
(1 row) | |
Query 20141103_050649_00018_yw2uh, FINISHED, 40 nodes | |
Splits: 11,850 total, 11,850 done (100.00%) | |
1:06 [56.5B rows, 640GB] [861M rows/s, 9.76GB/s] |
This file contains 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
rspidel ^Server:.* | |
rspidel ^X-Powered-By:.* | |
option forwardfor | |
http-request set-header X-Forwarded-Proto https if { ssl_fc } | |
bind 0.0.0.0:443 ssl crt /usr/local/etc/haproxy/ssl_cert.pem |
This file contains 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
#DEFINITIONS | |
define create_volume(@volume_1,$ebs_name,$counter) return @volume do | |
$volume_hash=to_object(@volume_1) | |
$volume_hash['fields']['name']=$ebs_name+'-'+$counter | |
@volume=$volume_hash | |
provision(@volume) | |
end | |
define attach_volume(@server,@volume,@volume_attachment_1) do | |
$va_hash=to_object(@volume_attachment_1) |