Skip to content

Instantly share code, notes, and snippets.

View rke's full-sized avatar

Rainer Keller rke

  • driverwriter.com
  • Sacramento, CA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am rke on github.
  • I am rke (https://keybase.io/rke) on keybase.
  • I have a public key whose fingerprint is B01B 98F5 4C16 D6F2 19E8 3807 5BC0 E9AA 1558 FE51

To claim this, I am signing this object:

# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
#!/usr/bin/env ruby
#
# unicorn_reloader
#
# spawns a unicorn to serve a rack app in the given directory. Watches
# the app files for changes, restarting the unicorn worker when they're
# detected.
#
# Tony Strauss <tony at animoto.com>
# Forked in order to:
@rke
rke / Makefile
Created August 16, 2013 20:03 — forked from igalic/Makefile
root_DN = /CN=Esotericsystems Root Authority/C=AT/
issuing_DN = /CN=Esotericsystems Issuing Authority/C=AT/
passphrase:
echo -n changeme > $@
#
# Create param files, keys and Self-Signed Certificate for the Root CA
#
root-ca-dsa.param: passphrase
@rke
rke / afp.conf
Created February 26, 2013 01:19 — forked from beshkenadze/afp.conf
;
; Netatalk 3.x configuration file
; http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html
;
[Global]
; Global server settings
vol preset = default_for_all_vol
log file = /var/log/netatalk.log
uam list = uams_dhx.so,uams_dhx2.so

Install prerequisites:

$ sudo apt-get install build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev libcrack2-dev libwrap0-dev autotools-dev automake libtool libdb-dev libacl1-dev libdb5.1-dev db-util db5.1-util libgcrypt11 libgcrypt11-dev

Download src:

$ cd /usr/local/src
$ git clone git://netatalk.git.sourceforge.net/gitroot/netatalk/netatalk
$ cd netatalk

$ ./bootstrap

@rke
rke / devise_patch.rb
Created July 15, 2011 01:49
email change notification for devise based on https://github.com/Mandaryn's solution
module Devise
module Models
# This just allows valid_password to be called if encrypted_password is blank.
# The code exists in devise-1.3 and later, this just backports it to out 1.2.1
module DatabaseAuthenticatable
def valid_password?(password)
return false if self.encrypted_password.blank?
bcrypt = ::BCrypt::Password.new(self.encrypted_password)
password = ::BCrypt::Engine.hash_secret("#{password}#{self.class.pepper}", bcrypt.salt)
Devise.secure_compare(password, self.encrypted_password)