Aug 22, 2016

NSA’s 2016 Puzzle Periodical - August Solution (Part 1)

This month’s NSA Puzzle periodical can be found here. It’s a 2 part puzzle, and I’ve only solved the first one so far, so this will be a 2 part post.

The copyright status of the actual puzzle text is unclear, so this is a paraphrase.

Ava and Bruce are playing a game. They each take a random card from a standard deck of cards, put their card on their forehead (so the other person can see it), and then write down a guess for which colour their own card is. If one of them guesses correctly ...

read more
Aug 15, 2016

Automatically Connecting to VPN Using nmcli

Maybe it’s a bug, but on certain connections listed in Network Manager’s GUI, I can’t enable “Automatically connect to VPN when using this connection”. I can click the checkbox and select a VPN, but the “Save” button on the dialog box stays disabled. It works fine for my home’s WiFi, but not for my university’s (which uses WPA2 Enterprise, if that’s relevant at all).

Update: Turns out I was missing the CA certificate and that’s why the Save button was disabled; it’d be nice if Network Manager would tell you which field ...

read more
Aug 02, 2016

Using a Metaclass to Keep Track of Subclasses

A few days ago I read Eli Bendersky’s blog post titled “Fundamental concepts of plugin infrastructures” which covers 4 fundamental aspects of any plugin infrastructure. It’s a great article, and it gives an example in Python which implements the concepts he talks about. One aspect of his example I’d like to focus on in this post is how he uses a metaclass to allow plugins (which are subclasses of a class using the metaclass) to register themselves in the system.

The following code is what I’ll be talking about:

class Registry(type):
    entries = []
    def __init__(cls ...
read more
Jun 03, 2016

How Do I __________ in Git

This is a compilation of common questions about git that I’ve seen online or have encountered myself. This is a work in progress, so organization isn’t that great.

For all of these, it’s a very good idea to read the man pages before running them to ensure it will do exactly what you need done.

Undo a merge

git reset --hard ORIG_HEAD

Explanation: git reset will reset the HEAD to the specified commit, which in this case is ORIG_HEAD. This will be a reference to the commit right before the merge since git merge saves the old ...

read more
Jan 12, 2016

Bring IPv6 Tunnel Up On Network Connection

This post is aimed at setting up a Hurricane Electric IPv6 tunnel on Ubuntu, but it should be adaptable to other Linux distributions as long as they’re using Network Manager.

Firstly, you need to install the necessary packages: curl and optionally wireless-tools. The latter provides the iwgetid utility, but I’ll mention an alternative in the scripts below.

Assuming you’ve already set up a tunnel on, you should get some details from the ‘Tunnel Details’ page:

  • ENDPOINT is listed as ‘Server IPv4 Address’.
  • ADDRESS is the ‘Client IPv6 Address’
  • GATEWAY is the ‘Server IPv6 Address’
  • TUNNELID ...
read more
Page 1 of 10