This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/bin/siege -c 2000 http://a.b.c.d:9000/ | |
** SIEGE 3.0.8 | |
** Preparing 2000 concurrent users for battle. | |
The server is now under siege...*** buffer overflow detected ***: /usr/local/bin/siege terminated | |
======= Backtrace: ========= | |
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f059b2cbe67] | |
/lib/x86_64-linux-gnu/libc.so.6(+0x109d60)[0x7f059b2cad60] | |
/lib/x86_64-linux-gnu/libc.so.6(+0x10ae1e)[0x7f059b2cbe1e] | |
/usr/local/bin/siege[0x410e20] | |
/usr/local/bin/siege[0x405ad4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* connections: n_w = NUM_WRITERS, n_p = NUM_PARSERS, "<" = connect, "o" = bind | |
* | |
* controller | |
* | | |
* PIPE | |
* PUSH PULL | PUSH PULL | |
* subscriber o----------> parser(n_p) <-------------o request_writer(n_w) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" | |
/Users/skaes/src/ruby/lib/drb/ssl.rb:79:in `public_key': OpenSSL::PKey::RSAError | |
from /Users/skaes/src/ruby/lib/drb/ssl.rb:79:in `setup_certificate' | |
from /Users/skaes/src/ruby/lib/drb/ssl.rb:148:in `open_server' | |
from /Users/skaes/src/ruby/lib/drb/drb.rb:759:in `block in open_server' | |
from /Users/skaes/src/ruby/lib/drb/drb.rb:757:in `each' | |
from /Users/skaes/src/ruby/lib/drb/drb.rb:757:in `open_server' | |
from /Users/skaes/src/ruby/lib/drb/drb.rb:1342:in `initialize' | |
from /Users/skaes/src/ruby/test/drb/test_drbssl.rb:33:in `new' | |
from /Users/skaes/src/ruby/test/drb/test_drbssl.rb:33:in `<class:DRbSSLService>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bunny' | |
# Chris Doherty, confused by Bunny::Queue#subscribe semantics. | |
# run with `ruby bunny_test.rb load` followed by `ruby bunny_test.rb consume`. | |
class BunnyTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle install | |
Fetching git://github.com/skaes/logjam_logger.git | |
remote: Counting objects: 53, done. | |
remote: Compressing objects: 100% (53/53), done. | |
remote: Total 53 (delta 23), reused 0 (delta 0) | |
Receiving objects: 100% (53/53), 7.32 KiB, done. | |
Resolving deltas: 100% (23/23), done. | |
Fetching source index for http://rubygems.org/ | |
/Users/stefan.kaes/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb:502:in `update_display': undefined method `tty?' for nil:NilClass (NoMethodError) | |
from /Users/stefan.kaes/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb:478:in `fetch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fix a bug in rack (more a brainfuck actually) | |
config.to_prepare do | |
::Rack::Utils::HeaderHash.class_eval <<-_EVA_ | |
def [](k) | |
super(@names[k] || @names[k.downcase]) | |
end | |
_EVA_ | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# try to fix broken string encodings. most of the time the string is latin-1 encoded | |
if RUBY_VERSION >= "1.9" | |
def safe_h(s) | |
h(s) | |
rescue ArgumentError | |
raise unless $!.to_s == "invalid byte sequence in UTF-8" | |
logger.debug "#{$!} during html escaping".upcase | |
begin | |
h(s.force_encoding('ISO-8859-1').encode('UTF-8', :undef => :replace)) | |
rescue ArgumentError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mongo' | |
require 'benchmark' | |
conn = Mongo::Connection.new | |
db = conn.db("mydb") | |
coll = db["test"] | |
# time = Benchmark.realtime do | |
# 1_000_000.times do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
process=$1 | |
commands=`mktemp -t gdb.XXXXXXXXXX` | |
cat > $commands << '_EOF_' | |
if during_gc == 1 | |
x/s "cannot backtrace during gc" | |
else | |
set $stack = (VALUE)backtrace(-1) | |
set $count = (int)rb_fix2int(rb_ary_length($stack)) | |
set $index = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'benchmark' | |
require 'uuid4r' | |
require 'uuidtools' | |
log = false | |
iterations = (ARGV.shift || 1_000_000).to_i | |
puts "# of iterations = #{iterations}" |