This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To install ruby 1.9.2 from source quickly just run: | |
sudo curl https://raw.github.com/gist/2467938/c420a710e78164e4b9443faba8b5e0dd4e5eac16/ubuntu-ruby-192-install | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Taken from "Ten Things You Didn't Know Rails Could Do by James Edward Gray" | |
# http://www.youtube.com/watch?v=GRfJ9lni4QA | |
# | |
require 'csv' | |
namespace :users do | |
desc "Import users from a CSV file" | |
task :import => :environment do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm uninstall ruby-1.9.3-p194 | |
rvm pkg install openssl | |
rvm install ruby-1.9.3-p194 --with-openssl-dir=~/.rvm/usr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadModule passenger_module /home/passenger/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/ext/apache2/mod_passenger.so | |
PassengerRoot /home/passenger/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19 | |
PassengerRuby /home/passenger/.rvm/wrappers/ruby-1.9.3-p392/ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if namespaced? -%> | |
require_dependency "<%= namespaced_file_path %>/application_controller" | |
<% end -%> | |
<% module_namespacing do -%> | |
class <%= controller_class_name %>Controller < ApplicationController | |
include ActiveModel::ForbiddenAttributesProtection | |
before_filter :find_user, :only => [:show, :edit, :update, :destroy] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rvm/capistrano' | |
require 'bundler/capistrano' | |
require 'capistrano/ext/multistage' | |
load 'deploy/assets' | |
set :stages, ["staging", "production"] | |
set :default_stage, "production" | |
set :user, '?' | |
set :admin_runner, '?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backup::Model.new(:app_name_backup, 'Backup for App Name') do | |
database MySQL do |database| | |
database.name = 'app_name_production' | |
database.username = 'app_name' | |
database.password = 'password!' | |
end | |
#database PostgreSQL do |database| | |
# database.name = 'app_name_production' | |
# database.username = 'app_name' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
namespace :rails do | |
desc "Remote console" | |
task :console, :roles => :app do | |
run_interactively "bundle exec rails console #{rails_env}" | |
end | |
desc "Remote dbconsole" | |
task :dbconsole, :roles => :app do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh user@host 'echo '`cat ~/.ssh/id_rsa.pub`' >> ~/.ssh/authorized_keys' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all processes of type for a user | |
pgrep -u <user> <process name> | |
# Example: | |
pgrep -u app_user ruby | |
# Kill all processes of type for a user | |
killall -u <user> <process name> |
OlderNewer