Skip to content

Instantly share code, notes, and snippets.

View lordjabez's full-sized avatar
🔧
https://makingofthings.com

Judson Neer lordjabez

🔧
https://makingofthings.com
View GitHub Profile
### Keybase proof
I hereby claim:
* I am lordjabez on github.
* I am jneer (https://keybase.io/jneer) on keybase.
* I have a public key ASDY26yEphfbDcRODnVHUAJrTu0K49Px-VH4sRdzyqTg0Qo
To claim this, I am signing this object:
@lordjabez
lordjabez / decode-git-object.py
Last active April 6, 2023 12:20
Python script to decode a git object
#!/usr/bin/env python3
import sys
import zlib
# Installation:
# curl -s https://gist.githubusercontent.com/lordjabez/7f24c848a1424365617300b0d9bc2d04/raw/67797f4fc6e19c48acff1188a47848f314f9e9e0/decode-git-object.py > /usr/local/bin/decode-git-object
# chmod +x /usr/local/bin/decode-git-object
# Usage:
@lordjabez
lordjabez / generate-scans.py
Created June 7, 2022 00:24
Python script to make a set of images look like they were scanned
#!/usr/bin/env python3
# Pre-requisite: brew install imagemagick
# Usage: ./generate-scans.py NUM_SCANS_PER_FILE
import multiprocessing
import random
import subprocess
import os
import sys
@lordjabez
lordjabez / requests-use-cert.py
Created June 7, 2022 00:25
Use cert from AWS Secrets Manager in requests
import requests
secret_id = 'id-for-your-cert-secret-goes-here'
secrets_manager = boto3.client('secretsmanager')
response = secrets_manager.get_secret_value(SecretId=secret_id)
cert_content = json.loads(response['SecretString'])
file_type = requests.packages.urllib3.contrib.pyopenssl.OpenSSL.crypto.FILETYPE_PEM
#!/usr/bin/env python3
# pip3 install bitlyshortener pypng pyqrcode
import os
import sys
import bitlyshortener
import pyqrcode
@lordjabez
lordjabez / aa-seats.py
Last active November 18, 2022 16:44
American Airlines seat viewer
#!/usr/bin/env python3
# This script takes one parameter, an American Airlines flight number.
# It also requires a FlightLabs API key to be stored in FLIGHTLABS_ACCESS_KEY,
# you can get one at https://app.goflightlabs.com/.
# It will lookup additional flight details from the flight number, and then
# open a web page to the AA seat map tool, passing the proper URL parameters
# to view the seat map for the provided flight.
@lordjabez
lordjabez / export-emails.py
Created March 23, 2023 01:11
Outlook Exporter
#!/usr/bin/env python3
import argparse
import datetime
import getpass
import os
import re
import exchangelib
@lordjabez
lordjabez / doc-finder.py
Last active May 5, 2023 04:08
Query the Scripps physician API to find available doctors
import json
import requests
url = 'https://www.scripps.org/physicians.json'
params = {
'api': 'provider_search',
'location': 'location-61-scripps-clinic-rancho-bernardo',
'skill': 'synonym-1-primary-care',
'age_group': 'adults',
@lordjabez
lordjabez / get-access-token.py
Last active May 16, 2023 14:52
Get an OAuth2 access token with Python
#!/usr/bin/env python3
# pip install beautifulsoup4 keyring pyjwt requests
# ./get-access-token.py $auth_domain $client_id $api_name $username
import getpass
import sys
import time
import urllib.parse
@lordjabez
lordjabez / terraform-files
Created May 24, 2023 19:45
Run terraform against a set of files
#!/usr/bin/env python3
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('--files', action='append')
file_arguments, other_arguments = parser.parse_known_args()