Skip to content

Instantly share code, notes, and snippets.

% jruby -v -X-CIR -S rails new ir_app
jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-10-21 1557a3f) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_02-ea) [linux-amd64-java]
/home/nahi/git/jruby/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/util.rb:158 warning: `*' interpreted as argument prefix
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
% gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.11
- RUBY VERSION: 1.9.3 (2011-10-11 patchlevel -1) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
% cat bar.rb
require 'httpclient'
a = HTTPClient.new
a.debug_dev = STDERR
a.get('https://junecloud.com/sync/deliveries/')
sleep 10
a.get('https://junecloud.com/sync/deliveries/')
% ruby -v
ruby 1.9.4dev (2011-10-04 trunk 33399) [x86_64-linux]
% ruby -d bar.rb
% cat foo.rb
require 'stringio'
require 'zlib'
Zlib::GzipWriter.wrap(StringIO.new) { |io| io.write(""); io.mtime = nil }
% DeflaterOutputStream.java:93:in `write': java.lang.IndexOutOfBoundsException
from RubyZlib.java:3650:in `write'
from MethodHandle.java:566:in `invokeWithArguments'
from InvocationLinker.java:111:in `invocationFallback'
from -e:1:in `block_0$RUBY$__file__'
from ruby$__dash_e__$block_0$RUBY$__file__:65535:in `call'

From the standpoint of OSSL (Ruby’s OpenSSL binding), 1.9.3 is a small release; bug fixes, performance improvements, official OpenSSL 1.0.0 support and a few API enhancements. We had a new digital time-stamp and ASN.1 Template(DSL) implementation presented by Martin Boßlet, but we could not merge those bleeding-edge new features into 1.9.3, since there's no Ruby developer who can review it. It was quite obvious for us to ask him to be a maintainer of OSSL, as an expert in crypto and network security.

Since then, he helped us to clean up lots of OSSL issues piled on our issue tracker, by fixing SEGV bugs, consulting with users, and tailoring the build system to fit OpenSSL versions/variants. Though he discreetly didn’t merge his new feature implementations into 1.9.3, it seems clear that you can utilize those at the next release.

OSSL is the best language binding implementation of OpenSSL in the way of offering most OpenSSL features through an easy API with some help from Ruby. Without Martin Boßlet's help,

@nahi
nahi / gist:1236749
Created September 23, 2011 04:35
Tak (method dispatching benchmark) got really faster from b08
With Stock JRuby master: jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-09-22 f71d633) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_02-ea) [linux-amd64-java]
% JAVA_HOME=/home/nahi/java/jdk1.7.0 jruby bench/bench_tak.rb 5
user system total real
1.428000 0.000000 1.428000 ( 1.386000)
1.073000 0.000000 1.073000 ( 1.073000)
1.089000 0.000000 1.089000 ( 1.089000)
1.081000 0.000000 1.081000 ( 1.081000)
1.084000 0.000000 1.084000 ( 1.084000)
% JAVA_HOME=/home/nahi/java/jdk1.7.0_b07 jruby bench/bench_tak.rb 5
@nahi
nahi / 098r
Created September 17, 2011 04:28
% ruby -v eric_sess.rb
ruby 1.9.4dev (2011-09-16 trunk 33284) [x86_64-linux]
/usr/local/lib/ruby/1.9.1/openssl/ssl.rb:164: warning: using default DH parameters.
new session
/usr/local/lib/ruby/1.9.1/openssl/ssl.rb:164: warning: using default DH parameters.
not reused
reused
reused
client:
@nahi
nahi / _
Created September 14, 2011 02:18
Untrusted CA certs in Windows with MSA2607712: http://technet.microsoft.com/en-us/security/advisory/2607712
% ls DigiNotarCertsMSA2607712/*.cer
DigiNotarCertsMSA2607712/DigiNotarCyberCA1.cer
DigiNotarCertsMSA2607712/DigiNotarCyberCA2.cer
DigiNotarCertsMSA2607712/DigiNotarCyberCA3.cer
DigiNotarCertsMSA2607712/DigiNotarPKIoverheidCAOrganisatieG2.cer
DigiNotarCertsMSA2607712/DigiNotarPKIoverheidCAOverheid.cer
DigiNotarCertsMSA2607712/DigiNotarPKIoverheidCAOverheidenBadrijven.cer
DigiNotarCertsMSA2607712/DigiNotarRootCA1.cer
DigiNotarCertsMSA2607712/DigiNotarRootCA2.cer
DigiNotarCertsMSA2607712/DigiNotarRootCA3.cer
Sep 13, 2011 8:04:49 PM jenkins.model.Jenkins$6 onTaskFailed
SEVERE: Failed Inspecting plugin /home/nahi/git/jenkins-prototype-ruby-plugin/work/plugins/ruby-prototype.hpl
hudson.util.IOException2: Failed to load /home/nahi/git/jenkins-prototype-ruby-plugin/work/plugins/ruby-prototype.hpl
at hudson.ClassicPluginStrategy.createPluginWrapper(ClassicPluginStrategy.java:100)
at hudson.PluginManager$1$3$1.run(PluginManager.java:187)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:797)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
anifest-Version: 1.0
Created-By: 0.1.2
Build-Ruby-Platform: java
Build-Ruby-Version: 1.8.7
Group-Id: org.jenkins-ci.plugins
Short-Name: ruby-prototype
Long-Name: ruby-prototype
Url: http://jenkins-ci.org/
Plugin-Class: ruby.RubyPlugin
Plugin-Version: 0.1.0