git --no-pager log --oneline --no-merges --decorate=no $(git describe --tags --abbrev=0)..
# with git-extras installed https://github.com/tj/git-extras
# update the changlog format first
git config changelog.format "%h %s"
#!/bin/bash | |
usage() { | |
echo "Usage: $(basename "$0") [-v] [-f filename] [-g group] positional-param" | |
exit 1 | |
} | |
if [[ "$#" -lt 1 ]]; then | |
usage | |
fi |
#!/bin/bash | |
temp_ruleset=$(mktemp) | |
nginx_ruleset="# Generated by iptables-save v1.4.21 on Fri Jan 9 18:21:29 2015 | |
*filter | |
:INPUT DROP [0:0] | |
:FORWARD DROP [0:0] | |
:OUTPUT DROP [0:0] | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT -p icmp -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT | |
-A INPUT -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT |
#!/usr/bin/env python3 | |
# https://docs.python.org/3.9/library/argparse.html | |
import argparse | |
def parse_arguments(): | |
parser = argparse.ArgumentParser(description='Argument Parser Template') | |
parser.add_argument('-b', '--basic', help='basic arg consuming option') | |
parser.add_argument('-v', '--verbose', help='increase output verbosity, flag', action='store_true') | |
parser.add_argument('-g', '--greedy', help='greedy narg=* arg', nargs='*') | |
parser.add_argument('-c', '--choices', help='choices demonstration', choices=['list', 'of', 'choices']) |
git --no-pager log --oneline --no-merges --decorate=no $(git describe --tags --abbrev=0)..
# with git-extras installed https://github.com/tj/git-extras
# update the changlog format first
git config changelog.format "%h %s"
https://docs.python.org/3/library/datetime.html
from datetime import datetime as dt
In [119]: dt.now()
Out[119]: datetime.datetime(2021, 12, 17, 23, 29, 32, 946086)
In [180]: dt.now(timezone.utc)
Out[180]: datetime.datetime(2021, 12, 18, 4, 51, 10, 734244, tzinfo=datetime.timezone.utc)
#!/usr/bin/env python3 | |
# https://developer.tdameritrade.com/content/authentication-faq | |
from requests import post | |
import os | |
import sys | |
try: | |
refresh_token = os.environ['REFRESH_TOKEN'] | |
client_id = os.environ['CLIENT_ID'] |
openssl req -new -out fqdn.csr -newkey rsa:2048 -nodes -keyout fqdn.key -subj /C=US/ST=State/L=City/O=Company/CN=fqdn
openssl req -x509 -days 365 -out fqdn.crt -newkey rsa:2048 -nodes -keyout fqdn.key -subj /C=US/ST=State/L=City/O=Company/CN=fqdn
#!/bin/bash | |
curl -s https://check.torproject.org/exit-addresses | awk '/ExitAddress/ {print $2}' | sort -n |
#!/bin/bash | |
TODAY=$(date +%Y%m%d) | |
TARGETS=( '/etc' '/home' '/root' '/var/www' ) | |
BACKUP_ROOT='/backups' | |
BACKUP_DIR="${BACKUP_ROOT}/${TODAY}" | |
echo "$(date +%D" "%r): Beginning backup" | |
mkdir -p $BACKUP_DIR | |
for i in ${TARGETS[@]}; do |