Technical notes, my online memory
Monday, October 26, 2015
Return a new return_value for each call when mocking tempfile in python
›
Here is a python snippet that mocks out tempfile.NamedTemporaryFile() to use a StringIO and add it to an array of file handles. The somewh...
Debugging pyinstaller binary install missing import "ImportError: No module named google.protobuf"
›
We were missing an import in our pyinstaller, the error was: ImportError: No module named google.protobuf There is a simple fix for this...
Thursday, September 17, 2015
Patching a python class attribute in a unit test using mock
›
I often want to change a class attribute in a unit test. While it is sort of documented in the official documentation , it's missing an ...
Friday, September 4, 2015
Snippet for verifying a SHA256 hash of a downloaded file in bash
›
This snippet will download openssl and verify the hash against a hard-coded value. This is useful on old operating systems (specifically Cen...
Tuesday, August 4, 2015
Provisioning a RHEL GCE machine with packer "sudo: sorry, you must have a tty to run sudo"
›
RedHat has long had an insane requiretty default for sudo , something that is fixed in later versions. Packer rightly doesn't set a tty ...
Thursday, July 30, 2015
Docker cheat sheet
›
Intended as a living document, just some basics for now. Build from the Dockerfile in the current directory and tag the image as "dem...
Docker vs. Vagrant
›
Docker and Vagrant are somewhat similar technologies, so what are their relative strengths and weaknesses and when should you choose one ove...
‹
›
Home
View web version