Skip to content

Instantly share code, notes, and snippets.

View martinisoft's full-sized avatar
🏠
Coding from home

Aaron Kalin martinisoft

🏠
Coding from home
View GitHub Profile
@martinisoft
martinisoft / openvz.rb
Created January 28, 2014 18:25
Crazy ohai plugin to re-write network address
provide "ipaddress"
require_plugin "#{os}::network"
require_plugin "#{os}::virtualization"
if virtualization["system"] == "openvz"
network["interfaces"]["venet0:0"]["addresses"].each do |ip, params|
if params["family"] == "inet"
ipaddress ip
end
end
@martinisoft
martinisoft / .powrc
Created October 21, 2013 15:30
rvm friendly powrc
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
@martinisoft
martinisoft / nokogiri_fix.md
Last active December 17, 2015 09:19
Fix the WARNING: Nokogiri was build against LibXML 2.7.8, but has dynamically loaded (insert version here) on Mountain Lion

The quick fix

Assuming you have homebrew installed and you use bundler, you can fix this issue by doing the following:

gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
brew uninstall libxslt
brew install libxml2 --with-xml2-config
@martinisoft
martinisoft / caveatPatchor.js
Last active December 15, 2015 16:49
My (current) Propane hacks via caveatPatchor.js
/**
Sample Propane caveatPatchor.js file based on tmm1's avatar hack.
You'll need at least version 1.1.1 to experiment with this:
http://propaneapp.com/appcast/Propane.1.1.1.zip
Once I'm sure exposing this hack-injection point doesn't cause problems
I'll do an official auto-updating version.
As of version 1.1.1, Propane will load and execute the contents of
@martinisoft
martinisoft / pidcheck.sh
Created January 7, 2013 21:33
Pidcheck script
#!/usr/bin/env bash
function is_process_alive {
set +e
if [ -n $1 ] && kill -0 $1 >/dev/null 2>&1; then
echo "yes"
fi
set -e
}
@martinisoft
martinisoft / stack_trace
Created January 4, 2013 22:26
Stack trace when running Cucumber against jRuby 1.7.2
$ rake
Parser.java:184:in `<init>': java.lang.NullPointerException: uri
from Parser.java:69:in `pushMachine'
from Parser.java:56:in `parse'
from NativeMethodAccessorImpl.java:-2:in `invoke0'
from NativeMethodAccessorImpl.java:39:in `invoke'
from DelegatingMethodAccessorImpl.java:25:in `invoke'
from Method.java:597:in `invoke'
from JavaMethod.java:485:in `invokeDirectWithExceptionHandling'
from JavaMethod.java:340:in `invokeDirect'
@martinisoft
martinisoft / error.txt
Created October 9, 2012 19:15
cucumber suite error
$ rake clean spec cucumber --trace
** Invoke clean (first_time)
** Execute clean
rm -r pkg
rm -r tmp
rm -r ext
rm -r java/target
rm -r doc
rm -r /Users/martinisoft/projects/gherkin/tasks/../ragel/i18n/ar.java.rl
rm -r /Users/martinisoft/projects/gherkin/tasks/../ragel/i18n/lexer_common.ar.rl
@martinisoft
martinisoft / ohai_network.json
Created September 3, 2012 05:52
ohai network output
[
[
"interfaces",
{
"lo": {
"mtu": "16436",
"flags": [
"LOOPBACK",
"UP",
"LOWER_UP"
@martinisoft
martinisoft / play-next.coffee
Created March 23, 2012 21:40
Play-Next Hubot Script
# Play music. At your office. Like a boss.
#
# NOTE:
# This uses the new version of play (the next branch currently)
# https://github.com/holman/play/tree/next
#
# Make sure you set up your HUBOT_PLAY_URL environment variable with the URL to
# your company's play.
#
# Controls
@martinisoft
martinisoft / fix-nokogiri.md
Last active October 1, 2015 23:48
Nokogiri working install with latest XCode or you get "WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.7.8"

Homebrew has blacklisted libiconv so the majority of your help via google will not work now.
Here's a way I figured out how to get nokogiri to compile if you made the mistake of upgrading your XCode version

  1. Install packages via homebrew
brew update
brew install libxml2
brew install libxslt