Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am mdolian on github.
* I am mdolian (https://keybase.io/mdolian) on keybase.
* I have a public key whose fingerprint is 84CB 9EE7 4990 503E 24C3 DDCA 130F D6E5 97D5 BFA4
To claim this, I am signing this object:
#
# Cookbook Name:: whenever
# Recipe:: default
#
ey_cloud_report "whenever" do
message "starting whenever recipe"
end
# Set your application name here
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 127.0.0.1
Master_User: replication
Master_Port: 3307
Connect_Retry: 60
Master_Log_File: master-bin.000004
Read_Master_Log_Pos: 3564
Relay_Log_File: mysqld-relay-bin.000001
package "media-gfx/imagmagick" do
version "6.3.3"
action :install
end
iptables -t nat -A PREROUTING -d <source_ip> -p tcp -m tcp -m comment --comment "switching availability zones" -j DNAT --to-destination <destination_ip>
iptables -t nat -A POSTROUTING -d <source_ip> -p tcp -m tcp -m comment --comment "switching availability zones" -j SNAT --to-source <destination_ip>
@mdolian
mdolian / resque.rb
Created April 8, 2011 20:53
Capistrano recipes for Resque
namespace :resque do
desc "After deploy:restart we want to restart the workers"
task :restart, :roles => [:app], :only => {:resque => true} do
sudo "monit restart all -g resque_#{application}"
end
after "deploy:restart","resque:restart"
desc "After update_code we want to symlink the resque.yml"
task :symlink, :roles => [:app], :only => {:resque => true} do
run "if [ -f #{shared_path}/config/resque.yml ]; then ln -nfs #{shared_path}/config/resque.yml #{latest_release}/config/resque.yml; fi"
Started POST "/recordings" for 127.0.0.1 at 2010-05-20 22:13:53
Processing by RecordingsController#index as HTML
Parameters: {"commit"=>"Create Recording", "discs"=>"3", "authenticity_token"=>"NhA9TNzE2IGGWhTVQE/Y5iorFpMRXgNKjoOOD6ARzHQ=", "date_played"=>"2002-01-04", "recording"=>{"shnid"=>"sdfa", "lineage"=>"tes", "label"=>"test", "filetype"=>"mp3f", "notes"=>"lksadf", "transfered_by"=>"lkj", "taper"=>"sakfl", "recording_type"=>"sbd", "source"=>"tes", "show_id"=>"1111"}}
/Users/dolian/projects/ambernet/config/routes.rb:4: undefined method `match' for main:Object (NoMethodError)
from /Users/dolian/projects/ambernet/vendor/plugins/rpm/lib/new_relic/control/rails.rb:101:in `draw'
from /Users/dolian/.rvm/gems/ruby-1.8.7-p249/gems/actionpack-3.0.0.beta3/lib/action_dispatch/routing/route_set.rb:213:in `instance_exec'
from /Users/dolian/.rvm/gems/ruby-1.8.7-p249/gems/actionpack-3.0.0.beta3/lib/action_dispatch/routing/route_set.rb:213:in `draw_without_newrelic_map'
from /Users/dolian/projects/ambernet/vendor/plugins/rpm/lib/new_relic/control/rails.rb:96:in `draw'
from /Users/dolian/projects/ambernet/config/routes.rb:1
from /Users/dolian/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta3/lib/active_support/dependencies.rb:205:in `load'
from /Users/dolian/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta3/lib/active_support/dependencies.rb:205:in `load'
from /Users/dolian/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta3/lib/active_support/dependencies.rb:195
Running Rails 3 on EY Cloud
1) Create an environment that uses Ruby 1.8.7 (BETA)
2) Create a new Rails 3 application that uses Nginx+Passenger
3) Add the latest version of the bundler via the gems interface
4) Add a post deploy hook to your application that simply runs:
module Ambernet
class Application < Rails::Application
config.middleware.insert_after ActionDispatch::Head, Rack::Hoptoad, "<api_key>" do |notifier|
notifier.report_under << 'development'
end
end
end