Python Cryptography Module

Note: I’m writing from a Python 3.5 perspective.

There are a few different options for doing cryptographic stuff with Python. I have landed on the cryptography module which has been working out pretty well for me so far. Here is a short account of how I ended up there…

Continue reading “Python Cryptography Module”


Not Gandalf

But you’d be forgiven for thinking so.

It is Alexander Grothendieck (1928-2014), who was a famous mathematician in the area of algebraic geometry. Born in Berlin, his father was Alexander “Sascha” Schapiro (aka Sascha Tanaroff), an anarchist and descendent of bourgeois Hasids from Novozybkov, Russia, near the modern-day borders with Belarus and Ukraine. Grothendieck’s mother was Johanna “Hanka” Grothenieck, also an anarchist and a descendant of middle-class German Protestants from Hamburg. 

Grothendieck survived the Second World War and entered academia as a mathematician, making significant contributions in the area of algebraic geometry. He eventually became convinced that mathematics was immoral, and descended into a madness of religious passion. One presumes that the photograph above is from this later period. 

Via Cliff Pickover on Twitter

See also:

Playing DVDs on Ubuntu 16.04 LTS

DVDs did not play out of the box on my Ubuntu Desktop 16.04 LTS machine. I was able to fix this by doing the following.

First, entered the command:

$ sudo apt install libdvd-pkg

After the package and dependencies finished downloading and installing, it launched a short guided prompt sequence. I answered yes to all prompts — the only one really worth paying attention to was a choice to have the thing automatically update itself. It sounded like it has to build itself from source every time or something, so I guess it is a little non-standard in this regard. The prompts then told me to run the following command, which I did:

$ sudo dpkg-reconfigure libdvd-pkg

This popped up another little pseudo-graphical terminal prompt screen which, if I recall correctly, just asked me if I wanted to install the thing, which I answered in the affirmative.

After I completed these steps, all was well and I can now play the two DVDs I have tested without any problems.

I discovered this fix via a page on the Ubuntu wiki, RestrictedFormats/PlayingDVDs. According to the wiki, the actual software package that does the work is called libdvdcss2, and the libdvd-pkg package is a convenience package that makes the install easier.

Non-breaking hyphens in Microsoft Word

I’ve encountered a weird little use case for non-breaking hyphens in Microsoft Word, and I have found the way to do it at this blog entry at Allen Wyatt’s Word Tips: Ctrl+Shift+- (or Ctrl+_).


The non-breaking hyphen is used to keep a hyphenated phrase together across a line break. So, for example, the phrase “non-breaking” when occurring at the end of a line would not do this:


Curated lists on Github

There are a large number of list repositories on Github spanning dozens of subjects. There is a sort of in-joke in the naming convention: they are for the most part named “awesome-{topic}” e.g. awesome-sysadmin. Someone (bayandin) on Github totally beat me to this, but here’s a partial list (unfortunately in no particular order at this time):

tools of the trade
vim and tmux
android (JStumpp)
big data
swift (Wolg)
data science
machine learning
front-end development
public datasets
web performance optimization
computer vision
mac OS
working remotely
C (not github)
MaterialDesign (google UI visual design philosophy)
UI motion library animations
interview questions
bioinformatics, machine learning, data science, related languages
application security
natural language processing (NLP)
swift education
nodejs (vndmtrx)
internet of things (IoT)
information security (infosec)

Installing Visual Studio Code on Ubuntu 16.04 using dpkg

Yesterday I posted a note about manually installing the Atom editor on Ubuntu 16.04 using dpkg. A friend recommended that I try out Visual Studio Code for Python development, and I was pleased to discover that it is available in a .deb package for install on Linux. I used the same command to install the VS Code .deb:

foo@manchoo:~/Downloads$ sudo dpkg -i code_1.4.0-1470329130_amd64.deb 
[sudo] password for foo: 
Selecting previously unselected package code.
(Reading database ... 303742 files and directories currently installed.)
Preparing to unpack code_1.4.0-1470329130_amd64.deb ...
Unpacking code (1.4.0-1470329130) ...
Setting up code (1.4.0-1470329130) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...


Using dpkg to install a local .deb file

The Atom editor is not available via the Ubuntu software repository (i.e. via the apt tool), so it has to be installed by downloading the .deb file (e.g. atom-amd64.deb) and then manually installing. I have had some trouble with the Ubuntu GUI software manager, Ubuntu Software (I am running Ubuntu 16.04) so I prefer the command line when possible.

In order to “manually” install the .deb file I referred to this entry, which worked perfectly. My terminal session, from the directory containing the .deb file:

foomanchoo@foomanchoopc:~$ sudo dpkg -i atom-amd64.deb
Selecting previously unselected package atom.
(Reading database ... 299299 files and directories currently installed.)
Preparing to unpack atom-amd64.deb ...
Unpacking atom (1.9.8) ...
Setting up atom (1.9.8) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...

And that’s it. No dependencies, it just installed. See also this unix.stackexchange entry.

Virtualenv, a python tool

From the docs:

virtualenv is a tool to create isolated Python environments.

The basic problem being addressed is one of dependencies and versions, and indirectly permissions. Imagine you have an application that needs version 1 of LibFoo, but another application requires version 2. How can you use both these applications? If you install everything into /usr/lib/python2.7/site-packages (or whatever your platform’s standard location is), it’s easy to end up in a situation where you unintentionally upgrade an application that shouldn’t be upgraded.

Or more generally, what if you want to install an application and leave it be? If an application works, any change in its libraries or the versions of those libraries can break the application.

Also, what if you can’t install packages into the global site-packages directory? For instance, on a shared host.

In all these cases, virtualenv can help you. It creates an environment that has its own installation directories, that doesn’t share libraries with other virtualenv environments (and optionally doesn’t access the globally installed libraries either).