Skip to content

Instantly share code, notes, and snippets.

View mefellows's full-sized avatar

Matt Fellows mefellows

View GitHub Profile
@mefellows
mefellows / credulous.ps1
Created April 23, 2015 14:24
Credulous Powershell wrapper
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
@mefellows
mefellows / ChocolateyInstall.ps1
Last active August 29, 2015 14:19
Machine Factories with Windows Part 2: AWS Environments
# 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")
@mefellows
mefellows / build.log
Created April 14, 2015 11:56
Packer Community - Windows Plugins: Issue 43 Repro
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
@mefellows
mefellows / boxstarter.ps1
Last active September 12, 2016 17:27
TC 2012r2 Build Agent - BoxStarter
# 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
@mefellows
mefellows / MyWebsite.ps1
Last active March 1, 2021 15:07
Machine Factories with Windows Part 1: Local Development with Vagrant
Configuration MyWebsite
{
param ($MachineName)
Import-DscResource -Module MyWebapp
Import-DscResource -Module cNetworking
Node $MachineName
{
WindowsFeature IIS
@mefellows
mefellows / bootstrap.ps1
Last active April 6, 2018 01:06
Bootstrap Vagrant + Packer for Windows Development and Automation
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'))
@mefellows
mefellows / packer.json
Last active November 14, 2019 19:50
Packer Community Valid Exit Codes
{
"builders": [
{
"type": "virtualbox-windows-ovf",
"source_path": "output-basebox-vbox/talentsearch-api-1.0.0.ovf",
"headless": false,
"boot_wait": "1m",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_wait_timeout": "5m",
@mefellows
mefellows / win2008r2-packer.json
Last active August 29, 2015 14:17
Windows 2008r2 Elevated Provisioning Example
{
"builders": [{
"type": "virtualbox-windows-ovf",
"name":"win2008updates",
"source_path": "/Users/mfellows/Downloads/packer-output-updates/virtualbox-win-2008-base.ovf",
"headless": false,
"boot_wait": "1m",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_wait_timeout": "5m",
@mefellows
mefellows / Dockerfile
Created March 18, 2015 02:11
Mono static binary Dockerfile
FROM progrium/busybox
RUN opkg-install libc-dev
ADD ./consoleapp console
CMD [ "./console" ]
@mefellows
mefellows / vagrant.sh
Created March 18, 2015 02:05
Run Minimal Mono Docker API
vagrant up
vagrant ssh
cd /vagrant
./build.sh
docker run -d -p 8888:8888 mfellows/mono-api