Instantly share code, notes, and snippets.

Break input data into chunks and use 'dmtxwrite' to create a DataMatrix 2D
barcode for each chunk. Dump all these into an HTML page for easy printing.
The size of the chunk depends on the target size of the barcodes; see
Intended for making hard (paper) copies of small but highly important data,
like GPG keys, that can be retrieved faster and more reliably (one hopes) than

This is an unmodified selection of code I wrote for and under contract to AT&T, so AT&T holds all copyright.

AT&T released it to the public under the terms of the Apache 2.0 License (as described in license headers in the source code) as part of a larger body of work.

I retrieved these copies from their public repositories on 1/9/2018 after I was no longer under contract to them. I am hosting it here in compliance with the terms of their license. The links below point to AT&T's public repositories.

  •, a simplistic Requests-based wrapper for the Ceph RADOS Object Gateway Admin Operations API.
  •, a little context manager to make it easy to perform some function within a temporary director

I agree with Guido, in that I think

[ x * 2 for x in some_list if x < 12 ]

is much easier to read than the equivalent

map(lambda x:x * 2, filter(lambda x:x<12, some_list))

Configuration options used by S3BotoStorage and S3Boto3Storage

This is a list of common and divergent configuration options for django-storages' boto backends:

  • storages.backends.s3boto.S3BotoStorage
  • storages.backends.s3boto3.S3Boto3Storage and

Created to cope with the documentation which reads:

"Available are numerous settings. It should be especially noted the following:"


Keybase proof

I hereby claim:

  • I am datagrok on github.
  • I am datagrok ( on keybase.
  • I have a public key ASCrSLf3jYbRq3V0I7pJgP1UEqtjxqqP5iTBLfN5VXNq-Qo

To claim this, I am signing this object:


A home photo and video management system

I want some tools to help me manage my photos and videos, conforming to some of my particular requirements.

I've already begun tinkering on some of my own, but with every line of code I think, "surely, someone must have done this already." Have you?


  • Backup. I have a local fileserver, but I want offsite backup too. Backblaze B2 looks cheapest but I also already have a DreamObjects account.
  • A thing to make it effortless to get photos off devices and into long-term storage.

Refactoring from an overuse of **kwargs


def a(**kwargs):
  if 'A' not in kwargs:
    kwargs['A'] = 1
  if 'B' not in kwargs:
    kwargs['B'] = 2
  success, result = b(**kwargs)

Basic Workflow


Different uses of git will have a different optimal workflow. This document describes a git workflow with the following characteristics:

  • It is a centralized workflow, meaning multiple developers all push to a shared repository. (As opposed to a fork-and-pull-request Github-style workflow.)
  • It is safe to use when collaborating on a feature branch with others, but requires no workflow changes when working alone. (So there's only one set of steps to remember.)
  • Some git users rely heavily on rebases, using them for any and all conflicts. This is an unhealthy coping mechanism born of past git merge trauma. This workflow relies heavily on merges, using rebase only when it is safe to do so (with commits that have yet to be pushed).
  • push --force is never needed (and may be disallowed by the remote repository.)
View WaitingProcessMonitor.tac
When you issue a SIGINT or SIGTERM to
twisted.runner.procmon.ProcessMonitor, its child processes get signalled
but it immediately disconnects from them and exits, even if they haven't
exited. This causes problems when we're trying to monitor a process that
has critical on-exit cleanup code.
This is a subclass modifying ProcessMonitor in such a way that it will
View definedoc.scm
; an imaginary syntax for docstrings. Goals:
; - runtime introspectable
; - DRY including explicit docs for each procedure
; argument, and its return value
; - hyperlinks in docstrings
; - executable code examples (doctests)
; - docstrings are rewrapped/formatted and docs for args
; and return value are formatted and appended for
; (procedure-documentation <proc>)