I hereby claim:
- I am jnhmcknight on github.
- I am jnhmcknight (https://keybase.io/jnhmcknight) on keybase.
- I have a public key whose fingerprint is 6354 4B36 99BD 04CC 56B2 63F1 D2C8 64A5 BAC3 1834
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
from flask import Flask | |
import logging | |
import boto3 | |
import os | |
from copy import deepcopy |
#!/usr/bin/env python | |
# Concept taken from http://code.activestate.com/recipes/527747-invert-css-hex-colors/ | |
# Modified to take the css filename as an argument and also handle rgb() and rgba() values | |
# | |
# To run: | |
# python ./colour-inverter.py <path/to/file.css> | |
import os | |
import re |
#!/usr/bin/env python | |
""" | |
Usage: python ./inject_ca.py <path/to/new/ca.crt> [<path/to/other/new/ca.crt> [...]] | |
""" | |
import certifi | |
import os | |
import re | |
import sys |
""" | |
Utilities for use with Mandrill Webhooks | |
requirements: | |
- six | |
- email-reply-parser (git+https://github.com/atc0m/email-reply-parser.git#egg=email_reply_parser) | |
""" | |
import base64 |
#!/usr/bin/env python3 | |
"""Show subnets information. | |
Given an IP network in CIDR notation and the minimum number of desired subnets, | |
this script will provide the relevant information about the desired subnets. | |
Example: | |
$ ./subnet-divider.py 10.10.0.34/16 4 | |
$ ./subnet-divider.py fd3e:48fe:59b2:43ca::/64 15 |
-- show granted locks | |
SELECT blocked_locks.pid AS blocked_pid, | |
blocked_activity.usename AS blocked_user, | |
blocking_locks.pid AS blocking_pid, | |
blocking_activity.usename AS blocking_user, | |
blocked_activity.query AS blocked_statement, | |
blocking_activity.query AS current_statement_in_blocking_process | |
FROM pg_catalog.pg_locks AS blocked_locks | |
JOIN pg_catalog.pg_stat_activity AS blocked_activity ON blocked_activity.pid = blocked_locks.pid | |
JOIN pg_catalog.pg_locks AS blocking_locks |
#!/usr/bin/env python3 | |
""" | |
Add or update repo secrets based on the contents of one or more .env files | |
To run this, you will need: | |
- Python3 installed | |
- have created a personal access token with the relevant privileges within GitHub | |
- copied this gist into a file named `repo-secret.py` | |
- and complete the following: |
""" | |
This requires that you have versioning enabled on the S3 bucket. Without that, this script cannot do anything useful. | |
Install Dependencies: `pip3 install boto3 click dateparser pytz` | |
Run it: `python3 ./s3.py bucket-snapshot [OPTIONS] BUCKET-NAME UTC-DATE-TIME DESTINATION-FOLDER` | |
""" | |
import json | |
import os |
#!/usr/bin/env python3 | |
""" | |
This takes a JSON file of your current debts, and does a rollover calculation to see how long it will | |
take to pay off all of it, based on clearing the smallest debt first and merging that payment into | |
the next smallest debt's payment, and then repeating that process until all debts have been paid. | |
This calculator assumes that you are not increasing any of the debts in any way (ie: not still using | |
your credit card or credit line to pay for any things.) | |
Save this file locally, and run: |