Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fairchild's full-sized avatar

Michael Fairchild fairchild

  • Procore
  • California
View GitHub Profile
require 'rubygems'
$:.unshift "#{File.dirname(__FILE__)}/../lib"
require "poolparty"
pool :ap do
instances 1
access_key "XXXXXX"
secret_access_key "XXXXXXX"
cloud :app_stack do
cloud-start -s config/clouds.rb
Starting cloud app (/home/yann/.ec2/testpoolparty)
0 running instances (1 - 1)
/usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:261:in `ec2_error?': The key pair 'testpoolparty' does not exist (EC2::InvalidKeyPairNotFound)
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:199:in `make_request'
from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:173:in `make_request'
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:224:in `response_generator'
from /usr/lib/rub
# Example of a Rack application that takes advantage to body.each to simulate
# a real-time data feed.
#
# Anyone may use this code AT YOUR OWN RISK.
require 'rack'
require 'ebb'
#This class simulates a server waiting for events. it will yield a line with one of the HTTP Request
#headers every half second. If things work right you should see you browser window slowely fill with
module Rack
#
# A Rack middleware for automatically removing the format token at the end
# of a request path and adding its media type to the HTTP_ACCEPT header.
#
# MIT-License - Rein Henrichs
#
class FormatAccepts
def initialize(app)
@app = app
pool :involver_rails do
cloud :nginx do
instances 2..2 # binds against 2 elastic IPs
has_package "nginx"
proxy {:source_port=>80, :destination_port=>8080, :destination_cloud=>:app}
end
cloud :app do
# Basic pool spec
# Shows global settings for the clouds
pool :party do
# instances 1..3
# set_master_ip_to '174.129.221.207'
keypair "#{ENV["HOME"]}/.poolparty/pool_dsa_key"
verbose true
# ami 'ami-7cfd1a15'
# using :vmrun
#########
# Cloud configuration
.
./test
./test/clouds.rb
./test/plugins
pool :test do
cloud :app do
instances 2..5
class Pop
def initialize(h={}, &block)
options(h)
puts "indide #{self.class} #{options.inspect}"
instance_eval &block if block
end
def self.default_options(h={})
@default_options ||= h
end
def any_verb(path, block)
get path, &block
post path, &block
put path, &block
delete path, &block
head path, &block
end
any_verb "/" do
"foo"
<div id="player">
<canvas id="levels" width="145" height="24"></canvas>
</div>