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
  • 04:10 (UTC -12:00)
  • X @rrichards
View GitHub Profile
@rrichards
rrichards / TechDecisions.md
Created November 29, 2011 06:51
Choices to make in a new Rails project. Would love to see this forked with other's opinions.

Team Support

Source Code Control

git (private server)
Alternative: github

Time Tracking

Cashboard

@rrichards
rrichards / gist:1423397
Created December 2, 2011 14:23 — forked from botchagalupe/gist:1080335
Setting up Chef-Solo

Images used in hack a thon

{ "name": "devops01", "id": "20095942", "uuid": "e55a9ac1e7f32b6228b53bea7f305621d6514bde", "public_ip": ['184.106.177.19'], "private_ip": ['10.180.128.208'], "extra": {'flavorId': '4', 'uri': 'https://servers.api.rackspacecloud.com/v1.0/544644/servers/20095942', 'imageId': '49', 'hostId': '4a98d4f222e5d8823fa87aada364b751', 'password': 'devops011aQwJ6M4h', 'metadata': {}}}

{ "name": "devops02", "id": "20095945", "uuid": "ae5355f4647f025e9506a53329734c4516a4098d", "public_ip": ['184.106.177.24'], "private_ip": ['10.180.128.207'], "extra": {'flavorId': '4', 'uri': 'https://servers.api.rackspacecloud.com/v1.0/544644/servers/20095945', 'imageId': '49', 'hostId': '5c916b5d52edc2f3f39feed720188d73', 'password': 'devops02U6HtQn26p', 'metadata': {}}}

{ "name": "devops03", "id": "20095947", "uuid": "8abd4227ecb5792072a271092b25f2049937e3bc", "public_ip": ['184.106.177.25'], "private_ip": ['10.180.128.206'], "extra": {'flavorId': '4', 'uri': 'https://servers.api.rackspacecloud.com/v1.

@rrichards
rrichards / cap_notify.rb
Created December 13, 2011 14:57 — forked from johnthethird/cap_notify.rb
Capistrano deployment email notifier for Rails 3
=begin
Capistrano deployment email notifier for Rails 3
Do you need to send email notifications after application deployments?
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html.
Here is Rails 3 port of the notifier.
The notifier sends an email after application deployment has been completed.
@rrichards
rrichards / capistrano_db_dump_and_clone_to_local.rb
Created December 13, 2011 16:39 — forked from rgo/capistrano_db_dump_and_clone_to_local.rb
Capistrano: Dump and clone to local database
# Directly copied from eycap-0.5.2 (thanks!)
#
# With these tasks you can:
# - dump your production database and save it in shared_path/db_backups
# - dump your production into your local database (clone_to_local)
#
# Tested and fixed by fjguzman
Capistrano::Configuration.instance(:must_exist).load do
namespace :db do
@rrichards
rrichards / deploy.rb
Created December 13, 2011 16:39 — forked from netzpirat/deploy.rb
Capistrano recipe to sync rails database and files within a multi stage environment
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
@rrichards
rrichards / deploy.rb
Created December 13, 2011 16:40 — forked from LRDesign/deploy.rb
Capistrano recipe to sync rails database and files, using remote database.yml instead of local for remote credentials
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
desc "Load production data into development database"
task :import_remote_db do
filename = "dump.#{Time.now.strftime '%Y-%m-%d_%H:%M:%S'}.sql"
dbuser = "yourusername"
dbhost = "yourhostname"
dbpassword = "yourpassword"
application_db = "yourdatabasename"
local_db_host = "localhost"
local_db_user = "local_user_name"
@rrichards
rrichards / generate_and_deploy_assets.rb
Created December 19, 2011 06:55 — forked from micahbrich/generate_and_deploy_assets.rb
capistrano recipe for moving public files to s3
desc "Generate and deploy assets"
task :deploy_assets, :roles => :app do
# get the previous timestamp
old_timestamp = File.read("config/deploy_timestamp").to_i rescue 0
# generate timestamp into config/deploy_timestamp
timestamp = Time.now.to_i
File.open("config/deploy_timestamp", 'w') do |f|
f.write(timestamp)
end
@rrichards
rrichards / dnsd.rb
Created December 21, 2011 22:43 — forked from peterc/dnsd.rb
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@rrichards
rrichards / gist:1582970
Created January 9, 2012 13:37 — forked from markbirbeck/gist:1451167
Upgrade a Chef client
# Upgrade a Chef client using the steps described here:
#
# http://wiki.opscode.com/display/chef/Upgrading+Chef+0.9.x+to+Chef+0.10.x
#
# This script can be invoked with:
#
# ssh <server> 'curl https://raw.github.com/gist/1451167/<gist-guid>/gistfile1.sh | sh'
# Point to opscode repos:
#