This file contains hidden or 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
# show regions available | |
aws ec2 describe-regions --output text --query 'Regions[*].RegionName' | |
output: | |
ap-south-1 eu-west-1 ap-southeast-1 ap-southeast-2 eu-central-1 ap-northeast-2 ap-northeast-1 us-east-1 sa-east-1 us-west-1 us-west-2 |
This file contains hidden or 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
# clean-up downloaded apps archives | |
sudo rm /var/cache/apt/archives/* |
This file contains hidden or 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
# disk usage recursive | |
sudo du / -h --si --max-depth=3 | grep '[0-9]G\>' |
This file contains hidden or 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
# list security groups for ec2 instances | |
aws ec2 describe-security-groups --query "SecurityGroups[].GroupId | [0]" --output text | |
output: | |
si-22642348 sg-11662348 |
This file contains hidden or 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
# list security groups for ec2 instances | |
aws ec2 describe-security-groups --query "SecurityGroups[].GroupId | [0]" --output text | |
output: | |
si-22642348 sg-11662348 |
This file contains hidden or 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
# 1. Creates an IAM user account in AWS | |
# 2. Randomly generates a password for the account using apg | |
# 3. Adds the user to the Administrators group | |
# 4. Creates a login profile for the user (set password and set flag to force user to reset password upon initial logon) | |
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <username>" | |
exit 1 |
This file contains hidden or 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
roleArn="arn:aws:iam::" | |
roleArn+="$destinationAccountNumber" | |
roleArn+=":role/" | |
roleArn+="$rolename" | |
serialArn="arn:aws:iam::" | |
serialArn+="$sourceAccountNumber" | |
serialArn+=":mfa/" | |
serialArn+="$username" |
This file contains hidden or 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 | |
local CONF="$LE_WORKING_DIR/dnsapi/dns-route53-python.conf" | |
[ -r "$CONF" ] && . $CONF | |
if [ -z "$AWS" ]; then | |
AWS=`which aws 2>/dev/null` | |
fi | |
#Usage: add _acme-challenge.www.domain.com "XKrx...." |
This file contains hidden or 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 | |
# | |
# Simple script to generate a basic bind configuration for home/lab use | |
# | |
# Local config - adjust as required | |
OWNIP=192.168.111.3 | |
NETWORK=192.168.111.0 | |
NETMASK=/24 | |
DNS1=192.168.111.1 |
This file contains hidden or 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
options { | |
directory "/var/cache/bind"; | |
forwarders { | |
208.67.222.222; # OpenDNS (1/2) | |
151.202.0.85; # Verizon | |
198.6.1.3; # uu.net | |
# ====================================== | |
141.155.0.68; # Verizon (NY, USA) |
OlderNewer