I hereby claim:
- I am wizpig64 on github.
- I am wizpig64 (https://keybase.io/wizpig64) on keybase.
- I have a public key whose fingerprint is 6016 B48F AEB7 63A1 795D 4F21 7152 1B32 B98F 5636
To claim this, I am signing this object:
from base64 import b64encode | |
from datetime import datetime | |
import hashlib | |
from time import time | |
class SecretHash: | |
r"""Hash a privately known SECRET_KEY with a public expiration time. | |
Meant to be used in places where sensitive commands must be sent | |
over GET requests, which are inherently publicly accessible. |
from base64 import urlsafe_b64encode | |
from urlparse import parse_qs, urlsplit, urlunsplit | |
from urllib import unquote, urlencode | |
from django.conf import settings | |
from django.core.files.storage import Storage | |
from django.core.files.storage import FileSystemStorage | |
from secret_hash import SecretHash |
#!/bin/bash | |
#searches for $COMMAND in ps. if its found, switch to it using wmctrl, else start a new one. | |
#if any arguments are made ($@), $COMMAND will be run with them even if it's already running. | |
#tip: bind this to a spare mouse button with xbindkeys | |
#tip: save this as /usr/local/bin/terminator to override the command in /usr/bin using $PATH ordering. | |
#requires wmctrl. currently set up for terminator but could be used for any process. | |
COMMAND="/usr/bin/python /usr/bin/[t]erminator" | |
PID=`ps aux | grep "$COMMAND" | awk '{print $2}' | head -1` | |
if [ -z $PID ] || [ ! -z "$@" ] |
-- This is an implementation of a one-to-one relationship between two tables in PostgreSQL, as well as a view that | |
-- presents the two as a single table, accepting INSERTs, UPDATEs and DELETEs just like a flat table would. | |
-- One thing that may or may not be noteworthy is how foo.id's sequencer is manually incremented even when the user | |
-- specifies a non-null value. I needed this for my project (MS-Access was throwing a fit), but it may not be the | |
-- default behavior for serial primary keys. | |
-- todo for UPDATE and DELETE: it's possible that a foo exists without a bar relating to it. currently, UPDATE and | |
-- DELETE could be used to mess with rows on foo that shouldn't be messed with (for example they could be rows with | |
-- different one-to-one relationships). This won't matter for most applications, but it allows for some potentially | |
-- malicious actions that should be caught. |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
"""zfsdiff.py - show the size difference between replicated pools. | |
It will also attempt to guess how many days behind replication is, | |
and output will go to stderr rather than stdout if difference > threshold, | |
so you can run receive alerts when things get too far behind. | |
""" | |
from __future__ import print_function, unicode_literals | |
import re |
# assembling a list the old way | |
def do_stuff(x, y, z): | |
l = [] | |
l += do_x(x) | |
l += do_y(y) | |
l += do_z(z) | |
return l | |
# assembling a list with generators (much easier to read!): |
// credit_karma_1099B_csv.js | |
// copyright Phillip Marshall 2019-2023, except line 31, with help from kirill578 | |
// --- README --- | |
// Cash App offers a free tax filing service (formerly under Credit Karma's brand), | |
// but requires you to enter Capital Gains and Losses manually in 'Spreadsheet entry' mode. | |
// This script implements the missing CSV import feature for 1099-B gains and losses. | |
// The csv this was based on came from a wealthfront xls, exported with mm/dd/yyyy dates and NO HEADER. |
import json | |
from pathlib import Path | |
from django.core.management.base import BaseCommand | |
from django.utils.module_loading import import_string | |
from rest_framework.fields import Field | |
from rest_framework.metadata import SimpleMetadata | |
from rest_framework.routers import BaseRouter as Router | |
from rest_framework.schemas.openapi import AutoSchema |