This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
Write-Host -ForegroundColor green "Bootstrapping machine ${remoteHost}" | |
Write-Host "Setting up package management and installing required packages for Dev." | |
# Install Choco (if not already installed) + required packages | |
if ( (Get-Command "choco" -errorAction SilentlyContinue) ) { | |
Write-Host "Chocolatey already installed. Skipping." | |
} else { | |
Write-Host "Installing Chocolatey" | |
$wc=new-object net.webclient; $wp=[system.net.WebProxy]::GetDefaultProxy(); $wp.UseDefaultCredentials=$true; $wc.Proxy=$wp; iex ($wc.DownloadString('https://chocolatey.org/install.ps1')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration MyWebsite | |
{ | |
param ($MachineName) | |
Import-DscResource -Module MyWebapp | |
Import-DscResource -Module cNetworking | |
Node $MachineName | |
{ | |
WindowsFeature IIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/mefellows/6c9faf342817b8412b76/raw/953665c62ce975af136cf2e3e8b93beb3a395b9c/boxstarter.ps1 | |
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
Disable-UAC | |
Disable-InternetExplorerESC | |
cinst git.install -y -params '"/GitAndUnixToolsOnPath"' | |
cinst virtualbox -y | |
cinst vagrant -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015/04/14 21:27:31 [INFO] Packer version: 0.7.5 1b07d7eb5efd51dec5407e82240166d1fe8d6c85+CHANGES | |
2015/04/14 21:27:31 Packer Target OS/Arch: darwin amd64 | |
2015/04/14 21:27:31 Built with Go Version: go1.4.1 | |
2015/04/14 21:27:31 [DEBUG] Discovered plugin: amazon-chroot = /Users/mfellows/go/bin/packer-builder-amazon-chroot | |
2015/04/14 21:27:31 [DEBUG] Discovered plugin: amazon-ebs = /Users/mfellows/go/bin/packer-builder-amazon-ebs | |
2015/04/14 21:27:31 [DEBUG] Discovered plugin: amazon-instance = /Users/mfellows/go/bin/packer-builder-amazon-instance | |
2015/04/14 21:27:31 [DEBUG] Discovered plugin: amazon-windows-ebs = /Users/mfellows/go/bin/packer-builder-amazon-windows-ebs | |
2015/04/14 21:27:31 [DEBUG] Discovered plugin: digitalocean = /Users/mfellows/go/bin/packer-builder-digitalocean | |
2015/04/14 21:27:31 [DEBUG] Discovered plugin: docker = /Users/mfellows/go/bin/packer-builder-docker | |
2015/04/14 21:27:31 [DEBUG] Discovered plugin: googlecompute = /Users/mfellows/go/bin/packer-builder-googlecompute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a workaround to deal with the fact that | |
# 1) New Chocolatey now sets the UI Culture to invariant | |
# 2) DSC Tries to Import-LocalizedData (line 57 of C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1) | |
# which uses implicit UI Culture, but of course is not available in this mode. | |
If ( -not ( Test-Path "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.Resource.psd1" ) ) { | |
cmd /c mklink C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.Resource.psd1 C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\en-US\PSDesiredStateConfiguration.Resource.psd1 | |
} | |
$outputPath = $env:TEMP | |
$webAppPath = $(Join-Path $env:chocolateyPackageFolder "/lib/_PublishedWebsites/ShortUrlWebApp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If ($args[0] -eq "source" ) { | |
$res = iex "$credulous source mfellows@onegeek -force" | out-string | |
Write-Host "Exporting AWS environment into shell" | |
iex $($res) | |
If ( $LastExitCode -eq 0) { | |
Write-Host $res | |
} else { | |
Write-Error "Failed to load credentials into environment." | |
Exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INSTANCE_ID=$1 | |
IP=$(aws ec2 --region $AWS_REGION describe-instances --instance-id $INSTANCE_ID | jq -r .Reservations[0].Instances[0].PrivateIpAddress) | |
KEYPAIR_NAME=$(aws ec2 --region $AWS_REGION describe-instances --instance-id $INSTANCE_ID | jq -r .Reservations[0].Instances[0].KeyName) | |
ssh -i ~/.ssh/$KEYPAIR_NAME.pem "ec2-user@$IP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml" | |
$xml = [xml](get-content $EC2SettingsFile) | |
$xmlElement = $xml.get_DocumentElement() | |
foreach ($element in $xmlElement.Property) | |
{ | |
if ($element.Name -eq "AutoSysprep") | |
{ | |
$element.Value="Yes" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform destroy -var access_key=$AWS_ACCESS_KEY_ID -var secret_key=$AWS_SECRET_ACCESS_KEY --var ami_id=ami-12345678 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"builders": [ { | |
"type": "virtualbox-windows-ovf", | |
"name": "vagrantbox", | |
"source_path": "/Users/mfellows/Downloads//output-virtualbox-iso/packer-virtualbox-iso-1417096689.ovf", | |
"guest_additions_mode": "disable", | |
"headless":false, | |
"boot_wait":"15s", | |
"winrm_username": "vagrant", | |
"winrm_password": "vagrant", |