Skip to content

Instantly share code, notes, and snippets.

View unakatsuo's full-sized avatar

Masahiro Fujiwara unakatsuo

View GitHub Profile
# Ubuntu upstart file at /etc/init/mongodb.conf
start on runlevel [2345]
stop on runlevel [06]
exec /usr/local/mongodb/bin/mongod --config /usr/local/mongodb/mongod.conf
@unakatsuo
unakatsuo / gist:462692
Created July 3, 2010 16:49
Rails forward action
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
protected
#
def forward_action(action_name)
Digest::SHA1.hexdigest(`/sbin/ip route get 8.8.8.8`.split("\n")[0].split.last)
#!/usr/bin/ruby
require 'rubygems'
require 'mq'
EM.run {
amq = MQ.new
amq.topic('evp-started')
amq.topic('evp-stopped')