Skip to content

Instantly share code, notes, and snippets.

View joefitzgerald's full-sized avatar

Joe Fitzgerald joefitzgerald

View GitHub Profile
@joefitzgerald
joefitzgerald / Berksfile
Last active December 21, 2015 04:59
Windows Berksfile
site :opscode
cookbook 'windows', github: 'joefitzgerald/windows'
cookbook '7-zip'
cookbook 'chocolatey', github: 'chocolatey/chocolatey-cookbook'
cookbook 'webpi', github: 'opscode-cookbooks/webpi'
cookbook 'dotnetframework', github: 'joefitzgerald/dotnetframework'
cookbook 'sqlce'
cookbook 'visualstudio', github: 'joefitzgerald/visualstudio'
cookbook 'chocolatey-installer', github: 'joefitzgerald/chocolatey-installer'
@joefitzgerald
joefitzgerald / Vagrantfile
Last active July 6, 2018 12:33
Windows Vagrantfile - Installs .NET 4.5, VS 2012, VS 2012 Update 3, then a bunch of utilities, then syspreps the machine. Get https://github.com/joefitzgerald/packer-windows for the base box and add it with the name "windows2008r2".
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "vagrant-windows"
config.vm.box = "windows2008r2"
# You should be using the vagrant-windows Vagrant Plugin!
# Admin user name and password
config.winrm.username = "Administrator"
@joefitzgerald
joefitzgerald / sysprep-and-seal.ps1
Created August 17, 2013 00:19
Sysprep And Remove Vagrant User
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "SysprepAndSeal" -ErrorAction SilentlyContinue
$ObjUser = [ADSI]"WinNT://localhost/vagrant";
$ObjUser.userflags = 2;
$ObjUser.setinfo();
C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /quiet /shutdown
@joefitzgerald
joefitzgerald / gist:7914669
Created December 11, 2013 17:22
Cygwin/OpenSSH sshd.conf
# $OpenBSD: sshd_config,v 1.89 2013/02/06 00:20:42 dtucker Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/bin:/usr/sbin:/sbin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
@joefitzgerald
joefitzgerald / win-updates.ps1
Created December 31, 2013 23:18
Install All Windows Updates, Rebooting As Many Times As Required
param($global:RestartRequired=0,
$global:MoreUpdates=0,
$global:MaxCycles=10)
function Check-ContinueRestartOrEnd() {
$RegistryKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
$RegistryEntry = "InstallWindowsUpdates"
switch ($global:RestartRequired) {
0 {
$prop = (Get-ItemProperty $RegistryKey).$RegistryEntry
@joefitzgerald
joefitzgerald / crash.log
Created February 2, 2014 00:11
Packer Crash Log
2014/01/31 13:57:39 Packer Version: 0.5.1 eeefde8fc71444fdfc77711dc0e2789fa9b3b7d2
2014/01/31 13:57:39 Packer Target OS/Arch: darwin amd64
2014/01/31 13:57:39 Built with Go Version: go1.2
2014/01/31 13:57:39 Detected home directory from env var: /Users/jenkins
2014/01/31 13:57:39 Attempting to open config file: /Users/jenkins/.packerconfig
2014/01/31 13:57:39 File doesn't exist, but doesn't need to. Ignoring.
2014/01/31 13:57:39 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot digitalocean:packer-builder-digitalocean qemu:packer-builder-qemu virtualbox-iso:packer-builder-virtualbox-iso virtualbox-ovf:packer-builder-virtualbox-ovf vmware-vmx:packer-builder-vmware-vmx amazon-instance:packer-builder-amazon-instance docker:packer-builder-docker googlecompute:packer-builder-googlecompute openstack:packer-builder-openstack vmware-iso:packer-builder-vmware-iso] Commands:map[build:packer-command-build fix:packer-command-fix
@joefitzgerald
joefitzgerald / prerequisites.sh
Last active March 29, 2017 17:25
Tech Summit Pre-Requisites Checker
#!/bin/bash --login
set -o nounset
export EXPECTED_RUBY_VERSION="1.9.3"
export EXPECTED_RBENV_RUBY_VERSION="1.9.3-p545"
logError () {
logCustom 1 "ERROR: $1"
@joefitzgerald
joefitzgerald / gist:67eeac2aeef293981a9c
Created July 12, 2014 14:48
Atom Install Error - Alpha 2
c:\projects\go-plus>cinst -debug atom -f
DEBUG: Running 'Append-InstallLog' with chocoInstallLog:''
DEBUG: Arguments: $command =
'install'|$packageNames='atom'|$source=''|$version=''|$allVersions=False|$InstallArguments=''|$overrideArguments=False|
$force=True|$prerelease=False|$localonly=False|$verbosity=False|$debug=True|$quiet=False|$name=''|$ignoreDependencies=F
alse|$forceX86=False|$packageParameters=''|PowerShellVersion=4.0
DEBUG: Running 'Chocolatey-Install' for 'atom' with source: '', version: '', installerArguments:''
DEBUG: Running 'Chocolatey-NuGet' for atom with source:''. Force? True
Chocolatey (v0.9.8.26-alpha2) is installing 'atom' and dependencies. By installing you accept the license for 'atom' and
each dependency you are installing.
c:\projects\go-plus>cinst -debug atom -f
20140712-08:17:07 [DEBUG] Running 'Append-InstallLog' with chocoInstallLog:''
20140712-08:17:07 [CHOCO] ################################################################################
20140712-08:17:07 [CHOCO] # Going Chocolatey on 2014-07-12 08:17:07Z #
20140712-08:17:07 [CHOCO] ################################################################################
20140712-08:17:07 [DEBUG] Arguments: $command = 'install'|$packageNames='atom'|$source=''|$version=''|$allVersions=False|$InstallArguments=''|$overrideArguments=False|$force=True|$prerelease=False|$localonly=False|$verbosity=False|$debug=True|$quiet=False|$name=''|$ignoreDependencies=False|$forceX86=False|$packageParameters=''|PowerShellVersion=4.0
20140712-08:17:07 [DEBUG] Running 'Chocolatey-Install' for 'atom' with source: '', version: '', installerArguments:''
20140712-08:17:07 [DEBUG] Running 'Chocolatey-NuGet' for atom with source:''. Force? True
20140712-08:17:07 [CHOCO]
@joefitzgerald
joefitzgerald / update-gopivotal-com-email-addresses.scpt
Created August 3, 2014 16:23
Update gopivotal.com Email Addresses
tell application "Contacts"
repeat with i from 1 to (count every person)
set theEmailAddresses to properties of emails of person i
repeat with j from 1 to (count of theEmailAddresses)
if value of item j of theEmailAddresses contains "@gopivotal.com" then
set oldAddress to value of item j of theEmailAddresses
set AppleScript's text item delimiters to {"@"}
set firstBit to first text item of oldAddress
set newAddress to firstBit & "@pivotal.io"
set value of item j of emails of person i to newAddress