Skip to content

Instantly share code, notes, and snippets.

View PatOShea's full-sized avatar

Pat O'Shea PatOShea

View GitHub Profile
@savishy
savishy / Vagrant Tips and Tricks.md
Last active May 25, 2022 23:05
Vagrant Tips and Tricks

Vagrant Tips and Tricks

Vagrant shell provisioner allows reading from Gists!

reference

Assuming

  1. You are using Vagrant and Shell provisioner often (e.g when doing Windows provisioning you will end up using Powershell a lot)
  2. You have started running into the problem of reusing your scripts
@PlagueHO
PlagueHO / SSL.tests.ps1
Last active January 26, 2024 16:01
PowerShell Pester Tests for checking SSL endpoints
<#
.DESCRIPTION
Outputs the SSL protocols that the client is able to successfully use to connect to a server.
.PARAMETER ComputerName
The name of the remote computer to connect to.
.PARAMETER Port
The remote port to connect to. The default is 443.
@munkyjunky
munkyjunky / Octopus-Teamcity.ps1
Last active July 22, 2020 18:21
Powershell script to trigger a TeamCity build from Octopus Deploy, and wait for the build to finish
# Powershell script to trigger a Team City build from Octopus Deploy, and wait for it to be finished
# Use case for this is running an automated script (such as test scripts) from Team City as part of
# a deployment, and holding the deployment until the script has finished
# teamcity-host teamcity host url
# teamcity-username teamcity api username
# teamcity-password teamcity api password
# teamcity-build-configuration-id teamcity build configuration
# teamcity-changeset (optional) changeset to build from - NOTE: this is a VCS changeset
@ryancurrah
ryancurrah / vault_module.py
Created December 18, 2015 01:25
SaltStack Module and Renderer for HashiCorp Vault
# -*- coding: utf-8 -*-
'''
Execution module to work with HashiCorp's Vault
:depends: - python-requests
In order to use an this module, a profile must be created in the master
configuration file:
Token example:
@theparticleman
theparticleman / Vagrantfile
Created December 2, 2015 23:00
ASP.NET 5 with .NET Core Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :private_network, ip: "192.168.33.15"
$script = <<-SCRIPT
reset
sudo apt-get update
@bxt
bxt / git-deletebranches.sh
Last active June 23, 2021 15:01
Git Delete Merged Branches
#!/bin/bash
MAIN=${1:-development}
BRANCHES=$(git branch --merged $MAIN | grep -v -e 'master\|staging\|development\|\*')
echo Branches merged into $MAIN:
echo $BRANCHES
read -p "Delete these branches (y/n)? " answer
@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
@jeroenmaes
jeroenmaes / CreateAccountsAndGroups.ps1
Created October 24, 2014 07:23
Create BizTalk Groups and Service Accounts with PowerShell
# Path where to create the biztalk groups and service accounts
$BtsOuPath = "OU=BizTalk,OU=Service Accounts,DC=LABO,DC=local"
# Path where to create the biztalk admin user
$AdminOuPath = "CN=Users,DC=LABO,DC=local"
$DomainAdmin = "JMADMIN"
$BtsAdmin = "BTSADMIN"
# Convert the plain text passwords
$BtsAdminPassword = ConvertTo-SecureString "P@$$w0rd0" -AsPlainText -Force
@obscuresec
obscuresec / dirtywebserver.ps1
Created May 18, 2014 15:36
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)