Skip to content

Instantly share code, notes, and snippets.

View mefellows's full-sized avatar

Matt Fellows mefellows

View GitHub Profile
@mefellows
mefellows / NancyDemo.cs
Created March 18, 2015 00:05
Demo Nancy .NET Hello World API
using Nancy;
namespace NancyDemo
{
public class HelloModule : NancyModule
{
public HelloModule()
{
Get["/"] = parameters => "Hello World";
}
}
@mefellows
mefellows / build.sh
Created March 17, 2015 21:56
Mono static binary build script
#!/bin/bash
nuget restore -NonInteractive
PACKAGES_DIR=$(find ./packages/ -name *.dll)
PACKAGES=""
for f in $PACKAGES_DIR; do
PACKAGES="$PACKAGES $f"
done
@mefellows
mefellows / Vagrantfile
Last active August 29, 2015 14:17
Mono Vagrantfile for building images
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "deb/jessie-amd64"
config.vbguest.auto_update = false
# Provision the Debian server with the Mono build environment
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y curl
rm -rf /var/lib/apt/lists/*
@mefellows
mefellows / bash-alias
Last active August 29, 2015 14:15
cg - Bash Alias function to switch to a go project
changedir_go() {
if [ "$#" -eq "2" ]; then
cd $GOPATH/src/github.com/$1/$2
else
cd $GOPATH/src/github.com/mefellows/$1
fi
}
alias cg=changedir_go
@mefellows
mefellows / packer.json
Created January 28, 2015 05:15
Parallels Windows Setup
{
"variables": {
"build_version": "1.0.0"
},
"builders": [
{
"type": "parallels-iso",
"guest_os_type": "win-2012",
"disk_size": 65536,
"name": "basebox-parallels",
@mefellows
mefellows / vagrant-bootstrapper.ps1
Created December 17, 2014 00:53
Windows Vagrant with Rsync powershell bootstrap script
Write-Host -ForegroundColor green "Bootstrapping machine"
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 {
@mefellows
mefellows / Vagrantfile
Created December 7, 2014 21:24
Example Vagrant Windows SMB Setup
VAGRANTFILE_API_VERSION = "2"
require 'io/console'
# Capture login details if starting up vagrant or provisioning it
# Required for AD operations.
#
# Environment variables prevent explicit user input. Useful for CI.
username = ENV["VAGRANT_USER"] || nil
password = ENV["VAGRANT_PASSWORD"] || nil
@mefellows
mefellows / ec2-user-data.ps1
Last active May 28, 2021 11:44
Packer Community Plugins - Example Windows 2012 Setup
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
cmd.exe /c net user /add vagrant FooBar@123
cmd.exe /c net localgroup administrators vagrant /add
Set-ExecutionPolicy -ExecutionPolicy bypass -Force
# RDP
@mefellows
mefellows / boxstarter.ps1
Last active August 29, 2015 14:07
Matt's BoxStarter
Update-ExecutionPolicy Unrestricted
Set-TaskbarSmall
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst sublimetext2
cinst SqlServer2012Express
cinst VisualStudio2013Ultimate
cinst fiddler4
cinst mssqlserver2012express
@mefellows
mefellows / gist:9a67b17a571fcffa1bd0
Created October 8, 2014 03:32
Powershell $PROFILE
#$Shell.WindowTitle="WinOps Matt"
set-executionpolicy unrestricted
new-item alias:subl -value 'C:\Program Files\Sublime Text 3\sublime_text.exe'
new-item alias:ll -value 'ls'