Skip to content

Instantly share code, notes, and snippets.

View digitalextremist's full-sized avatar
🏴

//de digitalextremist

🏴
View GitHub Profile
@digitalextremist
digitalextremist / gist:9f6c9b556f0efefd0819
Created January 24, 2015 10:09
nio4r build failure @qrohlf gets on OSX 10.10
$ gem install nio4r -v '1.0.0'
ERROR: Error installing nio4r:
ERROR: Failed to build gem native extension.
/Users/qrohlf/.rbenv/versions/2.2.0/bin/ruby -r ./siteconf20150120-2702-11w6zzo.rb extconf.rb
checking for rb_thread_blocking_region()... no
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... no
checking for sys/event.h... yes
@digitalextremist
digitalextremist / mula.rb
Last active December 22, 2015 11:29
Futures interface silent death repro?
class Muile
include Celluloid
def router method, *args
puts "Called Muile.#{method}"
if respond_to? "#{method}!"
puts "Calling Muile.#{method}!"
send "#{method}!", *args
else
@digitalextremist
digitalextremist / http_parser.failure.log
Created May 28, 2013 06:18
http_parser.rb failing under rbx-head
NoMethodError: undefined method `request_path' on an instance of HTTP::Parser.
kernel/delta/kernel.rb:81:in `request_path (method_missing)'
/mu/penultimatix/reel/lib/reel/request_parser.rb:14:in `__script__'
/mu/penultimatix/reel/lib/reel/mixins.rb:51:in `path'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:135:in `env'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:95:in `request_env'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:74:in `handle_request'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:65:in `handle'
/usr/local/rvm/gems/rbx-head/bundler/gems/celluloid-594e63068e98/lib/celluloid/calls.rb:25:in `dispatch'
/usr/local/rvm/gems/rbx-head/bundler/gems/celluloid-594e63068e98/lib/celluloid/calls.rb:67:in `dispatch'
@digitalextremist
digitalextremist / aftermath.log
Created May 1, 2013 15:31
rubinius log from segv aftermath
root@two:~# cat /root/.rbx/rubinius_last_error_7339
Rubinius Crash Report #rbxcrashreport
Error: signal SIGSEGV
[[Backtrace]]
ruby[0x5904a0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7fdd3877acb0]
ruby(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x41eb)[0x5b5c5b]
ruby(_ZN8rubinius11MachineCode19execute_specializedINS_12TwoArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x2a5)[0x5ef465]
@digitalextremist
digitalextremist / all.subsequent.calls.log
Last active December 16, 2015 18:20
Aiming a browser at the websocket address ws://host/!sync?when=open is Reel::RackWorker genocide.
Reel::RackWorker crashed!
Celluloid::DeadActorError: attempted to call a dead actor
/usr/local/rvm/gems/rbx-head/bundler/gems/celluloid-594e63068e98/lib/celluloid/proxies/sync_proxy.rb:25:in `method_missing'
/usr/local/rvm/gems/rbx-head/bundler/gems/celluloid-594e63068e98/lib/celluloid/legacy.rb:14:in `call (method_missing)'
/usr/local/rvm/gems/rbx-head/gems/sinatra-1.3.6/lib/sinatra/base.rb:1417:in `call'
/usr/local/rvm/gems/rbx-head/gems/sinatra-1.3.6/lib/sinatra/base.rb:1499:in `synchronize'
/usr/local/rvm/gems/rbx-head/gems/sinatra-1.3.6/lib/sinatra/base.rb:1417:in `call'
/usr/local/rvm/gems/rbx-head/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
/usr/local/rvm/gems/rbx-head/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `call'
kernel/bootstrap/array.rb:68:in `each'
@digitalextremist
digitalextremist / mail-compile.error-trace-001.log
Last active December 16, 2015 18:19
Stack trace of failing compile for Mail gem under rbx-head with ubuntu 12.04LTS & up-to-date packages.
root@convergence:/home/mu/one# scripts/one-server.sh
root@convergence:/home/mu/one# I, [2013-04-28T02:34:19.541402 #15521] INFO -- : Reel 0.3.0
I, [2013-04-28T02:34:19.543178 #15521] INFO -- : Listening on 0.0.0.0:80
I, [2013-04-28T02:34:19.543395 #15521] INFO -- : Number of workers: 51
I, [2013-04-28T02:34:19.543590 #15521] INFO -- : Process ID saved to: tmp/01E.pid
I, [2013-04-28T02:34:19.543783 #15521] INFO -- : Process ID: 15521
E, [2013-04-28T02:34:23.033263 #15521] ERROR -- : Celluloid::PoolManager crashed!
Rubinius::CompileError: Error trying to compile /usr/local/rvm/gems/rbx-head/gems/mail-2.5.3/lib/mail/parsers/rfc2822_obsolete.rb
/usr/local/rvm/rubies/rbx-head/runtime/19/compiler/compiler.rbc:13:in `compiler_error'
/usr/local/rvm/rubies/rbx-head/runtime/19/compiler/compiler.rbc:92:in `compile'
@digitalextremist
digitalextremist / handler-class.rb
Created April 23, 2013 06:42
Partial ( somewhat messy )snippet of WebSocket support implemented in Reel using Rack hijack_io's pre-header form. Client side is using portal.js and jQuery Mobile. Mu is a base class of utilities (such as Mu.debug to output data to the console) and Mu.socket to manipulate the socket itself, once captured. Ma is an instance of Sinatra::Base with…
require 'forwardable'
require "websocket/protocol/hybi"
module ProtocolAlias
def << data
text data
end
end
class Mu
@digitalextremist
digitalextremist / spec.output.txt
Created April 22, 2013 23:19
http_parser.rb test failures
Failures:
1) HTTP::Parser should implement basic api
Failure/Error: Unable to find matching line from backtrace
Java::JavaLang::ClassCastException:
org.jruby.RubyNil cannot be cast to org.jruby.RubyString
# org.ruby_http_parser.RubyHttpParser$2.cb(RubyHttpParser.java:110)
# http_parser.lolevel.ParserSettings.call_on(ParserSettings.java:80)
# http_parser.lolevel.ParserSettings.call_on_url(ParserSettings.java:64)
# http_parser.lolevel.HTTPParser.execute(HTTPParser.java:697)
@digitalextremist
digitalextremist / rack-reel.rb
Last active December 16, 2015 10:59
Test case for http_parser.rb under jRuby. Multipart POST requests will either fail or be corrupt.
require 'rubygems'
require "bundler/setup"
MU_BASE = File.expand_path( File.dirname( __FILE__ ) )
MU_UPLOADS = "/mu/rack-reel/uploads/"
require 'rack'
require 'reel'
require 'sinatra'
require "sinatra/multi_route"
@digitalextremist
digitalextremist / concurrent_nested_hash.rb
Last active December 16, 2015 08:29 — forked from tarcieri/concurrent_nested_hash.rb
Oldie but a goodie, with more of the standard methods.
require 'celluloid'
class ConcurrentNestedHash
include Celluloid
def initialize( starting = {} ); @outer = starting end
def [](*keys); keys.inject(@outer) { |h,k| h[k] } end
def []=(*args)