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
after "deploy:create_symlink", "resque:restart_workers" | |
after "resque:restart_workers", "resque:restart_scheduler" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') |
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 :setup_solr, roles: :app do | |
run "mkdir -p #{shared_path}/solr/data" | |
put File.read('config/sunspot.yml'), "#{shared_path}/config/sunspot.yml" | |
end | |
end | |
namespace :solr do | |
def solr_config |
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
/* Foca no código! | |
.---. | |
/o o\ | |
__(= " =)__ | |
//\'-=-'/\\ | |
) (_ | |
/ `"=-._ | |
/ \ ``"=. |
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
#!/usr/bin/env ruby | |
require 'openssl' | |
class Blowfish | |
def self.key | |
Rails.application.secrets.secret_key_base | |
end | |
def self.encrypt(decrypted_string, salt=nil) |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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/bash | |
export rvm_path=/home/ubuntu/.rvm; | |
. $rvm_path/scripts/rvm; | |
eval "su - ubuntu -c 'cd #{absolute_path_to_rails_app_root}; RAILS_ENV=production bundle exec $@'" |
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
password="#{database_password}" | |
database_name="#{database_name}" | |
file_name=Dump_${database_name}_$(date +%d%m%Y_%H%M) | |
mkdir -p ~/backups && cd ~/backups | |
mysqldump -u root -p$password $database_name > $file_name.sql | |
tar czfv $file_name.tar.gz $file_name.sql | |
rm $file_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
upstream unicorn { | |
server unix:#{path_to_rails_app_current_root}/tmp/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server #{application.domain.name}; | |
keepalive_timeout 300; | |
client_max_body_size 4G; |
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
httpd.monitrc | |
set httpd port 2815 and | |
allow #{client_ip} | |
allow admin:#{password} | |
mail.monitrc | |
set mailserver smtp.gmail.com port 587 username "#{smtp_user}" password "#{smtp_passw}" using tlsv1 |
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
## | |
# Regra para inicializar o Monit como um daemon (processo background), e o tempo em segundos, de um ciclo de monitoramento. | |
# | |
set daemon 60 # check services at 1-minute intervals | |
## | |
# Regra para definir o caminho do arquivo de log do monit | |
# | |
set logfile /var/log/monit.log | |
OlderNewer