Command-line shuffle

Posted by Michael Giarlo on September 26, 2009

Being a nerd, I tend to like the command-line. When I'm working on my laptop at home, I tend to like listening to music. Before I discovered that mplayer had a really convenient shuffle idiom, I would invoke it thusly (to listen to all my Pavement tracks in shuffle mode):

export IFS=$'\n'
for track in $(find /mnt/upnp/MediaTomb/Audio/Artists/Pavement -name \*.mp3 | ~/bin/shuffle.py); do mplayer $track; done

And the wee shuffle script I whipped together looks like this:

#!/usr/bin/env python
# shuffle.py
 
import sys
import random
 
args = list(sys.stdin)
random.shuffle(args)
sys.stdout.writelines(args)

And here's the convenient shuffle idiom that renders my arg-shuffling script somewhat useless:

find /mnt/upnp/MediaTomb/Audio/Artists/Pavement -name \*.mp3 | mplayer -playlist - -shuffle -loop 0

JSONovich emerges

Posted by Michael Giarlo on August 24, 2009

JSONovich has now emerged from the Mozilla Add-ons sandbox and is available to the masses: http://addons.mozilla.org/en-US/firefox/addon/10122.

Lynx and HTTPS/SSL on Ubuntu (8.10)

Posted by Michael Giarlo on January 12, 2009

Dear Future Me,

It has been a while, hasn't it? Yes, it has[1].

Did you try to view an HTTPS/SSL URL in Lynx[2] again, only to be met, most cruelly, with the following error message?

$ lynx https://example.org/resource/[3]


Alert!: This client does not contain support for HTTPS URLs.

Well, have no fear! The lynx package, at least within the aptitude repositories for Ubuntu 8.10 (Intrepid Ibex), has no SSL support as you have just witnessed. The lynx-cur package, on the other hand[4], does! Support SSL, that is. Fix yourself thusly:

$ sudo apt-get install lynx-cur

N.B. the new lynx looks for its configuration in a different place than the old lynx, so you may need to fiddle with things if you've tricked out lynx with bells and whistles and racing stripes and nitrous boosts. Otherwise, huzzah!

Notes
  1. In the future you will have evolved beyond answering your own questions, no doubt, but here in the past, in this quaint and backwards era, it is quite common to hold conversations with yourself. Or myself. But I (i.e., you) digress! (We digress in the past as well! Quite the confusing state of affairs, conversationally speaking!) []
  2. Do they even have Lynx in that brave new world of the future? Does the lynx species still exist? Did the polar ice caps melt and wipe out all non-domesticated felines? Inquiring, unevolved minds of the past want to know! []
  3. I am assuming that in the future example.org remains a reserved dummy domain. []
  4. I hear that in the future hands will be replaced by hooks and detachable chainsaws and the like? []


JSONovich update

Posted by Michael Giarlo on December 29, 2008

JSONovich is now up to version 0.6. Recent revisions have added the following functionality:

  • Reads in JSON and converts to UTF-8 for some naive Unicode handling
  • Wraps long lines at the right edge of the window
  • Adds a check to see if a native JSON parsing library is already loaded (as will be the case in Firefox 3.1). Uses that library if so, otherwise loads the module included in JSONovich.
  • Handles JSON syntax errors more gracefully. Used to eat bad data and display nothing, but syntax errors (from the JSON parser) are now surfaced.

I've also tossed the source up on code.google.com for version control.

In the meantime, those of you who are using JSONovich can help increase its exposure by heading over to its entry at addons.mozilla.org, logging in, downloading, rating, and reviewing the extension. Reviews and ratings help get extensions "promoted" from the sandbox to the public site, which provides the ability for automatic updates when new versions of the extension are released.

Molotovs away!

Posted by Michael Giarlo on December 23, 2008

Lest I be criticized for unfairly calling out former employers in my recent Burn the Walled Gardens rant, I share news that the Rutgers University Libraries have boldly ventured into the world of open source software: RUcore Open Source Development. Huzzah! Thanks to the molotov-hurling Shaun Ellis, a peacenik/code monkey/musician extraordinaire, for all of his work and for bringing this to my attention.

On the RUcore open source page you can get a list of ongoing projects, a release schedule, and a rationale for their licensing decisions (i.e., choosing GPL 3).

The first project to be released (as of 2008/12/19) is the METS-based bibliographic utility, OpenMIC:

OpenMIC is an open source, web-based cataloging tool that can be used as a standalone application or integrated with other repository architectures by a wide range of organizations. It provides a complete metadata creation system for analog and digital materials, with services to export these metadata in standard formats.

  • Low overhead and infrastructure requirements
  • Events-based model for management and rights documentation
  • Mapping and import from standard and in-house formats
  • Unicode and CJK vernacular character support

OpenMIC is a core application for the Moving Image Collections (MIC) initiative developed at the Rutgers University Libraries with funding from the Library of Congress.

I look forward to following along as Rutgers releases yet more of the tools they have developed as part of their impressive digital library infrastructure. It will be even more interesting to hear what their model will be for taking patches / commits from the broader open source community. These things do take time, even though I failed to show an appreciation for that in my original rant, but I am reminded (by Jonathan Rochkind) that it's better to take the time and get it right. I cringe a bit to say that, knowing full well how things tend to languish in committees and fall victim to analysis paralysis in academia; surely there is some middle ground? There are some very talented and experienced folks at Rutgers, so I will be excited to see them take a leadership role in this space.

Go, Scarlet Knights!