It's been ages since I've blogged. I guess now is a nice time to get back on track, both here and on indiebiotech.com. I have been far from idle! However, much of my work has been biotech-related, which belongs yonder on indiebiotech, so I'll just share some of my non-biotech pet projects here for now.
In response to ongoing attempts to regulate “Unfettered Commentary” in Ireland, I wrote a peer-to-peer microstatus server/client in 30 lines of Python, in the hopes of making a similar point to the 15-line TinyP2P app written in response to P2P regulation attempts in 2004. That little gem is included in the Repo because the original post is no longer online except on Archive.org. (My extra lines are spent on local database management and try/except functions to prevent trivial network crashing)
The code is over on Gitorious/Github, if you're interested. I sometimes host a test server and announce on Twitter when I do, but to date nobody has ever posted. One guy ran a curl script to “DDOS” me with nonsense HTTP GET requests for laughs, which is how the internet works and gave me a giggle.
Still, it was very instructive learning how to compress code in that way, particularly in a language that really doesn't want you to make ugly code; Python's philosophy includes “Explicit is better than Implicit”, so ugly oneliners are discouraged. However, Python also doesn't stop you from doing things you want to do, so it ended up working well in the end. Of course, it was a PITA to debug, because when you use mostly lambda functions, the error messages when things go wrong are inscrutable. To get it working, I had to refactor the code into normal multi-line functions first, and then individually revert each to ugly one-liners. Finding ways to crunch code was helped in part by this thread on Stackoverflow, but moreso by decoding TinyP2P and figuring out how it worked. The annotated version of TinyP2P I made is included in the repo, too.
When I have more time to waste on this, I plan to rewrite the whole thing in explicit and more-efficient “normal” Python. There's plenty that could be improved if brevity isn't the aim, after all; it's exceptionally inefficient right now.
Of course, it's no replacement for a “real” microstatus system yet, because there's no form of user authentication to prevent anyone from posting in the name of another; for that to work in a P2P model, there'd need to be a form of asymmetric key authentication coupled with efficient key exchange to rapidly establish a “globally unique” key:name mapping, which implies an efficient distributed datastore; a DHT. As the Python standard library contains neither asymmetric encryption (why?) nor a DHT implementation, this wasn't an option, and in any case it'd have added another 10 lines even in a perfect world.
A DHT-based asymmetric key Microstatus client is something I'd like to see written, though, and perhaps I'll waste some time on that someday when there's enough to spend. I'd like to learn more about DHTs by hacking one up; there aren't any implementations in Python 3 that I can find so far.
My efforts to leave Google have stepped up, thanks to my establishing a stable email address to use elsewhere.
After dickering around with self-hosting and discovering that there are almost no turn-key open-source email systems in existence that wouldn't be a pain to debug, and after deciding that reliability was a big concern in Ireland (land of the blackouts), and after discovering how horrid the anti-spam environment is on small self-hosters, I gave up on that idea entirely.
So, I turned to the hosts of my two blogs, 1984hosting.com to host my email for me, and initially it didn't work; their help docs were technically incorrect and the port numbers I was trying wouldn't (at the time) work with encryption, so I gave up and waited. A few months later though, I was able to set up IMAP and SMTP with encryption on mail.1984.is, their mail subdomain (also their webmail domain for on-the-go access), and started using my new address at cathalgarvey.me.
I'm after redirecting all my subscriptions and changing all my big accounts to the new address, and today I'm setting an autoreply to redirect people using my old address. It's remarkably easy if you're patient: just forward mail from the old address and change subscriptions you've forgotten about as they arrive. Set your signature to include your new address for a while, then set an autoreply when most or all of your frequent mailers have already switched.
If you want to change to Icelandic hosting, too, just register a domain for yourself, sign up for 1984hosting's cheapest plan, point the domain to 1984hosting.com, set up an email address in the 1984 control panel, and use these settings in your email client (Claws, Thunderbird, whatever):
IMAP Server: mail.1984.is IMAP Port: 993 IMAP Auth: SSL/TLS with normal password authentication SMTP Server: mail.1984.is SMTP Port: 587 SMTP Auth: STARTTLS with normal password authentication. Username: full email address (firstname.lastname@example.org) Password: your -email address- password
The Great MP3 Purge
MP3s suck. They used to be the hotness of the music world, because they were probably the best music compression format available for a while, but they are no longer up to standard. Not only is the compression bad in comparison to other music formats such as OGG Vorbis, but the quality to compression ratio in listener tests is poorer, so they just don't deliver much for the space saving they offer.
Finally and most insultingly to me, they operate on a patented codec which cannot be decoded without a “licensed” decoder, meaning that if I want to write software that plays MP3s, I have to go beg for a license and fork out huge money; that is a big burden on the open source community's efforts to create rich media experiences for the world.
You hit this roadblock when you install a fresh Linux distribution on your computer; unless you check a box saying “Install restricted extras” (in so doing you are saying “I have a license or I live somewhere where software patents haven't insinuated themselves yet”), you can't play mp3 or h264 media files because both are patented codecs. It's trivial to ignore and just click the “Install restricted extras” box, but it's a small burden on the soul that you're capitulating to a system that, broadly speaking, is used to crush innovation.
So, I elected this year to do two things as New-Year's-Resolutions: firstly, to purge my biggish music library of MP3s and replace them with better, smaller, freer music files, and secondly to never again buy music from Artists licensed by big media companies who are crushing free speech and thought in Ireland. Sorry Artists; you guys may not be directly to blame, but buying your music supports evil, evil people who are making my life less free.
Both goals are possible in 2013. It's no longer necessary to have MP3s unless you're an Apple user (in which case you've dug your dirty technophobic grave and can go lie in it), because Android plays FLAC and OGG Vorbis out of the box, as does Linux (although codecs for Windows Media Player and other Windows media software for both should be trivial to install if you're a Windows user). Also, music distribution is finally moving on from RIAA et al; Bandcamp offers a very slick way to download music in any format of your choosing including FLAC/OGG without paying any money to evil middlemen, and more and more artists are either self-hosting or sharing on bittorrent trackers. For a while, there was a nice service called riaaradar.com for checking artists for affiliation with the RIAA and its global cabal, but that appears to be down.
Of course, just because it's trivial never to buy another mp3 or RIAA track, it doesn't follow that it's easy to backtrack and remove legacy mp3s. It's an ongoing project. I'm complicating things for myself by refusing to re-purchase albums that I've long since lost so I can re-encode them, and I've had to dip into second-hand CD sales on Ebay to track down music I value and want to convert. But on the whole, it's simply time-consuming. I'd talk more about the process, but normal day-to-day culturally important activities are sometimes illegal. I'm sure my good reader knows many channels of distribution through which one might acquire copies of music one has already legally purchased.
To help me focus on replacing artists whose music I have a lot of, I write a quick python script that, given a directory and a filetype, recurses into the subdirectories, counts all the files whose filename contains the search pattern (optionally restricted to file extensions only) and reports back with a list of top-level folders and the number of files it found in each. So, calling the program as “fncensus -x ~/Music “mp3”” will return a list of artists who need replacing. If you're interested, it's hosted here on Github.
I've spammed enough for now; no longer a guilty blogger. More as it arises; I have a number of fun projects I'd like to pursue soon, including building a Data Furnace to supplement our home heating (and mine bitcoins or crunch rainbow tables or something), if I can afford the initial hardware outlay.