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 --ruby-version --create use 2.1.0@swapper_scraper |
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
brew update | |
brew install node | |
npm install -g yo | |
npm install -g generator-webapp | |
npm install -g generator-backbone | |
#If you are creating the app | |
mkdir appname && cd $_ | |
yo backbone --template-framework=handlebars appname |
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
sudo mdutil -a -i off | |
sudo mdutil -a -i on |
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
#CPU | |
# http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html | |
sudo apt-get install sysstat | |
mpstat | |
mpstat -P ALL | |
# Memory | |
# http://superuser.com/questions/398862/linux-find-out-what-process-is-using-all-the-ram | |
# Passenger |
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 | |
pg_dump -U db_user -h localhost -xcO db_name | bzip2 - - > db/db_name.sql.bz2 | |
# Restore | |
# Delete database then recreate then | |
bunzip2 -f db/db_name.sql.bz2 | |
psql -U db_user -h localhost db_name < db/db_name.sql |
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
# Upgrade RVM | |
rvm get stable | |
# Get latest Ruby | |
rvm install 2.1.0 | |
# Create and use gemset | |
mkdir project | |
cd project | |
rvm --ruby-version --create use 2.1.0@swapper_scraper |
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
string.gsub(/\"(\d+)\/(\d+)\/(\d+)\"/, "\"$3-$2-$1\"") |
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
# | |
# = Capistrano database.yml task | |
# | |
# Provides a couple of tasks for creating the database.yml | |
# configuration file dynamically when deploy:setup is run. | |
# | |
# Category:: Capistrano | |
# Package:: Database | |
# Author:: Simone Carletti <[email protected]> | |
# Copyright:: 2007-2010 The Authors |
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
set :monit_app_services, %w(delayed_job) | |
namespace :delayed_job do | |
desc "Restart the delayed_job process" | |
task :restart, :roles => :app do | |
sudo "RAILS_ENV=#{default_stage} #{current_path}/script/delayed_job restart" | |
end | |
end | |
namespace :monit 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
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.clear_active_connections! |