Skip to content

Instantly share code, notes, and snippets.

@jtadeulopes
jtadeulopes / gist:7545569
Last active December 28, 2015 18:49
Banda Folk e Blues
* Jack Elliot
* Doc Watson
* Crosby Stills Nash and Young
* Seasick Steve
* Gillian Walsh
* Cowboy Junkie
* Otis Taylor
* Johnny Cash
* Neil Young
* Joni Mitchell
@jtadeulopes
jtadeulopes / server.md
Last active March 29, 2024 10:23
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@jtadeulopes
jtadeulopes / project.conf
Last active December 27, 2015 04:58
Monit conf
check file project-restart.txt with path /var/www/project/shared/project-restart.txt
if changed timestamp
then exec "/sbin/restart project"
@jtadeulopes
jtadeulopes / deploy.rb
Created November 1, 2013 13:58
Capistrano task for puma
namespace :puma do
desc "Start Puma"
task :start, :except => { :no_release => true } do
run "sudo start #{application}"
end
after "deploy:start", "puma:start"
desc "Stop Puma"
task :stop, :except => { :no_release => true } do
run "sudo stop #{application}"
@jtadeulopes
jtadeulopes / puma.rb
Last active November 22, 2017 09:48
Puma config
#!/usr/bin/env puma
threads 0, 4
# workers 3
bind "unix:///var/tmp/project.sock"
pidfile "/var/run/puma/project.pid"
environment "production"
stdout_redirect "/var/log/puma/project.log"
@jtadeulopes
jtadeulopes / project_puma.conf
Last active December 27, 2015 02:49
Puma conf for the project
threads 2,2
# conexão do tipo unix socket
# bind "unix:///var/tmp/project.sock"
# conexão do tipo TCP socket
# bind "tcp://0.0.0.0:5000"
pidfile "/var/run/puma/project.pid"
@jtadeulopes
jtadeulopes / project.conf
Last active December 20, 2018 05:42
Puma upstart
description "project server config"
pre-start script
mkdir -p /var/log/puma
chown deploy. /var/log/puma
mkdir -p /var/run/puma
chown deploy. /var/run/puma
end script
@jtadeulopes
jtadeulopes / Capfile
Last active January 8, 2018 16:36
Capfile
require 'bundler/capistrano'
load 'deploy'
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks
@jtadeulopes
jtadeulopes / deploy.rb
Last active November 22, 2017 09:48
Capistrano deploy.rb
set :repository, "git@bitbucket.org:repo/repo.git"
set :user, "deploy"
set :use_sudo, false
set :scm, :git
set :keep_releases, 5
set :domain, "000.000.000.000"
set :application, "my_app"
set :rails_env, "production"
set :branch, "master"
set :deploy_to, "/var/www/#{application}"