Skip to content

Instantly share code, notes, and snippets.

require 'pathname'
class Pathname
def hashes
children.map do |entry|
if entry.directory?
sha1 = [Digest::SHA1.hexdigest(entry.hashes.sort.join("")), entry]
else
sha1 = [Digest::SHA1.hexdigest(entry.read), entry]
end
curl https://github.com/beautifulcode/ssh-copy-id-for-OSX/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id
chmod +x /usr/local/bin/ssh-copy-id
app_home = "/home/mi/production"
workers = 5
Bluepill.application("mi_delayed_job", :log_file => "#{app_home}/shared/log/bluepill.log") do |app|
(0...workers).each do |i|
app.process("delayed_job.#{i}") do |process|
process.working_dir = "#{app_home}/current"
process.start_grace_time = 10.seconds
process.stop_grace_time = 10.seconds
process.restart_grace_time = 10.seconds
remove_file 'Gemfile'
create_file 'Gemfile' do
<<-GEMFILE
source 'http://rubygems.org'
gem 'rails', '3.0.1'
# The ORM which we will stake our application
gem "mongoid", ">= 2.0.0.beta.19"
gem "bson_ext", ">= 1.1.1"
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAngMjxyGbVnOxL0pZDPPrqpAS0SZYEgn4KHtNs1ZC4jf52TMrvrZmDAHmLJ67sk698Bpsg5jXNQuuMtBJeOeEbZIEKOjVVDb3OtD9ipoSWFFOM7ZvsSVIYdlCVaDuZwvdy4CzLR/i0qt5ilVoFp0llIxtNr19AbKDVm+Njr7UYsga7PXWp9HDauVfZU9RHIyypYOFGSYcO4WY8ZnsX5iTqAMBXjcBsog0Rkg9ngRnqR/+tH/CzOgUjwCA59SeYIpkt43hFjL1n+/ZRRpQJLnmtUTcJbcVhoUwhxibGGlw9mxG5iafQ9Knf1428Q4Et6gKYvO0FgzWnp5WybHogVLIaw== [email protected]
create_file ".rvmrc" do
<<-RVMRC
rvm_gemset_create_on_use_flag=1
rvm gemset use #{app_name}
RVMRC
end
remove_file 'Gemfile'
create_file 'Gemfile' do
<<-GEMFILE
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
MyModel.connection.reconnect!
else
# We're in conservative spawning mode. We don't need to do anything.
end
end
end
Server Software: Apache/2.2.14
Server Port: 80
Document Path: /
Document Length: 20266 bytes
Concurrency Level: 5
Time taken for tests: 344.008 seconds
Complete requests: 1000
Failed requests: 47
Server Software: nginx/0.7.67
Server Port: 80
Document Path: /
Document Length: 20266 bytes
Concurrency Level: 5
Time taken for tests: 304.670 seconds
Complete requests: 1000
Failed requests: 0
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Folder>
<name>CrisisCamp</name>
<open>1</open>
<description>
Entries from CrisisCamp
</description>
<Placemark>
<name>Khairewala</name>