Skip to content

Instantly share code, notes, and snippets.

View patrickmmartin's full-sized avatar

Patrick Martin patrickmmartin

View GitHub Profile

Table Test

Heading Heading Heading
cell cell cell
cell cell cell
cell cell cell
cell cell cell
@patrickmmartin
patrickmmartin / PYTHON_DEFAULT.md
Created February 5, 2017 09:48
update-alternatives for python3 on Ubuntu

Ubuntu 16 default python is almost python 3

Loads of solutions exist, but for changing the system default, alias is not the way to go.

$ update-alternatives --list python update-alternatives: error: no alternatives for python

@patrickmmartin
patrickmmartin / LogAdapter.py
Last active December 14, 2016 23:32
LogAdapter musings
import unittest
import logging
import logging.config
class CustomAdapter(logging.LoggerAdapter):
"""
This example adapter expects the passed in dict-like object to have a
@patrickmmartin
patrickmmartin / locktest.py
Last active December 6, 2016 09:54
python locktest
# locktest.py
import os
import fcntl
import time
import random
pid = os.getpid()
i = 10
@patrickmmartin
patrickmmartin / PythonLogging.md
Last active December 6, 2016 08:58
Python logging
Comments on Handling Disappointment by DK
===
Version 07/11/2016
---
### In general
JL is right about a pass being needed on grammar and proof reading. No biggie, but there are some bloopers.
@patrickmmartin
patrickmmartin / DISAPPOINTMENT_COMMENTS.md
Created December 3, 2016 12:51
Disappointment comments
  1. In the last paragraph of the introduction, you seem to dismiss exceptions, as a solution or error reporting and logging, out of hand. Why? BTW, I don't agree with you that returning status is a bad thing, especially at a low (e.g., "the system" level, but that is another matter.
  1. TODO(PMM) check what is going on here?
@patrickmmartin
patrickmmartin / ERROR_TAXONOMIES.md
Last active December 12, 2016 17:03 — forked from anonymous/ERROR_TAXONOMIES.md
error taxonomies

Error Taxonomies

Some notes on the way people create taxonomies of errors.

Overview of basic approaches

bool return status

TODO(PMM)

@patrickmmartin
patrickmmartin / TASK_QUEUE_DESIGN.md
Created November 5, 2016 22:56
Thoughts on the tasks queue concepts

Task Queue Design

Precepts

  • migrations decomposed into single dataset item updates
  • individual migrations are not precious as they can be trivially re-created
@patrickmmartin
patrickmmartin / GRUB_FIXES.md
Last active October 30, 2016 16:20
Grub fixes?