Skip to content

Instantly share code, notes, and snippets.

View akitaonrails's full-sized avatar

Fabio Akita akitaonrails

View GitHub Profile
@jnunemaker
jnunemaker / fu.md
Created July 12, 2011 23:20
FUN BUG?!

Posted to the REE Google Group as well: https://groups.google.com/forum/#!topic/emm-ruby/EBkMfFpk40A

A week back I innocently updated Sinatra on an app which in turn updated Rack. Since then, I've had crazy hung passenger processes that just gobble up CPU like it is going out of style.

After spending a few days trying everything I knew to to fix it, today I got help from a friend (Eric Lindvall) and dug in with strace, rbtrace, gdb, and gdb.rb and found the issue. Rack 1.3.0 tests a regex against a URL and it causes things to hang.

@akitaonrails
akitaonrails / build_oniguruma_ios.sh
Created April 19, 2011 16:37
Build Oniguruma as a fat binary for iOS and the simulator
#!/bin/bash
# This script will compile a oniguruma static lib for the device and simulator
cd onig
# Compile a version for the device...
CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar ./configure --disable-shared --host=arm-apple-darwin --disable-cpp CFLAGS="-arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk"
@JonRowe
JonRowe / Gemfile
Created January 26, 2010 14:10
Gemfile to allow bundling Merb 1.0.15 via Bundler... read symlink instructions...
# This Gemfile is a cheat
# It allows bundling via bundler using Merb 1.0.15
# To use this you *MUST* symlink gems/gems to gems/ruby/1.8/gems etc.
# I recommend symlinking gems/gems gems/cache gems/specification gems/doc just to be sure
bundle_path "gems"
bin_path "bin"
def self.dependency(*args)
gem(*args)
# This will ride alongside god and kill any rogue memory-greedy
# processes. Their sacrifice is for the greater good.
unicorn_worker_memory_limit = 300_000
Thread.new do
loop do
begin
# unicorn workers
#