Skip to content

Instantly share code, notes, and snippets.

@jondot
jondot / gist:3486823
Created August 27, 2012 09:09
gelf errors
Could not send message: send: name or service not known
org/jruby/ext/socket/RubyUDPSocket.java:317:in `send'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/ruby_sender.rb:16:in `send_datagrams'
org/jruby/RubyArray.java:1611:in `each'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/ruby_sender.rb:15:in `send_datagrams'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/notifier.rb:143:in `notify_with_level!'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/notifier.rb:118:in `notify!'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/log4r-gelf-0.9.0/lib/log4r-gelf/gelf_outputter.rb:99:in `canonical_log'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/log4r-1.1.10/lib/log4r/outputter/outputter.rb:130:in `synch'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/1
require 'sinatra'
require 'eventmachine'
require 'em-http-request'
require 'thin'
get '/' do
r = EventMachine::HttpRequest.new('http://google.com').get
r.callback do
Uncaught error in rebar_core: {'EXIT',
{undef,
[{rebar_app_utils,is_skipped_app,
["/home/jondot/.kerl/builds/r15b01/agner_R15B01/src/agner.app.src"],
[]},
{rebar_core,maybe_process_dir0,7,
[{file,"src/rebar_core.erl"},{line,161}]},
{rebar_core,process_dir,4,
[{file,"src/rebar_core.erl"},{line,128}]},
{rebar_core,process_commands,2,
[Mon, 23 Jul 2012 15:10:04 +0000] INFO: apt_repository[10gen] sending run action to execute[apt-get update] (immediate)
[Mon, 23 Jul 2012 15:10:04 +0000] INFO: Processing execute[apt-get update] action run (mongodb::10gen_repo line 28)
[Mon, 23 Jul 2012 15:10:08 +0000] INFO: execute[apt-get update] ran successfully
[Mon, 23 Jul 2012 15:10:08 +0000] INFO: Processing execute[install-key 7F0CEB10] action nothing (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/apt/providers/reposit
ory.rb line 23)
[Mon, 23 Jul 2012 15:10:08 +0000] INFO: Processing execute[apt-get update] action nothing (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/apt/providers/repository.rb
line 78)
[Mon, 23 Jul 2012 15:10:08 +0000] INFO: Processing file[/etc/apt/sources.list.d/10gen-source.list] action create (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/apt/
providers/repository.rb line 89)
[Mon, 23 Jul 2012 15:10:08 +0000] INFO: file[/etc/apt/sources.list.d/10gen-source.list] created file /etc/apt/sources.list.d/10gen-source.list
@jondot
jondot / gist:2950797
Created June 18, 2012 21:19
extract docs w/jruby
JARS = '/whatever/path/to/jars'
Dir["#{JARS}/*jar"].each {|j| require j}
require "java"
import org.apache.poi.extractor.ExtractorFactory
ex = ExtractorFactory.createExtractor(java.io.FileInputStream.new('pwnage.doc'))
puts ex.text
@jondot
jondot / gist:2553086
Created April 29, 2012 20:29
testing
mock(gs).update("journal-id", stamp, "testing 123") { stamp }
mock(gs).get("journal-id", stamp) { nil }
# act: implicitly does: get=>nil, then updates nil to "testing 123"
# assert: does get
# the assert 'get' should not return nil but the value "testing 123"
sudo apt-get install zsh curl wget git-core ncurses-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev apache2-utils
https://github.com/robbyrussell/oh-my-zsh
https://github.com/sstephenson/ruby-build
https://github.com/sstephenson/rbenv
rbenv install 1.9.3-p194 jruby-1.6.7
hg clone https://vim.googlecode.com/hg/ ~/vim
sudo apt-get build-dep vim
cd vim
@jondot
jondot / n-body.rb
Created April 21, 2012 17:18
n-body ruby/mruby
# The Computer Language Shootout
# http://shootout.alioth.debian.org
#
# Optimized for Ruby by Jesse Millikan
# From version ported by Michael Neumann from the C gcc version,
# which was written by Christoph Bauer.
#
unless 2.0.respond_to? :pow
class Float
def pow(num)
@jondot
jondot / gist:2283982
Created April 2, 2012 14:45 — forked from anativ/gist:2283953
gem files
source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'nokogiri' , '1.5.2'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
Caused by: org.jruby.exceptions.RaiseException: (LoadError) load error: yajl/yajl -- java.lang.UnsatisfiedLinkError: failed to load shim library, error: /var/lib/tomcat6/file:/var/lib/tomcat6/webapps/pablo/WEB-INF/lib/jruby-stdlib-1.6.7.jar!/META-INF/jruby.home/META-INF/jruby.homei386-Linux/libjruby-cext.so: cannot open shared object file: No such file or directory
Caused by: java.lang.UnsatisfiedLinkError: failed to load shim library, error: /var/lib/tomcat6/file:/var/lib/tomcat6/webapps/pablo/WEB-INF/lib/jruby-stdlib-1.6.7.jar!/META-INF/jruby.home/META-INF/jruby.homei386-Linux/libjruby-cext.so: cannot open shared object file: No such file or directory
at org.jruby.cext.Native.load(Native.java:95)
at org.jruby.cext.Native.getInstance(Native.java:66)
at org.jruby.cext.ModuleLoader.load(ModuleLoader.java:51)
at org.jruby.runtime.load.CExtension.load(CExtension.java:94)
at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:745)
at org.jruby.runtime.load.LoadService.smartLoad(Loa