animated GIFs from Sea of Dreams

# trim and scale down in QuickTime Player
# FFMPEG: r = 10 FPS
ffmpeg -i -r 10 -pix_fmt rgb24 the-colors.%04d.png
# ImageMagick: delay = 10/100 of a second between frames
convert -delay 10 the-colors.*.png the-colors.gif

Doesn’t take advantage of any of the intra-frame GIF optimizations, or a global color table, so the output is huge (~10 MiBs for 4 seconds), but the animated GIF is the haiku of the 20th century: a format defined by its limitations.

WordPress rewrites image tags to a scaled version which fits the theme width, so click to see the originals if these don’t animate.




my voting guide for propositions in California’s 2012 election

30. YES to increase sales and income tax (supposedly progressively) for educational funding. California’s budget is so crippled by years of stupid propositions that I will vote up almost anything that increases taxes.

31. NO to this confused mess of state budget rule changes. The proposal to stop “gut and amend” by requiring that the full text of a proposed bill that has been approved by subcommittees be frozen to major changes is interesting, but the rest is a grab bag of land mines.

32. NO to reducing the paid political speech abilities of unions while leaving plenty of loopholes for corporations. Prop 32 is brought to you by everyone’s favorite shadowy billionaire douchebags, the Koch brothers.

33. NO on this insurance-company-backed proposition, which would permit rate hikes for people without a history of car insurance coverage. For example: people who didn’t have cars for a long period.

34. YES to stop the death penalty. Has some budget consequences I don’t understand – can anyone clarify?

35. NO to attaching the nebulous “human trafficking” label to a wide variety of crimes for no reason. The continued expansion of what is considered a “sex offense” is bad enough. Would also cost millions of dollars allocated to “human trafficking” which would probably come out of other law enforcement budget allocations.

36. YES to revise the Three Strikes law to focus on violent crimes only. Would let a lot of nonviolent offenders out of prison. Projected savings in the high tens of millions.

37. YES to require GMO products to be labeled. Some cost, not funded, but since Big Agritech is virulently opposed to 37, I’m all for it.

38. YES to a second income tax increase to fund education.

39. YES on a large tax increase on multistate corporations doing business in California. This would force them to pay their fair share instead of using a loophole specific to multistate businesses that lets them evade most CA corporate taxes.

40. YES to keep the Citizens Redistricting Commission-delineated districts as they apply to the state senate. Court action mandated that anyway, so the Commission lines are safe, but vote YES just to give an extra F U to the California Republican Party’s gerrymandering attempt.

find hidden files with lsflags, show them with chflags

I want to go fishing in my work Mac’s ~/Library folder for some app settings files, but Apple has decided to hide it from me. I could use -shift-G, or open ~/Library, but that’s not the kind of guy I am. Why is it hidden? The filename doesn’t start with a dot, so the Finder’s going on something other than Unix convention there. Were this 1998, I’d launch ResEdit and clear the folder’s HFS hidden flag. Maybe that’s still around in some form? I’ll look at the file’s extended attributes, because I’ve seen other HFS stuff like resource forks in there.

Arachnoscope:Desktop steelpangolin$ xattr -l ~/Library
00000000  00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  |........@.......|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|

Well, I was hoping for something more like, but this is a start. Except it’s completely opaque. Googling… aha. A hidden flag is mentioned in chflags. But how do I confirm that this flag is actually why the Library’s omitted from the Finder’s listings? Is there any way to read flags?

Arachnoscope:Desktop steelpangolin$ ls /usr/bin | grep flag

Nope. Back to the man pages; I’ll have to write one myself: lsflags.c.

Now I’ll give it a go:

Arachnoscope:Desktop steelpangolin$ gcc -std=c99 -Wall lsflags.c -o lsflags
Arachnoscope:Desktop steelpangolin$ ./lsflags ~/Library
/Users/steelpangolin/Library: hidden
Arachnoscope:Desktop steelpangolin$ chflags nohidden ~/Library
Arachnoscope:Desktop steelpangolin$ ./lsflags ~/Library
Arachnoscope:Desktop steelpangolin$ xattr -l ~/Library

Hooray. The flag shows up, and it is indeed stored in the xattr, because both disappear when I remove it. But what’s this, at the end of the first man page I found?

You can use “ls -lO” to see the flags of existing files.

Note to self: read all the way to the end next time.

Tagged ,

freeware loadout for a Windows dev box

Just brought my home Windows desktop up to a state of usefulness comparable with my work Mac. Here’s what I installed today:

Gow (GNU on Windows): Common Unix utilities packaged for Windows. Equivalent to GnuWin32 but with a much better installer.

Console2: Better console. Supports tabs, drag to copy and right-click to paste, custom text colors, and bookmarks for starting up command-line apps (Python, GHCi) or shells with different environments (useful for Visual Studio’s command line stuff).

Programmer’s Notepad:  The best lightweight code editor. Syntax highlighting, tabs, Ctags support, etc. Better UI than Notepad++.

Sysinternals: Contains Process Explorer (an improved version of Task Manager) and Process Monitor (realtime display of what files and registry entries are in use).

ack: Programmer-friendly grep replacement that supports match context, recursive search of a directory tree, filtering by source type/language, and ignoring VCS files. Codification of the common sense behavior that normally requires hours of smacking find, xargs, and grep around. Requires a Perl interpreter; I use the community edition of ActivePerl.

TortoiseSVN: SVN client for Windows Explorer.

7-Zip: compression utility.

KeePass: Password manager. I use KeePass 1.x (still actively developed) because it’s compatible with KeePass implementations on other platforms such as KeePassX (Mac, Linux) and KyPass (iOS).

PuTTY: SSH terminal.

WinSCP: SFTP client.

Chrome: with FeverPHP, JSONView, and Edit This Cookie. I used to prefer Firefox with Firebug for development, but it’s gotten unusably slow.

Fiddler: HTTP/HTTPS debugging proxy. Similar to Charles.

Aptana Studio 3: Eclipse distro for webapp development. Like all Eclipse-based products, it’s clunky at times, but once a project grows beyond a few folders, managing it without an IDE is painful, and Aptana’s the best one I’ve found yet. Includes PyDev for Python, and has its own editors for Javascript, HTML, and PHP (Aptana’s PHP support is much, much better than Eclipse PDT’s). Also includes a handy SFTP folder syncer: you map a local project folder to a remote folder and can then upload individual files or sync whole folders with one click. I’ve added Subclipse with the CollabNet merge client for SVN support and DTP for SQL syntax highlighting.


failure of imagination

Mirror, mirror: The New York Times wants to serve you info as you’re brushing your teeth

It’s another smart house scheme that lives in your bathroom mirror and tracks your prescriptions by RFID. I got almost this exact pitch when I toured Microsoft Research’s demo smart house as a Microsoft intern in 2008. So what’s new? It’s an ad platform:

And it’s also a retail opportunity. So, say, based on my use of this product, that a local retailer wants to promote something to me.

“Mirror: show coupon.”
“Mirror: show coupon.”

I can call up a coupon here, and then save it to my phone, and then go to a physical location to redeem it. So, again, it’s a conversation that happens in front of the mirror, but then it can drive behavior elsewhere, out in the world.

Hey. Creative Technologist for R&D Brian House. This is 2011. In the event that I do purchase a magic mirror that shows me ads, and I see something I like, I’m not gonna bother asking it for a coupon, OBEXing or mailing or whatevering it to my phone, and then going to some brick and mortar store with it. Technology is supposed to save time! I’m gonna order the thing from Amazon and get it in the mail.

Clipboard spam

Talking to friends in IRC just now, someone pasted content from the SF Gate which had a Read More link attached that wasn’t in the original page. I went to the page and couldn’t replicate that behavior. A little digging revealed that a Tynt script attaches an oncopy event handler that puts that extra crap in, and that the Ghostery Firefox extension was blocking Tynt on my own machine. Thanks, Ghostery!

new variant of Facebook April Fool’s IM worm

There’s a new variant of the Facebook April Fool’s worm going around. This one appears as an IM with the text “haha! hilarous”; the page behind the URL shortener is (taken down since I started writing this, see screenshot) which appears to be a Facebook video but actually loads some JavaScript using an onclick handler:

javascript:if(window.opener){ window.opener.document.body.appendChild(document.createElement(‘script’)).src=’! hilarous’; window.close(); }else{ document.body.appendChild(document.createElement(‘script’)).src=’! hilarous’; }

Facebook Bully Down wormWhatever it loads seems to Facebook Like the link and then IM your friends. I got three messages in a short span of time. Not sure what’s required to send IMs through Facebook, might be it uses a fake login page to steal credentials like other variants.


Tagged ,

ViewVC on DreamHost, revisited

While getting ready to install MoinMoin on to replace my current static pages, I noticed my ViewVC install was two years out of date. Readers seem to have found my writeup of the last time I installed ViewVC on DreamHost useful, so here’s an update.

DreamHost‘s standard environment now includes Python 2.5.2, virtualenv, and Python bindings for Subversion 1.5. This makes setting up ViewVC a good deal simpler than it used to be. This time around, I’ll be using FastCGI rather than classic CGI as the mechanism for getting Apache to talk to Python. I’d use WSGI, the preferred method of running Python webapps, but WSGI is apparently a little flaky on DreamHost.

Make sure $HOME/bin is in your $PATH environment variable before /usr/bin. My instructions below assume your working directory is $HOME.

Set up a Python virtualenv in your home directory, if you don’t have one already:
$ virtualenv $HOME

ViewVC uses Flup for FastCGI support, and Pygments for syntax highlighting. Install Flup and Pygments into the virtualenv:
$ easy_install Flup
$ easy_install Pygments

Download and unpack the latest stable release of ViewVC (currently 1.1.8):
$ wget
$ tar -xzf viewvc-1.1.8.tar.gz
$ rm viewvc-1.1.8.tar.gz

Run ViewVC’s installer script:
$ viewvc-1.1.8/viewvc-install --prefix=$HOME/viewvc

Delete the installer directory:
$ rm -rf viewvc-1.1.8

Configure viewvc.conf and the ViewVC templates to suit yourself, as per the ViewVC install instructions and my previous post on ViewVC setup. Remember to set up static content serving with the docroot option in viewvc.conf and the appropriate directory mapping.

Set up an .htaccess file in your domain folder to use Apache’s mod_rewrite for pretty URLs:

RewriteEngine on
RewriteRule ^code/(.*)$ viewvc.fcgi/$1
RewriteRule ^code$ viewvc.fcgi/

Copy viewvc.fcgi, the FastCGI entry point to ViewVC, to your domain folder:
$ cp viewvc/bin/wsgi/viewvc.fcgi

ViewVC’s installer script will automatically create a viewvc.fcgi that points to the Python interpreter in your virtualenv (the one that has Flup and Pygments installed), so you don’t need to edit the #! line. You will still need to add a line to viewvc.fcgi to set the SCRIPT_NAME environment variable to a URL that matches your .htaccess rewrite rules. Instead of changing os.environ, change environ inside the application function that is the Flup entry point:

def application(environ, start_response):
  environ['SCRIPT_NAME'] = '/code'
  server = sapi.WsgiServer(environ, start_response)
  cfg = viewvc.load_config(CONF_PATHNAME, server)
  viewvc.main(server, cfg)
  return []

And with that, you’re in business. Took me less than half an hour, and that’s counting the time it took to write this.

Tagged , , , , , , ,

Digsby: useful, once you turn off the ads

Adium is the alpha and omega of chat clients. It does everything right. Unfortunately, it only runs on Macs. I just can’t seem to find a good multiprotocol IM client for Windows.

Way back in the dark ages, when Pidgin was GAIM 1.5 and the UI team hadn’t adopted their “our way or the highway” policy, I used that. But the Gtk+ interface always bugged me and GAIM 2.0 disabled a bunch of UI tweaks that I liked. There was a fork called Carrier or FunPidgin that re-enabled them, but like most annoyance-related forks, there wasn’t a lot of backing and it’s now long dead. So I kicked it to the curb and used Miranda for a while. Unfortunately, maintaining a Miranda install means dealing with at least a dozen plugins to provide features that should have been built in, like grouping a person’s multiple chat handles together (“metacontacts”), the ability to change smileys, a decent chat-history viewer, or a UI that doesn’t look like a throwback to Windows 95. Too much hassle.

Then I heard about Digsby somewhere. It’s not open source. It’s actually kind of unclear what their business model is. However, in terms of feature set, it’s the closest thing to Adium you can get on Windows, with the notable exceptions of OTR encryption and IRC support. It supports metacontacts, it works with Facebook messaging (always surprised by how many people use that), it has a decent message display, and it can be configured to be quite unobtrusive, a major selling point for me. Part of that configuration is turning off all the crap they ship with it. Honestly, I hate ad-supported free stuff, and I hate installers that carry a crapware payload even more. If it’s good, just make it payware. I’ll buy it. If it’s not good, I’m not going to put up with ads because it’s free – there are plenty of other freeware and OSS products out there that are usable.

To the credit of Digsby’s developers, you can turn off the various user-exploitation features! Here’s how.

There’s a constantly varying crapware payload in the Digsby installer: last time I installed Digsby, it was the toolbar (link goes to uninstall directions). Real useful.’s installer screen has the checkboxes for “Yes, please install this useless piece of data-harvesting crap” pre-checked, so don’t blindly click through.

Once you’ve got Digsby installed, open Digsby’s Preferences window from the systray icon or the Tools menu (shown):

Location of Digsby's Preferences window

The newest publicly available version of Digsby added ads under every conversation window; that’s what pissed me off enough to go looking for some way to kill them. In the Conversations pane, uncheck the box next to “Support Digsby development by showing an ad in the IM window“.

Location of checkbox to disable Digsby's conversation window ads

I want to smack anyone who sends emails ending with “sent from my iPhone” (or BlackBerry, or Hotmail account, or whatever). I prefer my messages unbranded, thanks. Digsby does some similar self-promotion in your AIM profile. In the General & Profile pane, uncheck the box next to “Promote Digsby in my AIM profile“.

And then there’s the most insidious piece: Digsby uses Plura’s platform to appropriate your CPU cycles for commercial purposes. This is one step away from botnet membership, and it uses the same verbiage as legitimate volunteer grid computing like BOINC (the platform that powers SETI@home). In the Research Module pane, uncheck the box next to “Allow Digsby to use CPU time to conduct research“. Maybe some day, commercial grid computing will advance to the point where I can make more money by running it than it costs to power the machines it’s running on, but on that day, the money better be going to me, not whoever landed a parasite program on my computer first.

With this junk disabled, Digsby is a nice little multiprotocol messenger program.

Tagged ,

GraphicsMagick: doing ImageMagick right

Found out about GraphicsMagick while trying to remember the package name for ImageMagick in Ubuntu 10.10/Maverick‘s repository (I can never remember which package managers do case-insensitive substring matching by default and which don’t). It’s about time someone started making ImageMagick slightly more comprehensible. ImageMagick‘s useful in a pinch, but it’s far from perfect. Its list of command-line flags rivals the Bible in length, it’s sometimes so hard to figure out which options to stick where to do what that on more than one occasion I’ve said “Screw it, I’ll just do this in PIL/SciPy/raw OpenGL!”, and the way it names its various utilities is just rude. convert, identify, display — these are all common words! They get used by everything! Would it have killed them to put a prefix on there? I haven’t even finished installing it, but GraphicsMagick has already solved one of those problems: all of their functionality is accessed through the gm command. Thanks, GraphicsMagick Group! Now, if they suck at compression even slightly less than ImageMagick does, I’ll be a very happy man.

I hope most of the stuff at still works on GraphicsMagick. The examples there are a lifesaver if you happen to have a task that matches one of them, but they’re from ImageMagick v6 and GraphicsMagick forked from ImageMagick v5. We’ll see how much translates.