$ cat /etc/apache2/sites-enabled/mms-test
Listen 50690
LogLevel debug
DumpIOInput On
# DumpIOOutput On
$ sudo tail -f /var/log/apache2/error.log | grep "mod_dumpio.c(74)" | sed "s/.*HEAP.: //"
require 'capistrano/recipes/deploy/strategy/copy' | |
set :application, "YOUR APPLICATION NAME" | |
set :location, "YOUR DOMAIN (e.g. myapp.com)" | |
set :repository, "YOUR SOURCE CONTROL REPOSITORY" | |
set :user, "THE USER ON YOUR SERVER THAT WILL BE DEPLOYING" | |
set :local_user, "LOCAL USER" | |
set :database_name, "YOUR DATABASE NAME" | |
set :scm, SET WHAT SOURCE CONTROL METHOD YOU USE |
require 'new_relic/recipes' | |
set :rails_env, RUBBER_ENV | |
on :load do | |
set :application, rubber_env.app_name | |
set :runner, rubber_env.app_user | |
set :deploy_to, "/mnt/#{application}-#{RUBBER_ENV}" | |
end |
$ cap deploy:cold | |
* executing `deploy:cold' | |
* executing `deploy:update' | |
** transaction: start | |
* executing `deploy:update_code' | |
executing locally: "git ls-remote git@mydomain.com:/home/git/myapp.git HEAD" | |
* executing "git clone -q git@mydomain.com:/home/git/myapp.git /var/www/myapp/releases/20100204223421 && cd /var/www/myapp/releases/20100204223421 && git checkout -q -b deploy 14dd2843341cd0984afb147050a02228ee7eae02 && (echo 14dd2843341cd0984afb147050a02228ee7eae02 > /var/www/myapp/releases/20100204223421/REVISION)" | |
servers: ["mydomain.com"] | |
[mydomain.com] executing command | |
command finished |
namespace :delayed_job do | |
desc "Start delayed_job process" | |
task :start, :roles => :app do | |
run "cd #{current_path}; RAILS_ENV=production script/delayed_job start" | |
end | |
desc "Stop delayed_job process" | |
task :stop, :roles => :app do | |
run "cd #{current_path}; RAILS_ENV=production script/delayed_job stop" | |
end |
#acts-as-taggable-on-2.0.0.rc1/lib/acts_as_taggable_on/acts_as_taggable_on/related.rb [RO] 64,3 | |
def related_tags_for(context, klass, options = {}) | |
tags_to_find = tags_on(context).collect { |t| t.name } | |
exclude_self = "#{klass.table_name}.id != #{id} AND" if self.class == klass | |
klass.scoped({ :select => "#{klass.table_name}.*, COUNT(#{Tag.table_name}.id) AS count", | |
:from => "#{klass.table_name}, #{Tag.table_name}, #{Tagging.table_name}", | |
:conditions => ["#{exclude_self} #{klass.table_name}.id = #{Tagging.table_name}.taggable_id AND #{Tagging.table_name}.taggable_type = '#{klass.to_s}' AND #{Tagging.table_name}.tag_id = #{Tag.table_name}.id AND #{Tag.table_name}.name IN (?)", tags_to_find], | |
:group => grouped_column_names_for(klass), |
New Developer Setup | |
READING | |
You can find the old wiki dump, of which some of these pages are based off of, attached as a pdf at the bottom of this page. | |
[new dev pages start around pg 170, additional tips at the end of the pdf... some info is outdated, so look here first] | |
The Pragmatic Programmers have a few solid books that are considered essential reading within the ruby community: | |
Programming Ruby 1.9 "The Pickaxe Book" (we aren't using 1.9 yet but moving our code from 1.8 to 1.9 is a priority) [ http://pragprog.com/titles/ruby3/programming-ruby-1-9 ] | |
Agile Web Dev w/ Rails 4.0 (in beta right now & covers Rails 3.0 exclusively, which we aren't on. The 3rd ed. is recommended for now.) |
# REQUIRED: The name of your application | |
app_name: streaming | |
# REQUIRED: The system user to run your app servers as | |
app_user: app | |
# REQUIRED: Notification emails (e.g. monit) get sent to this address | |
# | |
admin_email: mail@gmail.com |