Remotely:
sudo mkdir /var/www/dashboard.app
sudo chown -R deploy:deploy /var/www/dashboard.app/
Locally:
cap deploy:setup
sass_dir = ask("Where would you like to keep your sass files within your project? (default: 'app/stylesheets')") | |
sass_dir = "app/stylesheets" if sass_dir.blank? | |
css_dir = ask("Where would you like Compass to store your compiled css files? (default: 'public/stylesheets')") | |
css_dir = "public/stylesheets" if css_dir.blank? | |
compass_command = "compass --rails . --css-dir=#{css_dir} --sass-dir=#{sass_dir} " | |
file 'vendor/plugins/compass/init.rb', <<-CODE | |
# This is here to make sure that the right version of sass gets loaded (haml 2.2) by the compass requires. |
SSH_ENV=$HOME/.ssh/environment | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} | |
echo succeeded | |
chmod 600 ${SSH_ENV} | |
. ${SSH_ENV} > /dev/null | |
/usr/bin/ssh-add; | |
} |
require 'rubygems' | |
require 'money' | |
require 'yaml' | |
class Array | |
def total_hashes | |
self.inject({}) do |totals, hsh| | |
hsh.each { |key, value| (totals[key] = totals[key] ? value + totals[key] : value) unless %w(String Hash Array).include?(value.class.to_s) } if hsh.is_a?(Hash) | |
totals |
#!/usr/bin/env ruby | |
v = RUBY_VERSION.match(/^1\.9/) ? "18" : "19" | |
%w{ruby irb gem erb ri rdoc}.each do |c| | |
system "sudo ln -fs /usr/local/bin/#{c+v} /usr/local/bin/#{c}" | |
end | |
system "ruby --version" | |
# Notes on Deploying Rails with Passenger on Ubuntu 9.04 and ruby 1.9 | |
ssh root@0.0.0.0 | |
adduser deploy | |
adduser deploy sudo | |
visudo | |
# uncomment or add the line: %sudo ALL=NOPASSWD: ALL |
# $ tweet Hi mom! | |
# | |
# Put this in ~/.bashrc or wherever. | |
# If it doesn't work, make sure your ~/.netrc is right | |
# | |
# (Thanks to @anildigital for curl-fu) | |
function tweet { | |
curl -n -d status="$*" http://twitter.com/statuses/update.xml &> /dev/null | |
echo "tweet'd" |
# Bash snippet to open new shells in most recently visited dir. | |
# Useful if you want to open a new terminal tab at the present | |
# tab's location. | |
# | |
# Put this in your .bashrc or whatever. | |
pathed_cd () { | |
if [ "$1" == "" ]; then | |
cd | |
else |