Skip to content

Instantly share code, notes, and snippets.

View belinskidima's full-sized avatar

Belinski Dima belinskidima

  • Chisinau, Republic of Moldova
View GitHub Profile
source src1
{
type = mysql
#####################################################################
## SQL settings (for 'mysql' and 'pgsql' types)
#####################################################################
# some straightforward parameters for SQL source types
sql_host = localhost
kill -9 $(lsof -i tcp:3000 -t)
> eval $(ssh-agent)
> ssh-add
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
### Unicorn ###
check process unicorn
with pidfile "/home/deploy/goodpolitics/shared/tmp/pids/unicorn.pid"
start program = "/bin/su - deploy -c 'cd /home/deploy/goodpolitics/current && ( export RAILS_ENV='production'; /usr/local/rvm/bin/rvm default do bundle exec unicorn -c /home/deploy/goodpolitics/current/config/unicorn/production.rb -E deployment -D )"
stop program = "/bin/su - deploy -c 'cd /home/deploy/goodpolitics/current && /usr/bin/env kill -s QUIT`cat /home/deploy/goodpolitics/current/tmp/pids/unicorn.pid`'"
if memory usage > 90% for 3 cycles then restart
if cpu > 90% for 2 cycles then restart
if 5 restarts within 5 cycles then timeout
worker_processes 1;
events {
worker_connections 1024;
}
http {
#passenger_root /home/airwall/.rvm/gems/ruby-2.3.1/gems/passenger-5.0.30;
#passenger_ruby /home/airwall/.rvm/gems/ruby-2.3.1/wrappers/ruby;
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.hostname = 'rails-dev-box'
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
nginx -t -c /etc/nginx/nginx.conf
user www-data;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
heroku buildpacks:add heroku/ruby
heroku buildpacks:add heroku/nodejs
// useful
@mixin cut-text {
overflow: hidden;
white-space: nowrap;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
}
@mixin ibreset {
border: 0;