Skip to content

Instantly share code, notes, and snippets.

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
View abstract.md

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
View 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
View README.md

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
View README.md

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
View hudson_custom_auth.rb
#!/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
View rvm_sugar.sh
#!/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
View macosx_10.6_bootstrap.sh
#!/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
View macvim_install.sh
#!/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
View moonshine_bootstrap.sh
#!/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 / maven_install.sh
Created November 17, 2010 19:26
Apache Maven Installer
View maven_install.sh
#!/usr/bin/env bash
# ## Installing Apache Maven
#
# bash < <(curl -L http://gist.github.com/raw/703892/maven_install.sh)
#
mavens=( 2.2.1 3.0.1 )
current="3.0.1"