Skip to content

Instantly share code, notes, and snippets.

Avatar
🐍
making things

Brad Smith infinitewarp

🐍
making things
View GitHub Profile
@infinitewarp
infinitewarp / get-cloudigrade-pod-logs.sh
Last active Aug 18, 2021
crude openshift pod log scraper
View get-cloudigrade-pod-logs.sh
#!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"
@infinitewarp
infinitewarp / sqs-dump.py
Created Aug 18, 2021
crude sqs message dumper for stage-celery
View sqs-dump.py
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 / data-export-request-howto.md
Last active Nov 25, 2019
general overview of the data export requests API
View data-export-request-howto.md

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 / cloudigrade.sh
Created Jun 4, 2018
shell environment setup script for cloudigrade
View cloudigrade.sh
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 / DDLC-extract-archives.ipynb
Created Dec 16, 2017
Jupyter notebook file to extract the archives in Doki Doki Literature Club
View DDLC-extract-archives.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View example
>>> 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 / minecraft-region-minmax.py
Last active Nov 25, 2016
Get potential full size of a map from a list of Minecraft region files
View minecraft-region-minmax.py
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
@infinitewarp
infinitewarp / mysql exclusive lock.md
Last active Sep 6, 2016
simple steps to cause an exclusive lock in mysql
View mysql exclusive lock.md
  • 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;
View investing.md

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...

View iterm-profile.json
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : "0.6235294",
"Red Component" : "0.4470588",
"Blue Component" : "0.8117647"
},