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 'fog' | |
| ELB = Fog::AWS::ELB.new | |
| COMPUTE = Fog::Compute.new( :provider => 'AWS') | |
| def server_from_dns_name dns_name | |
| COMPUTE.servers.all.find {|server| server.dns_name == dns_name} | |
| end | |
| def id_from_dns_name dns_name |
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
| Tom-Halls-MacBook-Pro:hen-night-hq-facebook-app tomh$ cap deploy | |
| METHOD IN DEPLOY | |
| * executing `task_in_deploy' | |
| TASK IN DEPLOY | |
| * executing `deploy' | |
| triggering before callbacks for `deploy' | |
| * executing `do_before' | |
| BEFORE | |
| * executing `deploy:update' | |
| ** transaction: start |
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
| def method_in_deploy | |
| puts "METHOD IN DEPLOY" | |
| end | |
| task :task_in_deploy do | |
| puts "TASK IN DEPLOY" | |
| end | |
| task :do_before do | |
| puts "BEFORE" |
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
| start on runlevel [2345] | |
| stop on runlevel [06] | |
| respawn | |
| expect fork | |
| script | |
| export HOME="/home/deploy" | |
| export JAVA_HOME="/usr/lib/jvm/java-6-sun" | |
| export HIVE_HOME="/usr/lib/hive" |
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
| puts "I have PID #{Process.pid}" | |
| Signal.trap("USR1") {puts "prodded me"} | |
| loop do | |
| begin | |
| puts "doing stuff" | |
| sleep 10 | |
| rescue Exception => e | |
| puts e.inspect |
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
| configure do | |
| set :haml, { :attr_wrapper => '"', :format => :html5 } | |
| 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
| require 'freeagent_api' | |
| include Freeagent | |
| Freeagent.authenticate({ | |
| :domain => 'tthuk.freeagentcentral.com', | |
| :username => 'tom@tthuk.com', | |
| :password => 'NotMyRealPassword'}) | |
| Contact.new({ :first_name => 'Tom', | |
| :last_name => 'Hall', |
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 John | |
| def like_your_work | |
| puts 'I like your work' | |
| end | |
| def x_your_face x | |
| puts "I'll #{x} your face" | |
| end | |
| 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
| #!/usr/bin/env ruby | |
| ARGF.each_with_index do |line, i| | |
| puts line if line =~ /AirPort/ and i % 5 == 0 | |
| 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
| > map <- expression({ | |
| + lapply(seq_along(map.values),function(r){ | |
| + x <- runif(map.values[[r]]) | |
| + rhcollect(map.keys[[r]],c(n=map.values[[r]],mean=mean(x),sd=sd(x))) | |
| + }) | |
| + }) | |
| > | |
| > z <- rhmr(map, ofolder="/tmp/test", inout=c('lapply','sequence'), | |
| + N=10,mapred=list(mapred.reduce.tasks=0),jobname='test') | |
| Error: could not find function "rhmr" |