Skip to content

Instantly share code, notes, and snippets.

View infinitewarp's full-sized avatar
🐍
making things

Brad Smith infinitewarp

🐍
making things
View GitHub Profile
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : "0.6235294",
"Red Component" : "0.4470588",
"Blue Component" : "0.8117647"
},

US Retirement Investing

Disclaimers!

I am not a lawyer! I am not a certified accountant, economist, investment authority, or "financial advisor" in any formal capacity! This information is provided purely based on personal anecdotes and recollections, and I cannot guarantee the accuracy or validity of any of it. How you choose to handle your money and investments is entirely your own choice and your own risk. Caveat emptor!

your money your problems

Now with that out of the way...

@infinitewarp
infinitewarp / mysql exclusive lock.md
Last active September 6, 2016 16:39
simple steps to cause an exclusive lock in mysql
  • open shell 1 to the database and run the following to create a table and start a new transaction:
create table foo (id integer primary key);
commit;
begin;
  • open shell 2 to the database and run the following to ensure you see the table and start a new transaction:
describe foo;
begin;
@infinitewarp
infinitewarp / minecraft-region-minmax.py
Last active November 25, 2016 20:06
Get potential full size of a map from a list of Minecraft region files
from __future__ import print_function
import re
from sys import argv, exit
pattern = r'.*r\.(-?[0-9]+)\.(-?[0-9]+)\.mca$'
matcher = re.compile(pattern)
north, south, east, west = None, None, None, None
>>> from openpyxl import load_workbook
>>> wb = load_workbook('callsheet.xlsx')
>>> wb.get_sheet_names()
[u'QuickbooksToPodio']
>>> ws = wb.get_active_sheet()
>>> ws.title
u'QuickbooksToPodio'
>>> print "first row has {} cells".format(len(next(ws.rows)))
first row has 12 cells
@infinitewarp
infinitewarp / DDLC-extract-archives.ipynb
Created December 16, 2017 05:29
Jupyter notebook file to extract the archives in Doki Doki Literature Club
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@infinitewarp
infinitewarp / cloudigrade.sh
Created June 4, 2018 13:37
shell environment setup script for cloudigrade
cd ~/projects/cloudigrade
[ -z $VIRTUAL_ENV ] || deactivate 2>&1 >/dev/null
workon cloudigrade
export DJANGO_SETTINGS_MODULE=config.settings.local
export AWS_PROFILE=cluster
unset \
AWS_ACCESS_KEY_ID \
@infinitewarp
infinitewarp / data-export-request-howto.md
Last active November 25, 2019 15:54
general overview of the data export requests API

Data Export Request API

What is this?

The "data export request API" enables a Koku customer to request an export of some of the data in Koku's database that originated from sources/providers managed by that customer. The export generally includes results from Koku's "daily" and "daily summary" database tables and are generally bound by specific requested dates. Exported files are separated by Koku account, source/provider, date, and table name. These files will be written by Koku to an AWS S3 bucket that the customer specified in the request.

Upon initial request, Koku gives the customer a synchronous response to indicate that it has started the process, but the remainder of the operations are asynchronous. The customer must check back at the API if she wants to see the current state of her data export request.

Where does it live?

@infinitewarp
infinitewarp / sqs-dump.py
Created August 18, 2021 17:46
crude sqs message dumper for stage-celery
import boto3
import base64
import pathlib
import datetime
write_path = f"/tmp/messages/{datetime.datetime.now().isoformat().replace(':', '.')}/"
print(f"will write messages into {write_path}")
pathlib.Path(write_path).mkdir(parents=True, exist_ok=True)
max_batch_size = 10
@infinitewarp
infinitewarp / get-cloudigrade-pod-logs.sh
Last active August 18, 2021 18:01
crude openshift pod log scraper
#!zsh
# get all current cloudigrade pods logs
PROJECT="cloudigrade-stage"
#PROJECT="cloudigrade-prod"
#PROJECT="cloudigrade-ci"
oc project "${PROJECT}" || exit $?
DATEDIR=$(gdate -u "+%Y-%m-%dT%H.%M.%S")
DIRNAME="logs-$PROJECT-$DATEDIR"