Skip to content

Instantly share code, notes, and snippets.

View fnichol's full-sized avatar

Fletcher Nichol fnichol

View GitHub Profile
@fnichol
fnichol / abstract.md
Created April 9, 2014 14:56
ChefConf 2014 Talk: Test Kitchen: One Year Later and the Future

Test Kitchen: One Year Later and the Future

Where

ChefConf 2014 in San Francisco

When

Wednesday, April 16, 2014 at 14:20 (Ballroom A in Future Chef track)

@fnichol
fnichol / git-buildstep
Created September 5, 2014 17:41
Git Buildstep
#!/usr/bin/env bash
set -e
banner() { echo "-----> $*"; }
warn() { echo ">>>>>> $*"; }
DOCKER="${DOCKER:-docker}"
REF=HEAD
while [[ $# -gt 0 ]] ; do
@fnichol
fnichol / README.md
Last active August 29, 2015 14:15
Benchmarking Remote CMD and Powershell Invocations with WinRM in Test Kitchen

Benchmarking Remote CMD and Powershell Invocations with WinRM in Test Kitchen

Notes

  • The executor in the code is a CommandExecutor which sets up and reuses a remote shell session across calls and recyles it before the maxiumum commands-per-shell limit is reached.
  • The vanilla object is a regular WinRM::WinRMWebService instance which sets up and tears down a shell for every CMD and Powershell script invocation.
  • The Powershell script variant is really running a powershell -encodedCommand <ENCODED_SCRIPT> over CMD.
  • The file appending operation isn't very taxing on the Windows host but simulates a chunked file upload and so tries to measure the relative cost of command invocations vs. measuring the time for the commands to execute.

Observations

@fnichol
fnichol / README.md
Last active August 29, 2015 14:20
Upgrade Test Kitchen to 1.4.0 in an existing ChefDK installation

If you're using ChefDK and find you can't wait for the next release to come out (which will out be shortly), you might want to give the chefdk-update-app project a spin to update test-kitchen (follow the setup instructions in the README).

Upgrade test-kitchen

Upgrade test-kitchen with the following for Unix-based workstations:

sudo -E ./bin/chefdk-update-app.sh test-kitchen -r v1.4.0
@fnichol
fnichol / hudson_custom_auth.rb
Created June 19, 2010 02:04
Quick-and-dirty LDAP/local fallback auth for hudson
#!/usr/bin/env ruby
require "rubygems"
require "net/ldap"
require "csv"
unless ARGV[0] && ARGV[1]
puts "Usage: #{__FILE__} <username> <password>"
abort
end
@fnichol
fnichol / rvm_sugar.sh
Created August 14, 2010 18:02
Some RVM install time sugar
#!/usr/bin/env bash
# ## Installing RVM as a User
#
# bash < <( curl -s https://rvm.beginrescueend.com/install/rvm )
# bash < <( curl -L http://bit.ly/rvm_sugar )
# [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
#
# ## Installing RVM System Wide (become the root user)
#
@fnichol
fnichol / macosx_10.6_bootstrap.sh
Created September 5, 2010 16:15
Mac OS X 10.6 Bootstrapping
#!/bin/bash
#
# Mac OS X 10.6 Bootstrapping
# turn on ssh
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
# run software update and reboot
sudo softwareupdate --install --all
sudo shutdown -r now
@fnichol
fnichol / macvim_install.sh
Created September 12, 2010 15:46
MacVIM installer
#!/usr/bin/env bash
# ## Installing MacVim on Mac OS X 10.5/10.6
#
# bash < <(curl -L http://gist.github.com/raw/576195/macvim_install.sh)
#
case $(sw_vers -productVersion) in
10.5.*)
url="http://github.com/downloads/b4winckler/macvim/MacVim-7_3-53-ppc-i386-OSX10_5.tbz"
@fnichol
fnichol / moonshine_bootstrap.sh
Created October 16, 2010 04:13
Get yer rails user in shape
#!/usr/bin/env bash
# install:
# bash < <(curl -L http://gist.github.com/raw/629402/moonshine_bootstrap.sh)
#
printf "===> Bootstrapping moonshine user: ${user} ...\n"
user=rails
@fnichol
fnichol / README.md
Created January 3, 2011 16:20
Sample chef-solo config for vagrant prototyping