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
#!/usr/bin/env python3 | |
''' | |
Generate a graph of the real returns of the S&P 500 | |
''' | |
import logging | |
import yfinance as yf | |
import pandas as pd | |
import requests |
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
# macos | |
ssh-keygen -t rsa -b 4096 -E SHA512 -m PEM -f ~/my.jwt.RS512.pem | |
# pip install pyjwt | |
python <<PYTHON | |
import os | |
import logging | |
import jwt |
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
#!/usr/bin/env python | |
''' | |
Calculate AWS Fargate pricing | |
''' | |
import argparse | |
import logging | |
logging.basicConfig( | |
level=logging.INFO, | |
format='%(asctime)s %(levelname)s %(message)s' |
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
#!/usr/bin/env python | |
''' | |
Convert an image to ASCII art | |
''' | |
import argparse | |
from PIL import Image | |
# pylint: disable=redefined-outer-name | |
def main(args): | |
''' |
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
#!/usr/bin/env python | |
''' | |
.. :: | |
.:.:=;. | |
.: ;;;. . | |
...=:;:..:?:.:. | |
.;;=;=====;;*=. | |
..::;;;========;?=. | |
.;;;;;;=======;==;. | |
.:;;;;;;==**==?SSZ; |
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
#!/usr/bin/env bash | |
set -e | |
watch_dns(){ | |
HOST=$1 | |
DNS_SERVER=${2:-"8.8.8.8"} | |
OLD_IP="$(dig +short "$HOST")" | |
echo "$(date) Starting to watch $HOST for changes from \"$OLD_IP\" as tracked by ${DNS_SERVER}" |
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
#!/usr/bin/env python | |
''' | |
This script will check for instances with tags "start", "shutdown" or "restart" | |
and will start, stop or restart them based on the time specified in the tag value | |
relative to the past execution. | |
''' | |
import json | |
import logging | |
import time |
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
while read -r AWS_PROFILE; do | |
for CLUSTER in $(aws eks list-clusters --profile "$AWS_PROFILE" --query clusters --output text); do | |
aws eks update-kubeconfig --name "$CLUSTER" --profile "$AWS_PROFILE" | |
done | |
done < <( | |
grep "^\[.*\]$" ~/.aws/credentials | sed 's/\[//;s/\]//;s/profile //' | |
) |
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
#!/usr/bin/env python | |
import sys | |
import random | |
def main(flips): | |
print('Flipping {} times.'.format(flips)) | |
count = 0 | |
for i in range(flips): | |
count += flip() |
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
#!/usr/bin/env python3 | |
# Written by: Robert J. | |
# Email: [email protected] | |
import os | |
import sys | |
import logging | |
import json | |
import boto3 | |
from datetime import date, datetime |
NewerOlder