Skip to content

Instantly share code, notes, and snippets.

@markjreed
markjreed / rakudo-osx-utf8
Last active December 31, 2015 06:39
Attempting to use UTF-8 characters in perl6 -e code on Mavericks
$ perl6 -v
This is perl6 version 2013.11 built on parrot 5.9.0 revision 0
$ uname -v
Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64
$ perl6 -e 'say $*VM<config><has_icu>'
1
$ export | grep UTF
declare -x LANG="en_US.UTF-8"
declare -x LC_ALL="en_US.UTF-8"
$ perl6 -e 'say ("A".."C")>>xx>>2' # Texan works
@markjreed
markjreed / gist:5543724
Last active December 17, 2015 03:29
Output from attempted omnibus build
$ bundle exec omnibus build project MYPROJECT
...
[builder:ncurses] building ncurses
[builder:ncurses] Executing: `./configure --prefix=/opt/MYPROJECT/embedded --with-shared --with-termlib --without-debug --enable-overwrite --enable-widec` with cwd=/var/cache/omnibus/src/ncurses-5.9,timeout=5400,env="LD_RUN_PATH=/opt/MYPROJECT/embedded/lib CFLAGS=-L/opt/MYPROJECT/embedded/lib -I/opt/MYPROJECT/embedded/include LDFLAGS=-R/opt/MYPROJECT/embedded/lib -L/opt/MYPROJECT/embedded/lib"
[builder:ncurses] ./configure command failed, 0.10139385s
[builder:ncurses] Failed to execute cmd ["./configure --prefix=/opt/MYPROJECT/embedded --with-shared --with-termlib --without-debug --enable-overwrite --enable-widec", {:cwd=>"/var/cache/omnibus/src/ncurses-5.9", :timeout=>5400, :env=>{"LD_RUN_PATH"=>"/opt/MYPROJECT/embedded/lib", "CFLAGS"=>"-L/opt/MYPROJECT/embedded/lib -I/opt/MYPROJECT/embedded/include", "LDFLAGS"=>"-R/opt/MYPROJECT/embedded/lib -L/opt/MYPROJECT/embedded/lib"}}] 1 time(s). Retrying in 5s
^C
$ cd /var/cache/omni
@markjreed
markjreed / warble.rb
Created December 6, 2011 21:46
warble.rb showing problem
Warbler::Config.new do |config|
config.dirs = %w(webapp lib config)
config.staging_dir = 'war'
config.webxml.booter = :rack
config.webxml.rackup.path = 'WEB-INF/webapp/api.ru'
config.java_libs += FileList['../../drools/drools-api-5.1.1.jar']
end
from file:/var/lib/tomcat6/webapps/slurp/WEB-INF/lib/jruby-rack-1.0.10.jar!/vendor/rack-1.3.2/rack/request.rb:306:in `parse_multipart'
from file:/var/lib/tomcat6/webapps/slurp/WEB-INF/lib/jruby-rack-1.0.10.jar!/vendor/rack-1.3.2/rack/request.rb:182:in `POST'
from file:/var/lib/tomcat6/webapps/slurp/WEB-INF/lib/jruby-rack-1.0.10.jar!/vendor/rack-1.3.2/rack/request.rb:202:in `params'
from /var/lib/tomcat6/webapps/slurp/WEB-INF/gems/gems/sinatra-1.3.1/lib/sinatra/base.rb:701:in `call!'
from /var/lib/tomcat6/webapps/slurp/WEB-INF/gems/gems/sinatra-1.3.1/lib/sinatra/base.rb:692:in `call'
from /var/lib/tomcat6/webapps/slurp/WEB-INF/gems/gems/rack-protection-1.1.4/lib/rack/protection/xss_header.rb:22:in `call'
from /var/lib/tomcat6/webapps/slurp/WEB-INF/gems/gems/rack-protection-1.1.4/lib/rack/protection/path_traversal.rb:16:in `call'
from /var/lib/tomcat6/webapps/slurp/WEB-INF/gems/gems/rack-protection-1.1.4/lib/rack/protection/json_csrf.rb:17:in `call'
The script, stripped to its bare essentials, is basically a stand-in for the 'pry' executable:
$ cat mypry
#!/usr/bin/env ruby
require 'rubygems'
require 'pry'
binding.pry
When run directly, it works beautifully.
This file has been truncated, but you can view the full file.
merb : chef-server (api) : worker (port 4000) ~ Starting Thin at port 4000
merb : chef-server (api) : worker (port 4000) ~ Using Thin adapter on host 0.0.0.0 and port 4000.
merb : chef-server (api) : worker (port 4000) ~ Successfully bound to port 4000
merb : chef-server (api) : worker (port 4000) ~ Changing privileges to chef:chef
merb : chef-server (api) : worker (port 4000) ~ Starting Thin at port 4000
merb : chef-server (api) : worker (port 4000) ~ Using Thin adapter on host 0.0.0.0 and port 4000.
merb : chef-server (api) : worker (port 4000) ~ Successfully bound to port 4000
merb : chef-server (api) : worker (port 4000) ~ Changing privileges to chef:chef
merb : chef-server (api) : worker (port 4000) ~ Started request handling: Tue May 31 16:42:15 -0400 2011
merb : chef-server (api) : worker (port 4000) ~ Params: {"inflated_object"=>#<Chef::WebUIUser:0x7f5e894c9408 @name="admin", @couchdb_id=nil, @openid=nil, @couchdb_rev=nil, @admin=true, @salt="Tue May 31 16:42:15 -0400 2011vQyo02VZxRkLZeTvn0uDOm46niCat