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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: bluepill | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: bluepill daemon, providing process monitoring | |
# Description: bluepill is a monitoring tool. More info at http://github.com/arya/bluepill. |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: bluepill | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: bluepill daemon, providing process monitoring | |
# Description: bluepill is a monitoring tool. More info at http://github.com/arya/bluepill. |
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
# script/setup/rvm.rb to install | |
default: &default | |
name: 1.9.3-perf | |
patch: falcon # about this patch: https://gist.github.com/1688857 | |
gemset: my_app_gemset | |
env: | |
RUBY_HEAP_MIN_SLOTS: 1600000 | |
RUBY_GC_MALLOC_LIMIT: 100000000 | |
RUBY_HEAP_FREE_MIN: 500000 |
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 -*- | |
#= Rainbows HTTP server (on unix socket!) | |
#== Rainbows can be used to manage multiple forked workers in a specified concurrency-IO model | |
# Set working directory for Capistrano | |
# pwd -L keeps symlinks | |
working_directory `pwd -L`.chomp | |
# Listen through a unix socket |
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
# = Here is how to export to upstart: | |
# sudo foreman export upstart /etc/init -f Procfile.production -u my_app_user -a my_app | |
# sudo find /etc/init/ -name "my_app*.conf" -exec sed -i 's/releases\/[0-9]*/current/g' {} \; | |
web: subcontract --rvm --with-rubies . do -- env RAILS_ENV=production bundle exec rainbows -c config/rainbows.production.rb | |
worker: subcontract --rvm --with-rubies . RAILS_ENV=production bundle exec rake resque:work QUEUE=* | |
scheduler: subcontract --rvm --with-rubies . RAILS_ENV=production bundle exec rake resque:scheduler |
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
namespace :deploy do | |
task :restart_web, role: :web do | |
pid_path = "#{current_path}/tmp/pids/server.pid" | |
run "[[ -s #{pid_path} ]] && (cat #{pid_path} | xargs kill -USR2) || sudo service jl-web start", shell: 'bash' | |
end | |
end |
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 -*- | |
module UrlSubdomain | |
def subdomain!(sub = 'account') | |
# Some day this hack won't be necessary | |
# (when Capybara, Rspec, and Rails learn to work together) | |
# For now it only works if we run it twice | |
# I do not know why, and it would be a waste of time to find out | |
2.times do | |
sub = 'account' if sub.blank? | |
host = "#{sub}.#{DOMAIN}" |
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
17917 redis 20 0 2310m 1.6g 424 D 5 41.3 0:00.61 /usr/bin/redis-server /etc/redis/redis.conf | |
11790 redis 20 0 2310m 1.5g 928 S 0 39.7 0:10.39 /usr/bin/redis-server /etc/redis/redis.conf |
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 'haml/helpers/action_view_mods' # if you use haml, you have to require its mods first | |
require 'action_view/helpers/cache_helper' | |
module ActionView | |
module Helpers | |
module CacheHelper | |
def cache_if(condition, *args, &block) | |
if @dont_cache || !condition | |
# Disable cache usage for all `cache` calls within a false condition cache_if block | |
disable_caching { yield } | |
else |
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
ActionView::Template::Error (closed stream): | |
5: else | |
6: url = create_item_path | |
7: text = I18n.t("common.post_free_ad") | |
8: end | |
9: %a.post-free-ad{href: url} | |
10: %span.icons.icon-myposts | |
11: %span.icon-text= text | |
java/lang/Thread.java:1567:in `getStackTrace' | |
org/jruby/runtime/backtrace/TraceType.java:171:in `getBacktraceData' |