Skip to content

Instantly share code, notes, and snippets.

View spritle's full-sized avatar

Spritle Software spritle

View GitHub Profile
@spritle
spritle / delayed_job.rb
Last active August 29, 2015 14:17 — forked from german/gist:1237902
# run with: god -c /path/to/config.god [add -D if you want to not-deamonize god]
# This is the actual config file used to keep the delayed_job running
APPLICATION_ROOT = "/var/www/application"
RAILS_ENV = "production"
God.watch do |w|
w.name = "delayed_job_production"
w.interval = 15.seconds
w.start = "/bin/bash -c 'cd #{APPLICATION_ROOT}/current; /usr/bin/env RAILS_ENV=#{RAILS_ENV} #{APPLICATION_ROOT}/current/script/delayed_job start > /tmp/delay_job.out'"
@spritle
spritle / Install_tmux
Created February 24, 2014 12:26 — forked from simme/Install_tmux
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/

Setting up Ruby, Rails, Nginx, Passenger, PostgreSQL 9 on Ubuntu 12.04 LTS for Windows Azure

Last updated: 12/31/2013

Fix the locale issue

  • Edit /etc/default/locale as sudo.
  • Append LC_ALL="en_US.UTF-8" at the end of the file, save and quit.
  • sudo locale-gen en_US en_US.UTF-8
  • sudo dpkg-reconfigure locales

Install the necessary packages to install rbenv and build Ruby

#!/usr/bin/env ruby
# Mails a file using GMail's SMTP Server.
# For illustrative purposes; error checking and testing intentionally omitted for brevity.
#
# Requirements:
# 1) the 'mail' gem must be installed
# 2) a file named 'pw.txt' containing the Google password must be present
# in the current directory.
#
# Ruby versions: tested on 1.9.3, 1.8.7, JRuby
# for more info: https://gist.github.com/1120938
download open ssl for windows: http://www.openssl.org/source/
Reference :
http://www.neilstuff.com/apache/apache2-ssl-windows.htm (for installation)
http://www.napcsweb.com/howto/rails/deployment/RailsWithApacheAndMongrel.pdf (for httpd.conf and ssl.conf & proxy fix)
Sample openssl confi (required to create key file)
@spritle
spritle / gist:1042243
Created June 23, 2011 09:35 — forked from otype/gist:137347
Memcached in Ruby
require 'rubygems'
require 'memcache'
class Memcaching
def initialize
@cache = MemCache.new 'localhost:11211', :namespace => 'goofingaroundwithmemcached'
end
def load_key_into_memcache(key,value)