Skip to content

Instantly share code, notes, and snippets.

View martinisoft's full-sized avatar
🍎
Makin' Cider & Writing Code

Aaron Kalin martinisoft

🍎
Makin' Cider & Writing Code
View GitHub Profile
@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 / 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 / .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 / 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 / cookbook_release.txt
Created March 31, 2014 10:11
Cookbook release problem
% knife cookbook site share rvm Other -o '/var/folders/h5/dynhzgcj3v76k_yk8lmnbg3r0000gn/T/d20140331-72712-f91u32' -V
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
Generating metadata for rvm from /var/folders/h5/dynhzgcj3v76k_yk8lmnbg3r0000gn/T/chef-rvm-build20140331-72941-1krbyxg/rvm/metadata.rb
Making tarball rvm.tgz
ERROR: Error uploading cookbook rvm to the Opscode Cookbook Site: wrong number of arguments (2 for 1). Set log level to debug (-l debug) for more information.
@martinisoft
martinisoft / squee.coffee
Created April 19, 2014 01:16
Squee! Script for Hubot
# Description:
# Need a little cuteness in your life? YES YOU DO!
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@martinisoft
martinisoft / default.bats
Last active August 29, 2015 14:01
Bats test
#!/usr/bin/env bats
@test "has kept Chef version at 11.10.0" {
/opt/chef/bin/chef-client --version | grep '^Chef: 11.10.0$'
# This also does not work
# sudo -E -u $SUDO_USER bash -l -c "chef-client --version | grep '^Chef: 11.10.0$'"
}
@martinisoft
martinisoft / recipe.rb
Last active August 29, 2015 14:04
Ugly Chef hackery
# The problem: I've got to swap the apt mirror out (idempotently) and update apt
# BEFORE build-essential triggers at compile time. Hence the run_action trick
# to force the resource to trigger at compile time, not run time.
#
# Why? Old Ubuntu release apt mirrors get retired to old-releases.ubuntu.com
if node['platform_version'].to_f == 13.04
execute "swap in old release mirror" do
user 'root'
command "/bin/sed -i -e 's#http:\/\/.*.ubuntu.com#http:\/\/old-releases.ubuntu.com#g' /etc/apt/sources.list && apt-get update"
@martinisoft
martinisoft / brew_backtrace.txt
Last active August 29, 2015 14:07
Ruby environment weirdness
martinisoft@r2d2 chef-rvm [master] % brew {1}
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_resolver.rb:490:in `resolve_for': unable to find any gem matching dependency 'foodcritic (~> 3.0.3)' (Gem::UnsatisfiableDepedencyError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_resolver.rb:286:in `resolve'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/request_set.rb:39:in `resolve'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/request_set.rb:47:in `resolve_current'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:244:in `detect_gemdeps'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:1109:in `<top (required)>'
from <internal:gem_prelude>:1:in `require'
from <i
@martinisoft
martinisoft / keybase.md
Created October 4, 2014 21:19
keybase identity

Keybase proof

I hereby claim:

  • I am martinisoft on github.
  • I am martinisoft (https://keybase.io/martinisoft) on keybase.
  • I have a public key whose fingerprint is 21EB 7E5D 7D50 78AE DFF6 9255 802F 8BFB 0AA8 6D93

To claim this, I am signing this object: