Skip to content

Instantly share code, notes, and snippets.

View dlozano's full-sized avatar
🛶
I may be slow to respond.

David Lozano dlozano

🛶
I may be slow to respond.
View GitHub Profile
@kesor
kesor / an upstart unicorn.conf
Last active February 9, 2022 09:20
Unicorn that receives USR2 signal on upstart's "stop unicorn", but also allows upstart to respawn it when for some reason it crashed on its own.
# unicorn
description "unicorn ruby app server"
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345])
stop on runlevel [!2345]
env WORKDIR=/data
env PIDFILE=/data/tmp/pids/unicorn.pid
env CFGFILE=/data/config/unicorn.rb
@beltrachi
beltrachi / settings_extension.rb
Last active December 11, 2015 22:49
An Ubiquo Extension to reload settings every x seconds. Very useful when you want changes to be forwarded to workers or other rails instances.
# Extension that automatically reloads settings after some seconds, to allow
# web interface update settings changes after Rails loading.
module UbiquoExtensions
module SettingsExtension
def self.included(base)
base.class_eval do
class << self
include ClassMethods
cattr_accessor :last_reload_at
cattr_accessor :cache_time