Older blog entries for pabs (starting at number 43)

Time to Upgrade...

I just spent 30 minutes sifting through the code for this site to fix logins. They've been broken for months, and I'm using a new laptop without my old session cookie.

30 minutes to post a damn two paragraph article. Maybe redoing the site will be my weekend project.

Syndicated 2009-05-30 06:24:50 from Pablotron: News

Reddit Content Filter 0.5

I've just released Reddit Content Filter version 0.5. Reddit Content Filter is a Greasemonkey scripts that allows you to filter unwanted articles on Reddit by author, domain, or title.

This release has been updated to work with the new Reddit layout. I've also improved the interface; there is now a row of buttons across the top-right corner of the screen that allow you to reconfigure filters and toggle the visibility of hidden articles without reloading the page.

User Scripts seems to have hosed my existing account, so for now you can install the script from the link below:

Update: I've cross-posted this release note over on Reddit. Feel free to comment over there.

Syndicated 2009-05-05 04:30:55 from Pablotron: News

Talk to Your Kids About YAML or Their Friends Will

This article nicely illustrates my beef with YAML; namely, the YAML grammar is far too complicated. Complexity in data serialization and exchange formats should be avoided, because it virtually guarantees subtle interoperability problems.

If you need to exchange structured data in a language-agnostic format, do me a favor and use JSON instead.

Syndicated 2009-04-15 16:38:00 from Pablotron: News

Joggle 0.1.0 Released: Jabber to Twitter Relay

I just released Joggle version 0.1.0. Joggle is a Jabber to Twitter relay; tweets show up as instant messages, and instant messages are posted as tweets.

Setting up Joggle is easy; all you need is Ruby, five minutes, and a spare Jabber account:

  # install joggle, create joggle directory
sudo gem install joggle
mkdir ~/.joggle

# create joggle config file 
# (replace joggle@example.com and abc123 with your spare jabber 
# account and password, respectively)
echo -e "jabber.user joggle@example.com\njabber.pass abc123" > ~/.joggle/joggle.cfg

# run joggle in the background
joggle --daemon --config ~/.joggle/joggle.cfg

Next, add the specified Jabber account (joggle@example.com, in the example above) to the buddy list in your Jabber client.

Finally, register your twitter username and password with Joggle by sending an instant message like this: .register TWITTER_USER TWITTER_PASS (replace TWITTER_USER and TWITTER_PASS with your Twitter username and password).

You can also share your Joggle installation with your friends; have them add the Jabber account to their buddy list and send a .register command.

See the README file for detailed installation instructions and a full list of configuration options.


Update: Comments for this site are still broken, but I've cross-posted this release announcement on Reddit, so feel free to post a comment over there.

Syndicated 2009-03-14 20:05:38 from Pablotron: News

ZipStream-PHP 0.2.1 Released

Version 0.2.1 of ZipStream-PHP is out. There is one change:

  • Generate correct "version needed to extract" header. This fixes extraction problems with WinZip 9.0.

Here are the relevant links:

Syndicated 2009-03-09 22:43:02 from Pablotron: News

I Have a Twitter Account

Despite my better judgement I now have a Twitter account. You can follow my wacky hijinks at http://twitter.com/pablotron.

I've also written a basic Jabber/Twitter relay called Joggle. I'm hoping to release it later this week. If you'd like to try Joggle now, you can grab it from the mercurial repository (you'll need Ruby, a spare Jabber account, and a few minutes to glance over the README file).

Syndicated 2009-02-22 06:27:29 from Pablotron: News

Gratuitous Hardware Imagery: New Firewall and Fille Server

I put together a new firewall and a new file server. The firewall is an ALIX 2d3 -- a tiny, low-power x86 SBC with onboard 3xLAN. The whole thing runs on 7-20V. Also, there's no heat sink ahe disk is compact flash, which means no moving parts!

The other machine is a new file server. It's replacing three older machines and a half-dozen Vservers. The hardware isn't as exotic as the ALIX, but I do have some pictures:

Syndicated 2009-02-22 05:57:19 from Pablotron: News

Techmeme Author Filter 0.2 (Greasemonkey Magic)

I don't read Techmeme and you shouldn't either. But if you do, then this Greasemonkey script for Sean might come in handy:

A brief README file is also available. Basically the script allows you to hide articles by author. You can configure the filters using the two buttons in the top-right corner of the page.

Syndicated 2009-02-22 05:26:35 from Pablotron: News

ZipStream-PHP 0.2.0 Released

Version 0.2.0 of ZipStream-PHP is out. The two changes are:

  • Generated archives work with the Windows XP "compressed folder" feature.
  • Dropped support for PHP 4.

Here are the relevant links:

As you can see from the link above, I'm using Redmine for bug and feature tracking. I've been using it for several months and it's fantastic.

Syndicated 2009-02-22 04:57:58 from Pablotron: News

PersistJS: Cross Browser Client-Side Persistent Storage Without Cookies

I just released PersistJS, a client-side JavaScript persistent storage library. Features include:

  • Small (9.3k minified, 3k gzipped)
  • Standalone: Does not need any additional browser plugins or JavaScript libraries to work on the vast majority of current browsers.
  • Consistent: Provides a consistent, opaque API, regardless of the browser.
  • Extensible: Custom backends can be added easily.
  • Backwards Compatible: Can fall back to flash or cookies if no client-side storage solution for the given browser is available.
  • Forwards Compatible: Supports the upcoming versions of Internet Explorer, Firefox, and Safari (Opera too, if you have Flash).
  • Unobtrusive: Capability testing rather than browser detection, so newer standards-compliant browsers will automatically be supported.

If you already know why this is awesome, then you can skip straight to the download. If you're scratching your head, then read on...

Why This is Awesome

Why use PersistJS? What's the problem with using cookies directly or simply requiring Flash?

Currently the only reliable cross-platform and cross-browser mechanism for storing data on the client side are cookies. Unfortunately, using cookies to store persistent data has several problems:

  • Size: Cookies are limited to about 4 kilobytes in size.
  • Bandwidth: Cookies are sent along with every HTTP transaction.
  • Complexity: Cookies are difficult to manipulate correctly.

Modern web browsers have addressed these issues by adding non-Cookie mechanisms for saving client-side persistent data. Each of these solutions are simpler to use than cookies, can store far more data, and are not transmitted along with HTTP requests. Unfortunately, each browser has addressed the problem in a different and incompatible way. There are currently 4 different client side persistent data solutions:

  • globalStorage: Firefox 2.0+, Internet Explorer 8
  • localStorage: development WebKit
  • openDatabase: Safari 3.1+
  • userdata behavior: Internet Explorer 5.5+

Some developers have attempted to address the client side storage issue with the following browser plugins:

  • Adobe Flash
  • Google Gears

The problem with relying on plugins, of course, is that users without the plugin installed miss out on the feature in question, and your application is dependent on software from a particular vendor. Google Gears, for example, is not widely deployed. Flash is, but it has problems of its own:

  • Many users block Flash or require a click in order to enable flash content; this makes Flash unsuitable as a transparent, client-side data store.
  • Flash is notoriously unreliable on newer 64-bit machines.
  • Some businesses block Flash content as a security measure.

Anyway, if we include Gears and Flash, that means there are no less than 6 incompatible solutions for storing client-side persistent data.

The most notable attempt at addressing this problem is probably Dojo Storage. Unfortunately, Dojo Storage does not support Internet Explorer without Flash, and it does not support Safari or other WebKit-based browsers at all (at least, not without Flash). Also, Dojo Storage is not standalone; it requires a several other Dojo components in order to operate.

PersistJS addresses all of the issues above. It currently supports persistent client-side storage through the following backends:

  • flash: Flash 8 persistent storage.
  • gears: Google Gears-based persistent storage.
  • localstorage: HTML5 draft storage.
  • whatwg_db: HTML5 draft database storage.
  • globalstorage: HTML5 draft storage (old spec).
  • ie: Internet Explorer userdata behaviors.
  • cookie: Cookie-based persistent storage.

Each backend exploses the exact same interface, which means you don't have to know or care which backend is being used.


Here are some simple examples of PersistJS in use:

  // create a new client-side persistent data store
var store = new Persist.Store('My Data Store');

// pretend data
var data = "pretend this is really long data that won't fit in a cookie";

// save data in store
store.set('saved_data', data);

That's all there is to creating a persistent store and adding some data to it. Fetching data back from the store uses a callback function (to support asyncronous backends), but it's still pretty simple to use:

  // get data back from store, and prompt user with it
store.get('saved_data', function(ok, val) {
  if (ok)
    alert('saved data = ' + val);

Removing data is pretty easy too:

  // remove data from store

Although it isn't necessary, you can also get some information about the detected backend using the Persist.type and Persist.size attributes:

  // build alert message
var info = [
  'Backend: ',
  Persist.type || 'none',
  ', ',
  'Approximate Size Limit: ',
  (Persist.size < 0) ? 'unknown' : Persist.size 

// prompt user with information

Finally, if you don't want a particular backend used under any circumstances, you can disable it using the Persist.remove() function:

  // never use cookies for persistent storage


This is the initial release, so there are bound to be some bugs. PersistJS has been tested with FireFox 2.0, FireFox 3.0rc1, IE7, and Safari 3.1. The Gears and Flash backends work where Gears and Flash 8 are supported.

The most notable omission here is IE6; it should work, but I don't have IE6 handy at the moment (MultipleIEs is temporarily busted).

Commenting is still busted around here, so any comments should sent via email or posted on the Reddit thread.

Syndicated 2008-05-22 07:19:49 from Pablotron: News

34 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!