This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######### | |
# The routes in this config use the firewall for routing between spokes and | |
# and for spoke traffic to the internet. Additional routes needed if hub | |
# shared subnet should also go through the firewall | |
# Region | |
$azregion = 'westus3' | |
# Resource Group | |
$vnetresourcegroup = "rg-network-prod-wus3-001" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function VMPing { | |
[CmdletBinding(DefaultParameterSetName="1")] | |
# Sourced from https://github.com/vxav/Scripting/blob/master/VMPing.ps1 | |
param( | |
[parameter(position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True,Mandatory=$True)] | |
$VM, | |
[parameter(parametersetname=1)][Alias('n')][int]$Count = 4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-ExecutionPolicy -Scope CurrentUser -Force:$True -ExecutionPolicy Unrestricted | |
$env:Path += ";C:\Scratch\Putty" | |
$clusters = Get-Content .\cluster_list.txt | |
if (!$cred) {$cred = Get-Credential} | |
$user = $cred.GetNetworkCredential().username | |
$pw = $cred.GetNetworkCredential().password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
''' | |
File name: pure_tools.py | |
Author: Ryan Benigno | |
Date created: 05/08/2017 | |
Purpose: Command line script to perform various administrative operations on | |
Pure Storage Flash Array. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
""" | |
Dump LUN inventory from Pure array | |
""" | |
# Import purestorage | |
try: | |
from purestorage import * | |
except ImportError, e: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create default multipath.conf | |
[[ -f "/etc/multipath.conf" ]] && read -r -p "/etc/multipath.conf exists. Continue? [y/N] " response | |
if [[ "$response" =~ ^(no|n)$ ]]; then | |
echo "Quitting." | |
exit 1 | |
else | |
echo "Writing /etc/multipath.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To run with redirect to a file: | |
# bash ./storage_info.sh &> discover_$(hostname).txt | |
print_h1(){ | |
printf '\n# %s\n\n' "$@" | |
} | |
print_h2(){ | |
printf '\n## %s\n\n' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write log entries in a format that can be easily ingested by Splunk | |
<# Add the following to your script, then use "Write-MyLog" to add log entries | |
Import-Module "D:\BATCH_JOBS\Logging.psm1" | |
Function Write-MyLog { | |
Param ([string]$logstring) | |
$Logfile = "D:\BATCH_JOBS\LOGS\<<JOB_NAME>>.log" | |
Add-LogEntry -LogPath $LogFile -JobName "<<JOB_NAME>>" -Message "$logstring" | |
} | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ubuntu: Place this script in /var/lib/cloud/scripts/per-boot | |
HOST_CNAME=<CNAME to Update> | |
HOSTED_ZONE_ID=<Route53 Zone ID> | |
INSTANCE_ID=$(ec2metadata | grep 'instance-id:' | cut -d ' ' -f 2) | |
PUBLIC_HOSTNAME=$(ec2metadata | grep 'public-hostname:' | cut -d ' ' -f 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
from infoblox_client import connector | |
from infoblox_client import objects | |
import logging |
NewerOlder