Skip to content

Instantly share code, notes, and snippets.

Avatar
👾
Building.

Mitchell Hashimoto mitchellh

👾
Building.
View GitHub Profile
@mitchellh
mitchellh / gist:6531113
Last active Dec 23, 2015
`go get` replacement that works around Go issue #5375 (go get doesn't work with private Bitbucket repositories)
View gist:6531113
#!/bin/bash
#
# Due to a bug in Go, you can't `go get` a private Bitbucket repository
# (issue #5375, linked below). This means you can't `go get ./...` ANY project
# that might depend on a private Bitbucket repository.
#
# This script works around it by detecting Bitbucket imports and using
# `git` directly to clone into it. This will not work if you use private
# Mercurial repositories on Bitbucket.
#
View gist:6311182
2013/08/22 08:50:25 Packer Version: 0.3.5 dev cfb53005ff99ce34543108789b10332a5275b665+CHANGES
2013/08/22 08:50:25 Packer Target OS/Arch: darwin amd64
2013/08/22 08:50:25 Detected home directory from env var: /Users/mitchellh
2013/08/22 08:50:25 Attempting to open config file: /Users/mitchellh/.packerconfig
2013/08/22 08:50:25 File doesn't exist, but doesn't need to. Ignoring.
2013/08/22 08:50:25 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot amazon-instance:packer-builder-amazon-instance digitalocean:packer-builder-digitalocean virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build fix:packer-command-fix inspect:packer-command-inspect validate:packer-command-validate] PostProcessors:map[vagrant:packer-post-processor-vagrant] Provisioners:map[file:packer-provisioner-file shell:packer-provisioner-shell salt-masterless:packer-provisioner-salt-masterless]}
2013/08/22
View gist:6311139
2013/08/22 08:47:17 Packer Version: 0.3.5 dev cfb53005ff99ce34543108789b10332a5275b665+CHANGES
2013/08/22 08:47:17 Packer Target OS/Arch: darwin amd64
2013/08/22 08:47:17 Detected home directory from env var: /Users/mitchellh
2013/08/22 08:47:17 Attempting to open config file: /Users/mitchellh/.packerconfig
2013/08/22 08:47:17 File doesn't exist, but doesn't need to. Ignoring.
2013/08/22 08:47:17 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot amazon-instance:packer-builder-amazon-instance digitalocean:packer-builder-digitalocean virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build fix:packer-command-fix inspect:packer-command-inspect validate:packer-command-validate] PostProcessors:map[vagrant:packer-post-processor-vagrant] Provisioners:map[file:packer-provisioner-file shell:packer-provisioner-shell salt-masterless:packer-provisioner-salt-masterless]}
2013/08/22
View gist:6308417
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: SIGSEGV: segmentation violation
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: PC=0x407ebf
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox:
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox:
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: goroutine 1 [IO wait]:
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: net.runtime_pollWait(0x7ff1823f9e60, 0x72, 0x0)
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: /Users/mitchellh/go/src/pkg/runtime/znetpoll_linux_amd64.c:118 +0x82
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: net.(*pollDesc).WaitRead(0xc2000e11a0, 0xb, 0xc200112210)
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: /Users/mitchellh/go/src/pkg/net/fd_poll_runtime.go:75 +0x31
2013/08/22 10:32:05 /usr/local/bin/packer-builder-virtualbox: net.(*netFD).Read(0xc2000e1120, 0xc20011e000, 0x1000, 0x1000, 0x0, ...)
View gist:6283540
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: SIGSEGV: segmentation violation
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: PC=0x407ebf
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox:
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox:
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: goroutine 1 [IO wait]:
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: net.runtime_pollWait(0x7ff764cf2e60, 0x72, 0x0)
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: /Users/mitchellh/go/src/pkg/runtime/znetpoll_linux_amd64.c:118 +0x82
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: net.(*pollDesc).WaitRead(0xc2000d61a0, 0xb, 0xc200112210)
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: /Users/mitchellh/go/src/pkg/net/fd_poll_runtime.go:75 +0x31
2013/08/20 09:59:51 /usr/local/bin/packer-builder-virtualbox: net.(*netFD).Read(0xc2000d6120, 0xc20011e000, 0x1000, 0x1000, 0x0, ...)
View gist:6283509
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: unexpected fault address 0x0
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: fatal error: fault
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: [signal 0xb code=0x80 addr=0x0 pc=0x407ebf]
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox:
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: goroutine 55 [running]:
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: [fp=0xc200358db0] runtime.throw(0x97e2f7)
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: /Users/mitchellh/go/src/pkg/runtime/panic.c:473 +0x67
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: [fp=0xc200358dc8] runtime.sigpanic()
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: /Users/mitchellh/go/src/pkg/runtime/os_linux.c:239 +0xe7
2013/08/20 11:50:27 /usr/local/bin/packer-builder-virtualbox: [fp=0xc200358e18] hash_gciter_next(0xc200358ec0, 0xc200358ea0)
View gist:6124510
#!/bin/sh
set -e
IMAGE="image.bin"
DISK="coreos.vdi"
VM_NAME="CoreOS"
# Delete any existing VDI
rm -f $DISK
View gist:6124502
#!/bin/sh
set -e
IMAGE="image.bin"
DISK="coreos.vdi"
VM_NAME="CoreOS"
# Delete any existing VDI
rm -f $DISK
View gist:6123808
Vagrant.configure("2") do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "coreos"
config.ssh.username = "core"
config.vm.synced_folder ".", "/vagrant", disabled: true
end
@mitchellh
mitchellh / gist:5436471
Last active Dec 16, 2015
Reading forwarded ports in VMware Workstation on Windows
View gist:5436471
results = {}
results[:tcp] = {}
results[:udp] = {}
Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\VMware, Inc.\VMnetLib\VMnetConfig') do |reg|
# Get each of the vmnets
reg.each_key do |vmnet|
reg.open(vmnet) do |vmnet_reg|
# If this network doesn't include the NAT key, we
# don't really care about it.