Skip to content

Instantly share code, notes, and snippets.

View PatOShea's full-sized avatar

Pat O'Shea PatOShea

View GitHub Profile
@PatOShea
PatOShea / README.md
Created March 1, 2018 00:17 — forked from tknerr/README.md
Vagrant with Ansible Provisioner on Windows

Vagrant with Ansible Provisioner on Windows

Long story short, ansible does not work on a Windows control machine, so you basically have to:

  • either run ansible --connection=local ... in the target vm
  • set up a separate control vm where ansible is installed via shell provisioner

Below are Vagrantfile examples for both approaches

Within the Target VM

@PatOShea
PatOShea / dirtywebserver.ps1
Created March 24, 2017 20:25 — forked from obscuresec/dirtywebserver.ps1
Dirty PowerShell Webserver
$Hso = New-Object Net.HttpListener
$Hso.Prefixes.Add("http://+:8000/")
$Hso.Start()
While ($Hso.IsListening) {
$HC = $Hso.GetContext()
$HRes = $HC.Response
$HRes.Headers.Add("Content-Type","text/plain")
$Buf = [Text.Encoding]::UTF8.GetBytes((GC (Join-Path $Pwd ($HC.Request).RawUrl)))
$HRes.ContentLength64 = $Buf.Length
$HRes.OutputStream.Write($Buf,0,$Buf.Length)
@PatOShea
PatOShea / README.rst
Created November 10, 2015 19:01 — forked from deuscapturus/README.rst
SaltStack Bootstrap for AWS EC2

SaltStack Bootstrap Script for AWS EC2

This script will currently only work with Windows8, Windows 2012R2, Amazon Linux, RHEL6 and RHEL7.

Ohai::Config::disabled_plugins= [
#
# add to client.rb file -- c:\chef\client.rb
#
# ref: http://www.slideshare.net/opscode/chef-conf-windowsdougireton # slide 30
# ohai plugins that have poor perf or are irrelevant to windows
#
"c", "cloud", "ec2", "rackspace", "eucalyptus", "command", "dmi", "dmi_common",
"erlang", "groovy", "ip_scopes", "java", "keys", "lua", "mono", "network_listeners",
"passwd", "perl", "php", "python", "ssh_host_key", "uptime", "virtualization",
@PatOShea
PatOShea / updateNewRelicNotes.ps1
Last active September 3, 2015 21:43 — forked from kfrancis/gist:3164709
Powershell update of deploy notes for New Relic
if ($OctopusEnvironmentName -eq "Production") {
# in production, we need to
#Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default.
$URL = "http://api.newrelic.com/deployments.xml"
$post = "deployment[account_id]=<id here>&deployment[user]=OctopusDeploy&deployment[app_id]=<app id here>&deployment[revision]=($OctopusPackageVersion)"
$URI = New-Object System.Uri($URL,$true)
#Create a request object using the URI
$request = [System.Net.HttpWebRequest]::Create($URI)