Skip to main content


Showing posts from January, 2013

The greatest Google Mail feature you may not be using stopped working

Some time ago I published an incredibly popular post called The greatest Google Mail feature you may not be using. It showed how selecting text in a message and hitting reply caused just the selected text to be included in the reply. This is a great feature because it cuts down on recipients having to wade through gigantic messages and shows what you were actually replying to.

Some time last week this feature stopped working for many people. Including me.

To reenable you need to go to Labs in Google Mail. To do that, first go to Settings. And find Labs. Scroll down until you find the following entry called "Quote Selected Text".

Enable it and hit the Save Changes button.

Integrating OpenSSL crypto functions with Go

In a previous post I pointed to my go-openssl project that provides alternative implementations of crypto/rc4, crypto/md5 and crypto/sha1 based on OpenSSL's libcrypto. To make these easy to use (and to allow Go itself to use them for crypto/tls) I've added a bootstrapping Makefile to the project that builds Go itself with the OpenSSL implementations integrated.

To use it just do make in the integrate directory. It will create a go subdirectory with a full build of the latest version of Go form Mercurial incorporating the OpenSSL implementations. Doing make tester will build a small tester program that exercises the new hash and cipher implementations.

Since this was a slightly complex task (requiring the assistance of minux) I wrote a large comment in the Makefile. If anyone else needs to patch Go itself they might run into similar things:
# This target modifies the Go installation in the following ways: # …

Lua implementation of Aho-Corasick string matching

The Aho-Corasick string matching algorithm is a fast way of matching a large number of strings against  a source document. It consists of two stages: building of a special suffix tree and then matching against the tree. The algorithm is linear in the size of the source document (and number of matches) and matches all strings in the dictionary simultaneously and outputs them.

It is particularly helpful when a large dictionary of strings needs to be matched against a document. For example, it can be used to match a dictionary of known virus signatures against a suspicious executable. And it's possible to build the suffix tree ahead of time when the dictionary is fixed.

I needed a Lua implementation of the algorithm for a project and have created one (with a test suite) and released it here. There are two functions: build (which takes an array of strings, the dictionary, and returns the tree in the form of a Lua table) and match (which finds matches in a string given a tree). Since …

GMSL v1.1.3 Released

I've released v1.1.3 of my GNU Make Standard Library. Changes in this release are:

1. New sequence function which returns sequence of numbers. For example, $(call sequence,1,5) returns 1 2 3 4 5 and $(call sequence,5,1) returns 5 4 3 2 1. That was Feature Request #3. If you have a feature idea for GMSL please submit it.

2. Support for GNU Make 3.82 was added. Specifically, the associative array and named stack functions will now report an error if a name or key value has a space in it on GNU Make 3.82. Also, fixed Bug #11: memoize wasn't working on GNU Make 3.82.

3. Fixed Bug #12: the associative array set function was broken if the array or key name had a / in it.

If you are serious about GNU Make check out my book "GNU Make Unleashed". If you are unfamiliar with the library check out the documentation. The GNU Make Standard Library (GMSL) is a collection of functions implemented using native GNU Make functionality that provide list and string manipulation, integer…

Calling OpenSSL libcrypto functions from Go

I've released on github three Go packages that present the same set of functions as crypto/md5, crypto/sha1 and crypto/rc4 but that use the OpenSSL libcrypto functions instead of the native Go implementation.

Testing by sending 4.4GB of data through these three functions yields the following results (the test document was the King James Bible concatenated 1,000 times and sent to MD5, SHA1 and RC4 in 4.4MB chunks). All tests were done using go version devel +7dc8d66efb6d Mon Jan 21 10:53:39 2013 +1100 linux/amd64.

MD5SHA1RC4Native Go404 MB/s123 MB/s111 MB/sVia OpenSSL607 MB/s636 MB/s744 MB/sSpeedup1.5x5.2x6.7x
These packages provide the same interface as the native Go implementations and should be drop in replacements. libcrypto must be available. The code is available in my go-openssl repository.

PS As this is the first time I've written any cgo code, I'd be happy to hear from more experienced Go programmers about improvements to my wrappers.

PPS As a comparison here is t…

Archived posts from "Double Stealth"

For a short while I wrote a blog called "Double Stealth" based around a fictional character called Brad Bradstone that I'd invented here.  I decided to shut down the blog (and a lot of other things) to make space in my life, but here are the archived entries for those who've asked.

Thursday, August 2, 2012 - Brad's ToBe List

A lot of people spend time making ToDo lists. ToDo lists are a fools errand, they're nothing but a measurable, actionable list of tasks. People mindlessly checking off tasks completed think they are working to some great future result, but what are they really doing? They're marking time; a steady drum beat of 'done!' onwards to the grave.

What you should be making is a ToBe list.

A ToBe list is a list of people to be in the future. It's a true list of goals, not a list of items to be checked off, but a list of vague, fluffy, unmeasurable states of mind and body. The beauty of a ToBe list is you never check things off, you…