Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Edmond, OK
  • 03:48 (UTC -12:00)
  • X @rrichards
View GitHub Profile
### Rakefile
task :template do
require 'yaml'
require 'erb'
base = File.join(File.dirname(__FILE__), 'config')
source = File.join(base, 'dna.json.erb')
target = File.join(base, 'dna.json')
recipes = ENV['recipe'] || %w(packages users gems)
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
#!/bin/sh
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
APP_ROOT=/home/deploy/public_html/rm/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENV=production
#!/bin/bash
# run with: curl -s http://gist.github.com/265272.txt | bash
set -e
localdir=$HOME/.mongodb
datadir=$localdir/data
conf=$localdir/mongod.conf
agentdir=$HOME/Library/LaunchAgents
agent=$agentdir/org.mongodb.mongod.plist
task :stage1 do
set :default_environment, {
'PATH' => "/home/rrichards/.rvm/rubies/ruby-1.8.7-p249/bin:/home/rrichards/.rvm/gems/ruby-1.8.7-p249/bin:/home/rrichards/.rvm/gems/ruby-1.8.7-p249@global/bin:/home/rrichards/.rvm/bin:$PATH",
'RUBY_VERSION' => 'ruby 1.8.7',
'GEM_HOME' => '/home/rrichards/.rvm/gems/ruby-1.8.7-p249',
'GEM_PATH' => '/home/rrichards/.rvm/gems/ruby-1.8.7-p249:/home/rrichards/.rvm/gems/ruby-1.8.7-p249@global',
'BUNDLE_PATH' => '/home/rrichards/.rvm/gems/ruby-1.8.7-p249'
}
set :deploy_to, "/home/rrichards/www/freedomsoft"
@rrichards
rrichards / db.rb
Created June 27, 2010 05:18 — forked from alg/db.rb
namespace :db do
desc 'Seed database from db/seed.sql file instead of the traditional db/seed.rb'
namespace :seed do
config = Rails::Configuration.new.database_configuration[RAILS_ENV]
seed_sql = File.expand_path(File.dirname(__FILE__) + '/../../db/seed.sql')
if !File.exists?(seed_sql)
puts "Missing RAILS_ROOT/db/seed.sql"
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin [email protected]
ServerName stage1.freedomsoft.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /var/www/apps/my.freedomsoft.com/current/public
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin [email protected]
ServerName justinbuyertest.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /var/www/apps/websites.freedomsoft.com/current/public
(in /var/www/apps/chargify.com/releases/20100714220017)
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
(in /var/www/apps/chargify.com/releases/20100714220017)
Using the default profile...
..........................F--........................F--..............F--........F--.............................................F.............F.....................F..........................F-.........F-........F-.........F-............................F----.........F----.........F----...........F-----...........F------..........F---..........................F-................................................................................................................................................................................F--.............................................................................................F--....................F--................................F--...............F-....................F-...................F-...............F-....................F-...................F-......................F----.......................................................F--....................................F