Skip to content

Instantly share code, notes, and snippets.

View wolfeidau's full-sized avatar
🐺
Building data science projects

Mark Wolfe wolfeidau

🐺
Building data science projects
View GitHub Profile
@wolfeidau
wolfeidau / gist:4523264
Created January 13, 2013 09:39
node-worker-farm output printing child information stopChild
$ node examples/pi/index.js
{ [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
Worker Farm: DTrace support loaded
worker-farm
createDTraceProvider worker-farm
Doing it the slow (single-process) way...
π ≈ 3.1417501760000017 (0.00015752241020861035 away from actual!)
took 6783 milliseconds
Doing it the fast (multi-process) way...
@wolfeidau
wolfeidau / config.js
Created January 27, 2013 22:26
Error handling..
var fs = require('fs')
, path = require('path')
, errors = require('./errors')
exports.load = function(handleResult, configPath){
var path = configPath || "./.swagman.json" // note the optional configuration path
fs.readFile(path, function (err, data) {
handleResult(err, data)
})
@wolfeidau
wolfeidau / gist:4735315
Last active December 12, 2015 07:18
Bamboo 4.4 error
$ git clone https://bitbucket.org/atlassian/bamboo-git-plugin.git
...
$ cd bamboo-git-plugin
$ atlas-mvn test
...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
@wolfeidau
wolfeidau / component.json
Created February 12, 2013 11:20
Bower configuration file.
{
"name": "fgis-core",
"main": [
"./public/css/style.css",
"./public/js/site.js"
],
"dependencies": {
"bootstrap": "~2.2.2",
"backbone": "~0.9.10",
@wolfeidau
wolfeidau / ruby2dtrace.md
Last active December 14, 2015 02:09
How to install ruby-2.0.0-p0 into rbenv with dtrace support

The aim of this post is to guide the reader through the process of installing ruby 2.0.0 into rbenv with dtrace probes enabled. As rbenv uses ruby-build, which currently downloads and compiles a copy of openssl rather than using the one maintained and updated in homebrew i prefer to use the homebrew one.

Note that you MUST install xcode before installing anything, then install homebrew, and lastly install openssl, via homebrew as follows.

brew install openssl

Next to overcome the fact that OSX doesn't have an openssl ca certificate bundle, use the following brew to create and maintain one using the CA certs stored in your keychain.

#!/bin/bash
BNAME=`basename $0`
# assert we are on ubuntu
LSB_DESC=`lsb_release -d`
if [[ $LSB_DESC =~ 'Ubuntu' ]]; then
echo "Check for OS detected Ubuntu"
@wolfeidau
wolfeidau / openssl.md
Last active December 14, 2015 03:48
Openssl hitting https://rubygems.org/

Running the version of openssl installed via homebrew.

$ /usr/local/Cellar/openssl/1.0.1e/bin/openssl s_client -connect rubygems.org:443
CONNECTED(00000003)
depth=1 C = US, O = "GeoTrust, Inc.", CN = RapidSSL CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
@wolfeidau
wolfeidau / results.md
Created March 8, 2013 13:27
Messing around with DTrace to tell me WTF node-gyp is doing on smartos
  1     11         exec_common:exec-success   /opt/local/gcc47/bin/g++ -shared -rdynamic -m64 -pthreads -Wl,-z,allextract -Wl
  2     11         exec_common:exec-success   /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.0/collect2 -G -dy -z te
  3     11         exec_common:exec-success   /usr/bin/ld -G -dy -z text -Y P,/lib/amd64:/usr/lib/amd64 -Qy -o Release/obj.ta
  3     11         exec_common:exec-success   /usr/bin/ld -G -dy -z text -Y P,/lib/amd64:/usr/lib/amd64 -Qy -o Release/obj.ta
  2     11         exec_common:exec-success   /bin/sh -c echo "  SOLINK_MODULE(target) Release/obj.target/leveldown.node: Fin
  2     11         exec_common:exec-success   /bin/sh -c echo "  SOLINK_MODULE(target) Release/obj.target/leveldown.node: Fin
  2     11         exec_common:exec-success   /bin/sh -c printf '%s\n' 'cmd_Release/obj.target/leveldown.node := ./gyp-sun-to
 2 11 exec_common:exec-success /bin/sh -c printf '%s\n' 'cmd_Release/obj.target/leveldown.node := ./gyp-sun-to
@wolfeidau
wolfeidau / gist:5120604
Last active December 14, 2015 17:09
comparison of .a files between node-ffi and node-leveldown.
[markw@8d27df39-18c7-4635-af06-3e6dc73dfa80 ~/node-ffi]$ find . -name *.a | xargs file
./build/Release/obj.target/deps/libffi/libffi.a: current ar archive, not a dynamic executable or shared object
./build/Release/libffi.a: current ar archive, not a dynamic executable or shared object
[markw@8d27df39-18c7-4635-af06-3e6dc73dfa80 ~/node-ffi]$ cd -
/home/markw/node-leveldown
[markw@8d27df39-18c7-4635-af06-3e6dc73dfa80 ~/node-leveldown]$ find . -name *.a | xargs file
./build/Release/obj.target/deps/snappy/snappy.a: data
./build/Release/obj.target/deps/leveldb/leveldb.a: data
[markw@8d27df39-18c7-4635-af06-3e6dc73dfa80 ~/node-leveldown]$
[markw@8d27df39-18c7-4635-af06-3e6dc73dfa80 ~/node-leveldown]$ cat ./build/Release/obj.target/deps/snappy/snappy.a
@wolfeidau
wolfeidau / gist:5121655
Last active December 14, 2015 17:19
node-gyp 0.9.0 testing
$ npm install
> [email protected] install /home/markw/node-leveldown
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Command failed: execvp(): No such file or directory
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:540:15)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)