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
| ## | |
| # Python Boto3 script to find the number of minutes an instance has been running. | |
| ## Output | |
| # i-00asdf5xxx50c96aa 84 days, 13:17:51.468559 | |
| # i-0260a1fxxx27ec894 6 days, 13:48:04.468643 | |
| # i-0acxxx6c630af322 13 days, 12:13:00.468659 | |
| # i-069bxxxd41bf975eb 19:42:08.468670 | |
| import boto3 | |
| from datetime import datetime, timezone |
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
| #!/usr/bin/python | |
| from OpenSSL import crypto | |
| import os | |
| import sys | |
| import datetime | |
| import whois | |
| #Variables | |
| TYPE_RSA = crypto.TYPE_RSA | |
| TYPE_DSA = crypto.TYPE_DSA |
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/sh | |
| ECHO='echo ' | |
| for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'main$\|develop$'); do | |
| if ! ( [[ -f "$branch" ]] || [[ -d "$branch" ]] ) && [[ "$(git log $branch --since "1 month ago" | wc -l)" -eq 0 ]]; then | |
| if [[ "$DRY_RUN" = "false" ]]; then | |
| ECHO="" | |
| fi | |
| local_branch_name=$(echo "$branch" | sed 's/remotes\/origin\///') | |
| $ECHO git branch -d "${local_branch_name}" |
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
| a4b.amazonaws.com | |
| acm-pca.amazonaws.com | |
| acm.amazonaws.com | |
| alexa-appkit.amazon.com | |
| alexa-connectedhome.amazon.com | |
| amazonmq.amazonaws.com | |
| apigateway.amazonaws.com | |
| appflow.amazonaws.com | |
| application-autoscaling.amazonaws.com | |
| appstream.application-autoscaling.amazonaws.com |
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 -x | |
| yum -y update --security | |
| ########################## | |
| ## ENABLE SSH RECORDING ## | |
| ########################## | |
| # Create a new folder for the log files | |
| mkdir /var/log/bastion |
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
| for u in $(aws iam list-users | jq ".Users[].UserName" --raw-output); do | |
| aws iam list-access-keys --user $u | jq '.AccessKeyMetadata[] | .UserName + ":" + .AccessKeyId' ; | |
| done |
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 | |
| # Shell script to backup MySQL database | |
| # Set these variables | |
| MyUSER="" # DB_USERNAME | |
| MyPASS="" # DB_PASSWORD | |
| MyHOST="" # DB_HOSTNAME | |
| # Backup Dest directory | |
| DEST="" # /home/username/backups/DB |
NewerOlder