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 | |
set -eu | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
BOLD='\033[1m' | |
NC='\033[0m' # No Color | |
AWS_CREDENTIALS_FILE=~/.aws/credentials |
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
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"math/rand" | |
"os" | |
"strconv" | |
"time" |
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
# This is a sorter to sort lines with a numbered list. | |
# e.g. of a unsorted ordered list | |
# 1.1 - Something | |
# 1.2.2 - Something | |
# 1.2.1 - Seomthing | |
import math | |
import sys |
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
import subprocess | |
from datetime import datetime | |
BUFFER_DURATION = 30 # in days | |
def get_password_expiry_from_chage(account): | |
try: | |
chage = subprocess.Popen(('chage', '-l', account), stdout=subprocess.PIPE) | |
grep = subprocess.Popen(('grep', 'Password expires'), stdin=chage.stdout, stdout=subprocess.PIPE) | |
cut = subprocess.Popen('cut -d : -f2'.split(), stdin=grep.stdout, stdout=subprocess.PIPE) |