Skip to content

Instantly share code, notes, and snippets.

@wmene
wmene / gist:1880099
Created February 22, 2012 00:14
Cap recipe to create an rvm gemset before deploy
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, "1.8.7@#{application}" # Or whatever env you want it to run in.
# Make sure the gemset exists before running deploy:setup
def disable_rvm_shell(&block)
old_shell = self[:default_shell]
self[:default_shell] = nil
yield
self[:default_shell] = old_shell
@wmene
wmene / gist:1980535
Created March 5, 2012 19:34
assembly modules
module Dor
module Itemizable
attr_accessor :cm
def persist_content_md
...
end
end
-----------------------------------------------------------------------
CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo
Crystal Dew World : http://crystalmark.info/
-----------------------------------------------------------------------
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]
Sequential Read : 18.372 MB/s
Sequential Write : 13.057 MB/s
Random Read 512KB : 18.703 MB/s
Random Write 512KB : 8.554 MB/s
@wmene
wmene / gist:5518730
Created May 4, 2013 21:08
Apache Santuario implementation of W3C XML Encryption http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#aes128-cbc. AES 128 CBC with the iv prepended to the cipher text, then base64 encoded. From org/apache/xml/security/encryption/XMLCipher.java encryptData method
// Now build up to a properly XML Encryption encoded octet stream
// IvParameterSpec iv;
byte[] iv = c.getIV();
byte[] finalEncryptedBytes = new byte[iv.length + encryptedBytes.length];
System.arraycopy(iv, 0, finalEncryptedBytes, 0, iv.length);
System.arraycopy(encryptedBytes, 0, finalEncryptedBytes, iv.length, encryptedBytes.length);
String base64EncodedEncryptedOctets = Base64.encode(finalEncryptedBytes);
@wmene
wmene / rvm-1.8.7-debug.txt
Created May 8, 2013 17:59
Trying to install ruby 1.8.7 with rvm, 64-bit version, but no success
sul-wmene-mac:~ wmene$ rvm remove 1.8.7
Removing /Users/wmene/.rvm/src/ruby-1.8.7-p371...
Removing /Users/wmene/.rvm/rubies/ruby-1.8.7-p371...
Removing ruby-1.8.7-p371 aliases...
Removing ruby-1.8.7-p371 wrappers...
Removing ruby-1.8.7-p371 environments...
Removing ruby-1.8.7-p371 binaries...
sul-wmene-mac:~ wmene$ rvm install 1.8.7 --debug
1.8.7 - install
Searching for binary rubies, this might take some time.
@wmene
wmene / gist:5542281
Created May 8, 2013 18:04
rvm install 1.8.7 --64 --debug
sul-wmene-mac:~ wmene$ rvm install 1.8.7 --64 --debug
1.8.7 - install
__rvm_setup_compile_environment_setup ruby-1.8.7-p371
rvm_autolibs_flag=enable
__rvm_setup_compile_environment_requirements ruby-1.8.7-p371
Installing requirements for osx, might require sudo password.
requirements code for osx loaded
brew seems to be writable
Found required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libxml2, libxslt, libksba, openssl, sqlite.
Error: No such file or directory - /usr/local/Cellar/htop-osx
@wmene
wmene / gist:5542323
Created May 8, 2013 18:08
rvm 1.8.7 do rvm config-get --all
sul-wmene-mac:~ wmene$ rvm 1.8.7 do rvm config-get --all
ALLOCA:
AR: ar
ARCHFILE:
ARCH_FLAG:
AS: as
ASFLAGS:
CC: /usr/local/bin/gcc-4.2
CCDLFLAGS: -fno-common
CFLAGS: -O3 -I/usr/local/Cellar/libyaml/0.1.4/include -I/usr/local/opt/readline/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/libxslt/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common
@wmene
wmene / gist:5542346
Created May 8, 2013 18:12
patch.apply.osx-arch-fix.log
sul-wmene-mac:~ wmene$ cat /Users/wmene/.rvm/log/ruby-1.8.7-p371/1368036184_patch.apply.osx-arch-fix.log
[2013-05-08 11:03:04] patch
current path: /Users/wmene/.rvm/src/ruby-1.8.7-p371
command(8): patch -F 25 -p1 -N -f -i /Users/wmene/.rvm/patches/ruby/1.8.7/osx-arch-fix.patch
patching file Makefile.in
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 3966 | 1177K| 5188 |
| 1 | SORT ORDER BY | | 3966 | 1177K| 5188 |
| 2 | HASH JOIN | | 3966 | 1177K| 4927 |
| 3 | INLIST ITERATOR | | | | |
| 4 | INDEX RANGE SCAN | IDX$$_095F0001 | 4105 | 236K| 245 |
| 5 | HASH JOIN | | 3900 | 933K| 4681 |
| 6 | INLIST ITERATOR | | | | |
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 478 | 94644 | 1530 |
| 1 | SORT ORDER BY | | 478 | 94644 | 1530 |
| 2 | HASH JOIN | | 478 | 94644 | 1529 |
| 3 | HASH JOIN | | 403 | 55614 | 877 |
| 4 | TABLE ACCESS BY INDEX ROWID | WORKFLOW | 345 | 26910 | 285 |
| 5 | BITMAP CONVERSION TO ROWIDS | | | | |
| 6 | BITMAP AND | | | | |