Skip to content

Instantly share code, notes, and snippets.

View thotmx's full-sized avatar

Hermes Ojeda Ruiz thotmx

  • México
View GitHub Profile
@thotmx
thotmx / vim_short.md
Last active January 23, 2016 21:44 — forked from apux/1_vim_short.md
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Agregar estas líneas al archivo ~/.vimrc

execute pathogen#infect()
set nocompatible
@thotmx
thotmx / gist:7945354
Last active December 31, 2015 06:09
Entorno para Desarrollo en Ruby en Ubuntu 13.10
Instalación del entorno de Ruby en Ubuntu 13.10
Instalación de Ruby de acuerdo a http://rvm.io:
```
\curl -sSL https://get.rvm.io | bash -s stable
```
En las preferencias de la consola de gnome, agregar que cuando se active la consola sea como login (conexión) y se abre una nueva terminal.
@thotmx
thotmx / monit_aplicacion
Last active August 10, 2019 15:23
Monit: Restart unicorn automatically
check process unicorn-<<aplicacion>>
with pidfile /home/deployer/apps/<<aplicacion>>/current/tmp/pids/unicorn.pid
start program = "/etc/init.d/unicorn_blog start"
stop program = "/etc/init.d/unicorn_blog stop"
restart program = "/etc/init.d/unicorn_blog stop && /etc/init.d/unicorn_blog start"
group unicorn-blog
check file blog-restart with path /home/deployer/apps/<<aplicacion>>/current/tmp/restart.txt
if changed timestamp
then exec "/usr/bin/monit -g unicorn-blog restart"
@thotmx
thotmx / deploy.rb
Last active August 29, 2015 14:01
config/deploy.rb
set :application, 'prueba'
set :scm, "git"
set :repo_url, "git@github.com:LogicalBricks/prueba.git"
set :deploy_to, "/home/deployer/apps/#{fetch(:application)}"
set :ssh_options, {
forward_agent: true
}
set :log_level, :debug
@thotmx
thotmx / production.rb
Last active August 29, 2015 14:01
config/deploy/production.rb
set :stage, :production
role :app, %w{deployer@162.243.71.34}
role :web, %w{deployer@162.243.71.34}
role :db, %w{deployer@162.243.71.34}
server '162.243.71.34', user: 'deployer', roles: %w{web app db}
set :branch, ENV["REVISION"] || ENV["BRANCH_NAME"] || "master"
@thotmx
thotmx / staging.rb
Last active August 29, 2015 14:01
config/deploy/staging.rb
set :stage, :staging
set :rails_env, 'production'
set :deploy_to, "/home/deployerdemo/apps/#{fetch(:application)}"
role :app, %w{deployerdemo@162.243.105.100}
role :web, %w{deployerdemo@162.243.105.100}
role :db, %w{deployerdemo@162.243.105.100}
server '162.243.105.100', user: 'deployerdemo', roles: %w{web app db}
@thotmx
thotmx / nginx.conf
Last active August 29, 2015 14:01
nginx.conf
upstream unicorn {
server unix:/tmp/unicorn.<<aplicacion>>.sock fail_timeout=0;
}
server {
listen 80 default deferred;
# server_name example.com;
root /home/deployer/apps/<<aplicacion>>/current/public;
location ^~ /assets/ {
@thotmx
thotmx / unicorn.rb
Last active August 29, 2015 14:01
config/unicorn.rb
root = "/home/deployer/apps/<<aplicacion>>/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
listen "/tmp/unicorn.<<aplicacion>>.sock"
worker_processes 2
timeout 30
@thotmx
thotmx / unicorn_aplicacion
Created May 16, 2014 21:38
unicorn_aplicacion
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/deployer/apps/<<aplicacion>>/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
AS_USER=deployer
set -u
@thotmx
thotmx / Upgrade Rbenv
Last active August 29, 2015 14:11
Upgrade Rbenv
$ cd ~/.rbenv/plugins/ruby-build/
$ git pull
$ cd .rbenv
$ git pull
$ rbenv install <ruby-version>