Skip to content

Instantly share code, notes, and snippets.

View simplyadrian's full-sized avatar
:shipit:
brooding

Adrian Herrera simplyadrian

:shipit:
brooding
  • Minneapolis, MN
  • 01:36 (UTC -05:00)
View GitHub Profile
#!/bin/bash
set -e
set -o pipefail
if [[ -z "$GITHUB_TOKEN" ]]; then
echo "Set the GITHUB_TOKEN env variable."
exit 1
fi
@simplyadrian
simplyadrian / template.json
Created March 5, 2016 01:38
jinja2 sucky fucky
{% for cgwid, ip in customer_gateway_ip.iteritems() -%}
"{{ cgwid }}CustomerGateway" : {
"Properties" : {
"Type" : "ipsec.1",
"BgpAsn" : "65000",
"IpAddress" : "{{ ip }}",
"Tags" : [
{ "Key": "mGage:unit", "Value": "techops" },
{ "Key": "mGage:product", "Value": "network" },
{ "Key": "mGage:subproduct", "Value": "vpc-infrastructure" },
@simplyadrian
simplyadrian / docker-clean
Created September 10, 2015 14:07
a shell script to clean up after docker usage.
#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)
@simplyadrian
simplyadrian / create_virtual_application.ps1
Created May 14, 2015 18:09
Creates a virtual application in a IIS website
# Powershell 2.0
if($env:RS_REBOOT){exit 0}
# Stop and fail script when a command fails.
$errorActionPreference = "Stop"
# load library functions
$rsLibDstDirPath = "$env:rs_sandbox_home\RightScript\lib"
. "$rsLibDstDirPath\tools\PsOutput.ps1"
@simplyadrian
simplyadrian / create_app_pool_and_site.ps1
Created May 14, 2015 14:56
create IIS app pool and website
# Powershell 2.0
# Stop and fail script when a command fails.
$errorActionPreference = "Stop"
# load library functions
$rsLibDstDirPath = "$env:rs_sandbox_home\RightScript\lib"
. "$rsLibDstDirPath\tools\PsOutput.ps1"
. "$rsLibDstDirPath\tools\ResolveError.ps1"
. "$rsLibDstDirPath\aws\EC2.ps1"
@simplyadrian
simplyadrian / assign_port_to_website.ps1
Created May 14, 2015 14:54
Add port bindings to an IIS website.
# Powershell 2.0
if($env:RS_REBOOT){exit 0}
# Stop and fail script when a command fails.
$errorActionPreference = "Stop"
# load library functions
$rsLibDstDirPath = "$env:rs_sandbox_home\RightScript\lib"
. "$rsLibDstDirPath\tools\PsOutput.ps1"
@simplyadrian
simplyadrian / add_connection_string.ps1
Created May 14, 2015 14:30
Add a connection string to a IIS web.config
# Powershell 2.0
# Stop and fail script when a command fails.
$errorActionPreference = "Stop"
# load library functions
$rsLibDstDirPath = "$env:rs_sandbox_home\RightScript\lib"
. "$rsLibDstDirPath\tools\PsOutput.ps1"
. "$rsLibDstDirPath\tools\ResolveError.ps1"
@simplyadrian
simplyadrian / register_vns3_ip.ps1
Created May 14, 2015 14:27
Register private IP with DNS services. Supports DNSMadeEasy, DynDNS, Rackspace and Route53
# Powershell 2.0
if($env:RS_REBOOT){exit 0}
Start-Sleep -s 60
# Stop and fail script when a command fails.
$errorActionPreference = "Stop"
$ip = $env:VNS3_IP_ADDRESS
@simplyadrian
simplyadrian / register_ip.ps1
Created May 14, 2015 14:25
Register public IP with DNS services. Supports DNSMadeEasy, DynDNS, Rackspace and Route53
# Powershell 2.0
# Stop and fail script when a command fails.
$errorActionPreference = "Stop"
### Declare inputs
#$env:DNS_ID
#$env:DNS_IP_ADDRESS
#$env:DNS_DOMAIN_NAME
#$env:DNS_USER
@simplyadrian
simplyadrian / oltp_code_deployment.ps1
Created May 14, 2015 14:21
Download and deploy database DDL
# Powershell 2.0
if($env:RS_REBOOT){exit 0}
# Stop and fail script when a command fails.
$errorActionPreference = "Stop"
# load library functions
$rsLibDstDirPath = "$env:rs_sandbox_home\RightScript\lib"
. "$rsLibDstDirPath\tools\PsOutput.ps1"