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 / 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:

require "minitest/autorun"
require "minitest/pride"
require "mixlib/shellout"
def exec_with_env(cmd, user="root")
home_dir = etc_user(user).dir
opts = {
:user => user,
:group => etc_user(user).gid,
:cwd => home_dir,
2015-01-23_18:43:49.70216 Fri, 23 Jan 2015 18:43:49 | INFO | 10374 | configuration | parsing | route | 'community' '[' '0' ']' ';'
2015-01-23_18:43:49.70251 Traceback (most recent call last):
2015-01-23_18:43:49.70266 File "/usr/local/bin/exabgp", line 11, in <module>
2015-01-23_18:43:49.70284 sys.exit(run_exabgp())
2015-01-23_18:43:49.70302 File "/usr/local/lib/python2.7/dist-packages/exabgp/application/__init__.py", line 11, in run_exabgp
2015-01-23_18:43:49.70319 main()
2015-01-23_18:43:49.70333 File "/usr/local/lib/python2.7/dist-packages/exabgp/application/bgp.py", line 215, in main
2015-01-23_18:43:49.70352 run(env,comment,configurations)
2015-01-23_18:43:49.70367 File "/usr/local/lib/python2.7/dist-packages/exabgp/application/bgp.py", line 253, in run
2015-01-23_18:43:49.70383 Reactor(configurations).run()
@martinisoft
martinisoft / kick_safari.sh
Created November 12, 2009 05:47
kick Safari when you edit html files for instant previews
kicker -e "osascript -e 'tell application \"Safari\" to do JavaScript \"window.location.reload();\" in first document'" index.html
require "pty"
require "expect"
STDOUT.sync = true
STDERR.sync = true
$expect_verbose = true
prompt_pat = %r/^[\s]{1}/
PTY.spawn("/home/martinisoft/srcds/orangebox/srcds_run -game tf +ip 192.168.1.8 +maxplayers 8 +map ctf_2fort") do |output, input, pid|
input.sync = true