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
clear | |
$tz_found = $false | |
do { | |
$q = "`nEnter the first 3 letters of time zone you want to set (e.g. Eastern = eas)" | |
do { | |
$tz_query = Read-Host -Prompt $q | |
} until ($tz_query.Length -gt 2) | |
$timezone_list = Get-TimeZone -Name "*$($tz_query)*" -ErrorAction SilentlyContinue | |
if ($timezone_list.Length -gt 0) { |
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
# "Disable" iptables on Ubuntu | |
sudo iptables-save > ~/firewall.rules | |
sudo iptables -X | |
sudo iptables -t nat -F | |
sudo iptables -t nat -X | |
sudo iptables -t mangle -F | |
sudo iptables -t mangle -X | |
sudo iptables -P INPUT ACCEPT | |
sudo iptables -P FORWARD ACCEPT | |
sudo iptables -P OUTPUT ACCEPT |
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 | |
# JQ is required to more easily parse json. | |
AWS_IAM_ROLE=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/` | |
AWS_ACCESS_KEY_ID=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.AccessKeyId'` | |
AWS_SECRET_ACCESS_KEY=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.SecretAccessKey'` | |
AWS_TOKEN=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.Token'` | |
AWS_AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone` | |
AWS_DEFAULT_REGION="`echo \"$AWS_AZ\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`" | |
LOCAL_IP=`curl -sL http://169.254.169.254/latest/meta-data/local-ipv4` | |
PUBLIC_IP=`curl -sL http://169.254.169.254/latest/meta-data/public-ipv4` |