Skip to content

Instantly share code, notes, and snippets.

00:16 ~ $ brew install wkhtmltopdf
==> Downloading http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.1.tar.gz
File already downloaded and cached to /Users/jproudman/Library/Caches/Homebrew
==> Downloading patches
######################################################################## 100.0%
==> Patching
/usr/bin/patch: **** Only garbage was found in the patch input.
Error: Failure while executing: /usr/bin/patch -f -p1 -i 001-homebrew.diff
# Generate all the stylesheets manually (from their Sass templates) before each restart.
before 'deploy:restart', 'sass:update'
namespace :sass do
desc 'Updates stylesheets if necessary from their Sass templates.'
task :update => :environment do
Sass::Plugin.options[:never_update] = false
Sass::Plugin.update_stylesheets
end
end
@jesseproudman
jesseproudman / Auto Scale API Mashup.rb
Created March 16, 2011 18:51
Logic for simple Auto Scale setup
require 'rubygems'; require 'active_resource'; require 'new_relic_api'
servers = File.open("server_count.txt", "r").first.to_i
instances_per_server = 6
cpu_burn_for_system = 1000.0 * 0.20
NewRelicApi.api_key = "<Your API Key>"
account = NewRelicApi::Account.find(:first);
application = account.applications[3];
@jesseproudman
jesseproudman / Github FI Nginx SSL.conf
Created February 10, 2011 06:07
This setup allows you to run Github FI behind an SSL curtain.
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
user daemon daemon;
http {
[fog@fog bbg_basher]$ ruby bash.rb
0.3.13
Deploying new server...
./lib/fog/lib/fog/core/model.rb:32:in `reload': undefined method `get' for nil:NilClass (NoMethodError)
from ./lib/fog/lib/fog/core/model.rb:44:in `wait_for'
from bash.rb:23
diff --git a/lib/fog/bluebox/models/compute/server.rb b/lib/fog/bluebox/models/compute/server.rb
index b447b82..5068d4f 100644
--- a/lib/fog/bluebox/models/compute/server.rb
+++ b/lib/fog/bluebox/models/compute/server.rb
@@ -81,12 +81,12 @@ module Fog
def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
requires :flavor_id, :image_id
- options = if !password && !public_key
+ options = if !attributes[:password] && !public_key
# Now we can install our packages.
packages = %w{ovzkernel.x86_64 vzctl.x86_64 vzctl-lib.x86_64 vzquota.x86_64}
packages.each do |pkg|
package pkg
end
namespace :delayed_job do
desc "Start delayed_job process"
task :start, :roles => :app do
run "PATH=$PATH:/opt/ree/bin && cd #{current_path} && RAILS_ENV=#{rails_env} script/delayed_job_ctl start"
end
desc "Stop delayed_job process"
task :stop, :roles => :app do
run "PATH=$PATH:/opt/ree/bin && cd #{current_path} && RAILS_ENV=#{rails_env} script/delayed_job_ctl stop"
end
#!/usr/bin/env ruby
require 'rubygems'
require 'fog'
@bluebox_api_key = "CHANGEME"
@flavor_id = "94fd37a7-2606-47f7-84d5-9000deda52ae" # Block 1GB Virtual Server
@image_id = "03807e08-a13d-44e4-b011-ebec7ef2c928" # Ubuntu 10.04 x64 LTS
# Grab our current list of servers