Skip to content

Instantly share code, notes, and snippets.

View markottaviani's full-sized avatar

Mark Ottaviani markottaviani

View GitHub Profile
@markottaviani
markottaviani / monit.conf
Created October 9, 2014 03:39
monit conig for unicorn (broken)
check process unicorn
with pidfile /var/www/RescueRails_staging/current/tmp/pids/unicorn.pid
start program = "/etc/init.d/unicorn_RescueRails_staging start"
as uid deploy and gid deploy
stop program = "/etc/init.d/unicorn_RescueRails_staging stop"
as uid deploy and gid deploy
if mem is greater than 300.0 MB for 1 cycles then restart # eating up memory?
if cpu is greater than 50% for 2 cycles then alert # send an email to admin
if cpu is greater than 80% for 30 cycles then restart # hung process?
group unicorn
add_column :users, :has_own_cats
#Our radio button to fill out the answer in new or edit views
<div class="control-group">
<%= f.label :has_own_cats, "Do you have your own cats?", :class => "control-label" %>
<div class="controls">
<label>
@markottaviani
markottaviani / unicorn.rb
Created February 12, 2013 02:48
unicorn config
# This file has been generated from unicorn_template.rb.erb which is greatly inspired from:
# https://github.com/ricodigo/ricodigo-capistrano-recipes/blob/master/generators/unicorn.rb.erb
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
# Local variables
old_pid = '/var/www/rescuerails/shared/pids/unicorn.pid.old'
# Unicorn setup
@markottaviani
markottaviani / nginx
Created February 12, 2013 02:28
nginx init.d
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $network $remote_fs $local_fs
# Required-Stop: $network $remote_fs $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Stop/start nginx
### END INIT INFO
@markottaviani
markottaviani / unicorn.rb
Created December 5, 2011 13:24 — forked from rchampourlier/unicorn.rb
Postgresql fixed template for unicorn.rb to use with Capistrano deployment recipe
# This file has been generated from unicorn_template.rb.erb which is greatly inspired from:
# https://github.com/ricodigo/ricodigo-capistrano-recipes/blob/master/generators/unicorn.rb.erb
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
# Local variables
old_pid = '<%= unicorn_pid + ".old" %>'
# Unicorn setup