Skip to content

Instantly share code, notes, and snippets.

View PatrickLang's full-sized avatar

Patrick Lang PatrickLang

  • Washington, USA
View GitHub Profile
@PatrickLang
PatrickLang / Building_Packer.md
Last active December 10, 2016 01:54
Steps for building my fork of Packer

From hashicorp/packer#2576 (comment)

cd ~/Source/go
$ENV:GOPATH=$(pwd)
go get github.com/mitchellh/packer
cd src\github.com\mitchellh\packer
git remote add hyperv https://github.com/patricklang/packer
git fetch hyperv HyperV
git checkout HyperV

packer.exe build -only=hyperv-iso windows_2016_docker.json

hyperv-iso output will be in this color.

Warnings for build 'hyperv-iso':

* For nested virtualization, when virtualization extension is enabled, mac spoofing should be allowed.
@PatrickLang
PatrickLang / docker-compose.yml
Created March 20, 2017 15:43
Example compose file for WordPress & MariaDB
version: '2'
services:
wordpress:
image: wordpress
ports:
- 8080:80
environment:
WORDPRESS_DB_PASSWORD: Password123!
restart: always
depends_on:
@PatrickLang
PatrickLang / ACS Kubernetes with Windows demo.md
Last active March 22, 2017 21:56
ACS Kubernetes with Windows demo
@PatrickLang
PatrickLang / README.md
Last active May 20, 2017 07:38
Dev deployment of Zookeeper+Mesos+Marathon

Just an experiment setting up a test deployment of Zookeeper + Mesos + Marathon on an existing machine with Docker installed.

Running it

docker-compose up -d

Accessing Mesos UI:

http://<hostip>:5050

@PatrickLang
PatrickLang / VagrantStatusAndCleanup.md
Created May 24, 2017 15:23
PowerShell snippet for finding all Vagrantfiles under a path and showing the status

I've made the mistake of accidently removing VMs with Remove-VM or Hyper-V Manager that I originally created with Vagrant. This is a set of code snippets I'm using to help prevent that and make it easy to find all Vagrant created VMs, remove the ones I don't need, then delete the boxes.

$oldpwd = $pwd ; gci -r Vagrantfile | %{ cd $_.Directory ; Write-Output "Checking status at $pwd" ; vagrant.exe status } ; cd $oldpwd

Other things I still need to do:

@PatrickLang
PatrickLang / VagrantStatusAndCleanup.md
Last active May 24, 2017 15:25
PowerShell snippet for finding all Vagrantfiles under a path and showing the status

I've made the mistake of accidently removing VMs with Remove-VM or Hyper-V Manager that I originally created with Vagrant. This is a set of code snippets I'm using to help prevent that and make it easy to find all Vagrant created VMs, remove the ones I don't need, then delete the boxes.

$oldpwd = $pwd ; `
gci -r Vagrantfile | %{ `
  cd $_.Directory ; `
  Write-Output "Checking status at $pwd" ; `
 vagrant.exe status } ; `
@PatrickLang
PatrickLang / VisualStudioAlmSetup.md
Last active June 5, 2017 22:24
Visual Studio Trial VHD on Azure

There's a prebuilt VHD with Windows Server 2016, Visual Studio 2017, and more for hands on labs available from https://almvm.azurewebsites.net/labs/tfs/ . This will upload it to Azure and create a ready to run VM :)

Unfortunately as of 6/5, it doesn't work. I can't connect to it presumably because Remote Desktop isn't enabled or the firewall port isn't open

Download all parts

(Invoke-WebRequest https://almvm.azurewebsites.net/labs/tfs/almvm2017url.txt -UseBasicParsing).Content -split '\r?\n' | %{ Start-BitsTransfer $_ }

Steps tried

  1. Installed Debian 8.7.1 from ISO using Packer with hyperv-iso plugin. source
  • packer build -only=hyperv-iso -var-file=.\debian8.json .\debian.json
  1. Added deb http://http.debian.net/debian jessie-backports main to /etc/apt/sources.list
  2. sudo apt-get install hyperv-daemons=4.*
  3. sudo apt-get install linux-image-amd64=4.8* linux-base=4.3*
  4. sudo reboot