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
worker: QUEUE=* bundle exec rake environment resque:work | |
scheduler: bundle exec rake environment 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
# Unicorn tasks | |
namespace :unicorn do | |
def pid_path | |
"#{shared_path}/pids/unicorn.pid" | |
end | |
def socket_path | |
"#{shared_path}/sockets/unicorn.sock" | |
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
Replace the old Nginx binary (by default, /usr/local/nginx/sbin/nginx) with the new one. | |
Find the pid of the Nginx master process, for example, with ps x | grep nginx | grep master or by looking at the value found in the pid file. | |
Send a USR2 (12) signal to the master process kill USR2 ***, replacing *** with the pid found in step 2. This will initiate the upgrade by renaming the old .pid file and running the new binary. | |
Send a WINCH (28) signal to the old master process kill WINCH ***, replacing *** with the pid found in step 2. This will engage a graceful shutdown of the old worker processes. |
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
## other files ommited | |
config/deploy.rb | |
config/unicorn.rb | |
config/nginx.conf | |
config/unicorn_init.sh |
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
# Put that on config/environments/production.rb | |
config.assets.precompile << lambda do |path| | |
if path =~ /\.(css|js)\z/ | |
full_path = Rails.application.assets.resolve(path).to_path | |
app_assets_path = Rails.root.join('app', 'assets').to_path | |
return true if full_path.starts_with? app_assets_path | |
end | |
false | |
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
gem 'pg' | |
group :development do | |
gem 'ruby-debug' | |
end | |
gem 'rake', '~> 0.8.7' | |
gem 'devise' | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
gem 'omniauth' | |
gem 'haml' | |
gem 'dynamic_form' |
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
xinput list | |
xinput set-prop <ID DISPOSITIVO> "Device Enabled" 0 |
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 add-apt-repository ppa:chris-lea/redis-server | |
sudo apt-get update | |
sudo apt-get install redis-server |
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
vim() | |
{ | |
local STTYOPTS="$(stty --save)" | |
stty stop '' -ixoff | |
command vim "$@" | |
stty "$STTYOPTS" | |
} |