Dec 9 2010

Yet Another WordPress Flash Uploader Problem (with solution!)

This was a new one for me. Every time I tried to upload a photo to a WordPress site, I received a very informative “HTTP Error” message while the upload progress bar read “Crunching…”. Thanks in part to the stunningly generic error message, it took a while to figure out exactly what was going on.  The problem, it turns out, was HTTP authentication; I had enabled Apache’s basic HTTP login for the site, but being a plugin, Adobe Flash was not similarly authenticated.  So, trying to use the Flash-based image uploader kept silently failing because it couldn’t authenticate with the server.  The fix is simple: just tell Apache not to use authentication for the script that handles Flash-based uploads.  You can do this by modifying the .htaccess file in the root of your WordPress directory like so:

<FilesMatch "(async-upload\.php)$">
    Satisfy Any
    Order allow,deny
    Allow from all
    Deny from none
</FilesMatch>

Nov 28 2010

Making the Apple Keyboard Play Nice with Windows

After a long, long love affair with Logitech, I’ve finally finished a slow migration toward Apple’s input devices.  Their aluminum keyboard took some getting used, but once I’d grown accustomed to it on my Macbook, I decided to get one for my Windows 7 desktop.  It seemed like everything was working perfectly until I pressed the mute button; nothing happened.  Volume down?  No go.  In fact, all of the media keys (volume up/down, mute, play/pause, etc.) refused to do anything. For whatever reason, SharpKeys and other keyboard mapping utilities don’t recognize Apple’s media keys.  The solution, it turns out, is to install a pair of Bootcamp files from your Mac OS X installation DVD.

Here are the steps that worked for me.  I’m running Windows 7 x64 with a 2010 Apple aluminum keyboard, and have a Mac OS X 10.6 Snow Leopard installation disc.  As always, your mileage may vary:

  1. Insert your Mac OS X installation disc.  If it tries to auto-run anything, cancel it.
  2. Open Windows Explorer, right-click on your DVD drive, and select Open from the menu.
  3. Navigate to the Boot Camp\Drivers\Apple folder.
  4. Copy BootCamp.msi (or BootCamp64.msi for x64 systems) to your desktop.
  5. Copy AppleKeyboardInstaller.exe (or x64/AppleKeyboardInstaller64.exe for x64 systems) to your desktop.
  6. Use a tool such as 7-zip to extract the AppleKeyboardInstaller.exe file.
    1. With 7-zip, can you do this by right-clicking on the file and selecting 7-Zip->Extract to “AppleKeyboardInstaller”.
  7. Navigate to the folder you extracted AppleKeyboardInstaller.exe to and run the DPInst.exe file to install the Apple keyboard driver for Windows.
  8. Click Start->All Programs->Accessories, right-click on Command Prompt, and select Run as administrator.
  9. In the command prompt, type “cd Desktop“.
  10. Install BootCamp by typing “BootCamp.msi” (or “BootCamp64.msi” for x64 systems) in the command prompt.
  11. Once the installation completes, you can delete the files on your desktop and remove the Mac OS X installation disc.  Reboot your computer and enjoy your new media keys!

Oct 10 2010

PHP ZIP Extension for MAMP

Do you use MAMP as a web development testing environment on your Mac?

Do you need the PHP ZIP extension for dealing with archive files?

Are you running Mac OS X 10.6 Snow Leopard?

I do, and found making these tools play nice together to be far harder than it should have.  If you need to fix a similar setup, here are the steps that finally worked for me (on Mac OS X 10.6.4 with MAMP 1.9):

  1. Install XCode if you don’t already have it (we’re going to be doing a bit of compiling).
  2. Download the MAMP source code components (available towards the bottom of the page).
  3. When the MAMP source code package opens, go into the MAMP_src folder and double-click the php-5.3.2.tar.gz file (if you are using a different version of PHP, replace 5.3.2 with your actual version number).
  4. You should now have a php-5.3.2 folder in your Downloads folder.  Open up Terminal and cd to ~/Downloads/php-5.3.2.:
    cd ~/Downloads/php-5.3.2/
  5. Install the pcre.h header file (we need it to compile the extension):
    sudo cp ext/pcre/pcrelib/pcre.h /usr/include/php/ext/pcre/
  6. Configure PHP for i386 architecture:
    CFLAGS="-arch i386" ./configure
  7. Configure the ZIP extension for i386 architecture:
    cd ext/zip; CFLAGS="-arch i386" ./configure
  8. Build the extension:
    make
  9. Install the extension:
    cp modules/zip.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/
  10. Enable the extension by opening /Applications/MAMP/conf/php5.3/php.ini and appending the following line:
    extension=zip.so
  11. Remove the pcre.h header file we installed earlier, we don’t need it anymore.
  12. Restart MAMP.  If everything worked properly, you’ll be able to goto http://localhost/MAMP, click on phpInfo, and see zip in the list of enabled extensions.

Feb 7 2010

StrayLight Photography

I’ve been meaning to revamp the photography section of this site for a while now; this weekend, I finally found the time to do it. I registered a new domain, straylightphotography.com, and put together a portfolio consisting of my 20 favorite shots (<shamelessPlug>many of which are currently on display at Interzone through February 28th!</shamelessPlug>). I’m hoping to quickly expand the site with themed portfolios (portraits, urban decay, etc.), but… first things first.

Also, the new portfolio has been an excuse to play with CSS3 and jQuery 1.4.  Visitors using Firefox, Safari, Chrome, or Opera should see a site that behaves like it was created with Adobe Flash, but is fully accessible and doesn’t require the proprietary Flash plug-in.  Visitors using Internet Explorer… well… it at least degrades cleanly.  Mostly.


May 19 2009

Mapping Caps Lock to Control without Admin Access

Somewhere along the line, I picked up the habit of mapping the otherwise utterly useless caps lock key to act as another control key.  If you’re an Emacs user, this is sort of critical to avoid the wrist strain of constant pinky-stretches to the lower-left corner of the keyboard.  Its become second nature now, so when I recently found myself working on a Windows-based lab computer where caps lock actually performed as-advertised, the result was a lot of code THAT lOOKED LIKE thIS.  Unpleasant, to be sure.

Linux and Mac OS X make remapping this key extremely easy.  System Preferences on the Mac and the GNOME keyboard control panel on Linux include a simple option to enable.  Tada!  No more wasted space west of ‘A’.  Windows, of course, is a different beast.

The good news: there’s a very simple registry hack to remap caps to control.  Seriously, it’s floating all over the internet.  Except, there’s a wrinkle–you need administrative access to edit the HKEY_LOCAL_MACHINE registry tree, which is what all of these hacks do.  For whatever reason, our school has decided computer science graduate students aren’t to be trusted with administrative access to their own computers [another rant for another time], so what’s a wrist-strained user to do?

Muck around in the Windows registry, of course!  It turned out to be pretty straight forward.  There’s a duplicate of the keyboard mapping registry key under HKEY_CURRENT_USER, which non-administrators can modify, and it appears to behave exactly like the key under HKEY_LOCAL_MACHINE.  So, for anyone in a similar position, here’s the registry key to modify:

HKEY_CURRENT_USER\Keyboard Layout\Scancode Map =
hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00


You can download a registry update file here.  Save it to your computer, double-click it to update your registry, then reboot and enjoy your vastly-improved keyboard.


May 3 2009

Meet Elliot

Last week I did what you all suggested: I went to the local animal shelter and picked out an adorable kitty.  I didn’t head in looking for any particular characteristics (beyond wanting an animal past kitten-stage… everyone is willing to adopt kittens), I figured I’d play with a few and see if I got on well with any of them.  There was one particularly-needy-looking little domestic short hair, Elliot, on their website, but I didn’t really expect the site to be up-to-date.  Better to just go and look around.

A volunteer at the desk points me to a door and says, “Just go ahead.  Find one to fall in love with.”  As soon as I open the door, this raspy yowl is let loose from the cage on the lower-right.  I’ve lived with chatterbox cats before, and they’re cute, but this guy… this guy did not sound cute.  Picture what copious amount of whiskey and cigarettes could do to a cat’s voice, a feline variant of a smokey jazz pianist; that’s what this little fellow sounded like.

So I pass him by and check out the top row, where some truly beautiful kitties were lazily playing, batting at my arms or at each other.  I’m reading the names on each cage, wondering if Elliot is still there.  I’m a tad disappointed when this beautiful tuxedo-coated cat that’s been vying for my attention turns out to be not-him (a her, in fact, though I can’t recall the name now), but she’s cute and lively ,so I take her out of the cage and she doesn’t claw or bite, and I’m thinking, “Hrmm… this one could be perfect.”

Meanwhile the relentless pleas from whiskey-cat have taken on a hint of desperation: “You are not paying attention to me!” he cried.  “Not even a little bit!”  So I kneel down to take a closer look at him, and he immediately shuts up and starts nuzzling the cage door as hard as he could.  I put a hand through the bars to scratch his head, but can’t maintain for long because kitty starts rolling over himself in ecstasy (judging from the amount and quality of purring emanating from his tiny little self).  OK, so this guy seems to need a home desperately. I open his cage and he bolts straight into my lap, starts climbing over my shoulders, still purring like a V8, and I notice his name tag.  Elliot, domestic short hair, male, rescued Feb 2009, age approx 1 yr.  I gently put him back in his cage, where he once again let out that bizarre meow of his, and went to the desk to tell them I found one I want.

So!  That was just over a week ago.  Elliot’s adjusting to his new home pretty well.  He’s not nearly as vocal as when we first met, but when he does have something to say, I’ve started to find that raspy meow rather endearing.  He’s beginning to learn his boundaries (e.g., he can sit and walk on things that I also sit and walk on.  NOT COFFEE TABLES.  etc.), and he’s stunningly playful.  Seriously.  Everything is a game to him.  He even wowed the vet and her staff by showing no fear and insisting they play fetch with him.  And for all his energy, by the end of the day, he’s perfectly content to curl into a little ball beside me while I read.  Or hack.  Or play guitar.  Or sip martinis and watch old movies.  He doesn’t care.  He is perfect.

Elliot checking out the neighborhood Sleepy kitty


Apr 1 2009

Mythbusters + Countdown

My two favorite [non-fiction] shows collide!


Mar 28 2009

American Girl

Finally, new tune!  This one works in some harmonica (be kind, I just started learning it this week).  I’ve actually been playing a *far* more upbeat version of this for the past month, but am not really feeling like I could carry that off with any conviction at the moment, so you get the tension-strung edition instead.

American Girl – MP3 download


Mar 27 2009

Request for Comment: Kitties

Seriously.  What type of cat should I adopt?

[currently leaning toward either a Ragdoll or an Oriental Shorthair, but am very much open to suggestions]

[Update: Throw the Egyptian Mau onto that list as well, assuming I can actually track one down]


Mar 18 2009

Beautiful Ruins

This just makes me sad: Incredible Hulks – Exploring the ruins of Detroit