Firefox Miami Style?

Part of running an actual server (as opposed to shared web hosting) is actually being concerned about security. I regularly keep an eye on my access logs and the like, and I don’t usually find that much to worry about — I just keep iptables, and a few other tools, within reach.

But this particular user-agent string show up in visits from time to time (bots, I’m guessing)… what the hell is Firefox Miami Style?

An example:

37.9.53.64 - - [26/Dec/2013:13:34:39 -0500] "POST /wp-login.php/wp-login.php HTTP/1.1" 200 10956 "writegeek.com/wp-login.php/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0 USA\\Miami Style"

Trying to POST to a nonexistent URL? That’s classic Miami style, if I’ve ever seen it.

Yes, that’s a new laptop. Yes, I know what year it is.

lenovo-thinkpad-x230-frontI know it’s 2013 and as far as “mobile computing” goes, I’m supposed to be pinch-zooming and app-buying and poorly-typing on a tablet like the cool kids. And I do — my  O.G. Nexus 7 (the 2012 model) sometimes makes a nice companion1 to my Galaxy Nexus Android phone, by being slightly faster and having a slightly better screen. However, over the 15 months I’ve owned the Nexus 7, it never quite became the second mobile device that I wanted. Useful, yes… transcendent, no.

I knew something was still missing, so I recently went and bought a small laptop computer, a Lenovo ThinkPad X230, to carry around. It runs Debian Linux. It does the things I want. It’s a wonderful thing to have.

I needed this because…

The laptop that the ThinkPad replaced was from 2007, and while a decent computer from back then would likely still be good today, my old laptop was not a decent computer, even when new. Back then, I didn’t know just how painfully slow an ultra-low-voltage, low clock-speed CPU could be… I guess I thought it being dual-core would somehow make up for it. Also, the cooling fan was a bit of a whiner, and would constantly and very vocally disagree with Linux’s style of power management. The darned thing would constantly sound like a mini-jet-engine — too obnoxious to use around people I actually like.

Low on power, high on noise — not a good combo.

But these days…

In the last half-decade or so, mainstream humans seem to have accepted the smartphone, and seem to be doing the same for the idiot camera (“tablets”). It’s the “Post-PC era,” or something. Plenty of people seem to be doing okay without spending much time on their general-purpose personal computers, but over time I realized that as I tried to go along with this trend, I was missing out. For me, a computing life centered around mobile “smart” devices was one of unacceptable compromise. Composing more than a couple of sentences without a keyboard makes me want to just not bother to write, devices without expandable storage make one dependent on rent-seeking “cloud” services, and the mobile app ecosystem has handfuls of well-known problems (privacy, lock-in, and so on).

There’s a place for these devices, even in my life, but they just don’t replace a general-purpose computer. Ever.

So I did this…

I made sure not to make last time’s mistakes when buying this computer. The i5 CPU is more than adequate, and I have a ton of RAM. ThinkPads are known to play nicely with Linux, because they’re used by that awesome kind of geek who figures that shit out (and wouldn’t put up with a jet engine laptop). It runs Debian Jessie (“testing”) with only minor annoyances — not perfect, but nothing I can’t handle.2

Hardware build-quality and durability are major plusses for an everyday carry machine, and that’s what ThinkPads are known for. And of course, TrackPoint is truly the best way to mouse. A lot has been said about the new ThinkPad keyboards, and while this one suffers from the bullshit key layout (compare it to the awesome, ugly 1337-geek classic style), the keyboard actually feel pretty nice to type on, even if the bizarrely-placed PrintScreen key occasionally enrages me.

And finally…

In the spirit of burying the lede, here are some things I intend to enjoy while toting around this rock-solid, large-screen-and-real-keyboard device:

  • Full desktop OS that does all the things
  • Better web browsing; approximately 1,000 open tabs
  • Actually writing things, blogging silly ideas and such
  • Tons of local storage (SSD + HDD = yay!)
  • Semi-modern PC games, including lots of Humble Bundle goodness
  • Codecademy
  • Interactive fiction, perhaps (now, where did I misplace my patience?)
  1. My most common tablet uses are as follows: gaming, viewing TV episodes and movies, and web browsing. I’m putting this in a footnote so as not to sidetrack myself, but it’s an important point. One of the best things about having the tablet was that it gave me another 16 GB of storage, on top of the 16 GB available on my phone. A lot of people seem to think that Google intentionally limits the storage available in their flagship devices to push people into using their monetizable “cloud” media offerings instead of local storage. I wouldn’t be surprised if this were true, but honestly, the #1 reason I’d like more local storage in my devices is not to carry around more media, but more and larger apps — something you can’t put in the cloud.[]
  2. I imagine Debian Stable or Ubuntu would be better.[]

How to transfer photos from a Game Boy Camera to a computer (in Linux)

A few days ago, I found a Flickr group thread that was practically begging for my input. It read something like “Hey Everett, you’re surprisingly enough not the only person out there with these two interests (one obscure and the other semi-so). Would you be willing to help out quite possibly the only other person in the world who cares about these things?”

Not only was I like, “Heck  yeah!,” but I decided that this was worthy of blogging, in case a third individual happens to develop these interests. (If this is you, welcome!)

So, in case you find yourself wanting to get crappy photos—a term I use most affectionately—like these:

off of one of these:

red Game Boy Camera

and you use Linux:

(I kid!)

…like I do, read on.

The hardware I’m using to download photos over USB is SmartBoy USB cartridge reader (which is made by these people). And there just so happens to be a great open-source program for facilitating this task using this device (or a similar cartridge reader): gbcflsh.

So what’s the problem? gbcflsh is only distributed as source, and the source fails to compile under recent releases of Ubuntu. I contacted the developers of gbcflsh, and one gave me some suggestions for fixing the source code. They have yet to publish the fixed source, so I’ll document how I got it to compile.

(If you don’t care about this, just grab the binary I made: gbcflsh 32-bit, md5sum: 85b185706c3d5fe45b7787787f8510bd; gbcflsh 64-bit, md5sum: 4326e08fcfb5be39004c290df2a71988)

  1. Download and extract the source code.
  2. Install the following packages:
    gcc 4.3.3, qt4-dev-tools, libftdi-dev
  3. Focus on the following files:
    src/Logic.cpp
    src/ReadFlashThread.cpp
    src/ReadRamThread.cpp
    src/WriteFlashThread.cpp
    src/WriteRamThread.cpp
  4. Add the following to the bottom of the #include section of each file:
    #include <cstdio>
  5. That’s it! Compile it like you already know how to do (which I won’t get into here).

gbcflshWhen you run gbcflsh (you’ll need to do so as root, by the way), it’ll look a little bit like what you see to the right. Select the visible options (USB, Auto, Ram: 128 KB) and click “Read RAM.”

If all goes well, you’ll end up with the contents of your camera’s RAM in the form of a .sav file. Great! The hard part is behind us, but we’re not quite done yet.

Next, you’ll need a program that will extract photos from the save file. I believe there are a few, but they all seem to be for Windows. Fortunately, the one I use works perfectly under Wine. gbcameradumpIt’s called GBCameraDump.exe, and it can currently be found here. Download it, run it via Wine and select the .sav file you got from gbcflsh. You’ll have something that looks like this screenshot (except hopefully with better photos).

I would also advise you to — if this sort of thing matters to you — check the order of the saved images. They’re likely to be out of order due to, it seems, the way Nintendo decided to handle the saving of images to the cartridge. (Also, you’re likely to find some photos you thought were deleted, which may come as a surprise.)

So there you have it: how to get photos off of this camera of the past, using the operating system of the (sigh) future.

Upgraded to WordPress 3.0

The old adage (which I think I made up) about spending more time geeking around with a WordPress installation than actually writing in the damned blog holds true, ladies and gentlemen.

I just finished upgrading this fine blog to the newly-stable WordPress 3.0.

In case you were wondering and/or sitting on the edge of your seats, I took great care to:

  1. Disable all of my plugins
  2. Dump a copy of my WordPress MySQL database using the aptly-titled mysqldump
  3. tar a copy of my WordPress directory
  4. Do the upgrade!
  5. Re-enable the plugins one-by-one, making sure each works (or at least doesn’t break anything)

While I know not everyone is so lucky, I’m glad to see that everything appears to work here, because I’d be deathly embarrassed if, you know, Google or Bing’s webcrawler came by and things weren’t looking up to my usual standards.

How Windows ate my EXIF data (and how I mostly fixed it)

The background

As we’ve already established, I love to take photos, and I have a strong bias toward digital. While I received my first digital camera (the aforementioned Game Boy Camera) on my birthday in 2000, it wasn’t until the following summer that I got my first “real” digicam, a Nikon Coolpix 775.

From there, the flood of digital photos began. Initially, I just dumped every photo into a single folder on my shiny, new, gonna-help-me-do-well-in-college-this-fall laptop, and let their sequential filenames (DSCN0001.JPG, 0002, etc.) do the “sorting.”

This worked for a while, until it became clear that having all of my photos in one folder was poor for both organization and performance, so I started organizing my photos using dated subfolders (e.g. photos/2001/2001-08-12/). This was all the organization I did for my photos, and was also how  I viewed them, up until I began using photo managing software (first Picasa on Windows, later F-Spot under Ubuntu).

The problem

While these apps excel at taking photos and turning them into a well-organized stream based on date taken, I noticed that a small handful of photos were out-of-place in the timeline.1

After spending some time puzzled by this, it occurred to me that:

  1. none of these photos had EXIF data
  2. all of these were taken in 2001
  3. all of these had been taken in “portrait” mode (when you turn the camera sideways), as opposed to “landscape”

In an example of clearly misguided, youthful indiscretion, I had manually rotated these photos—remember, cameras didn’t have orientation sensors back then—using Windows Picture & Fax Viewer (Windows ME/XP’s default), and it ate my photos’ EXIF data! From then on, I started using the camera’s built-in rotate functionality.

But, ugh, I still had a bunch of old, messed up photos. Fortunately, I wasn’t totally in the dark about these photos’ chronology, as I knew the correct dates that these photos were taken, thanks to the surrounding sequential photos still having their EXIF data.

The solution

For the last few years, I let these few photos just be, annoyed that they would always show up in the wrong places. So today, I finally did something about this: I gave them new EXIF data using the best information I had at my disposal.

While I didn’t know the precise time taken, I did have dates for these photos, so I figured giving them EXIF with the right date and wrong time was better than no date at all. I accomplished this using a pair of Linux programs: jhead and touch. Here’s how:

First, I created an EXIF tag for a given photo using jhead:

$ jhead -mkexif DSCN1282.JPG

Then, I touched the file (in Unix-y parlance, change the file’s “modified” timestamp) to midnight (00:00:00) on the appropriate date (e.g. August 12, 2001):

$ touch -t 200108120000.00 DSCN1228.JPG

Finally, I used jhead to change the file’s EXIF timestamp to the newly-fixed modified date:

$ jhead -dsft DSCN1282.JPG

Having re-added the problem images to my F-Spot library, the photos now appear more-or-less in the place they should. They’re now good enough that I’ll never again have to see those photos mixed in with the wrong year!

  1. I know what you’re thinking: that there were times when I forgot to set the date on my camera. Nope. No way. I never forget to set the date on my camera, because making sure my photos have the correct date and time is something that I’m a bit obsessive about, and the first thing I do after charging my camera’s battery is always check the date.[]

…but my new camera sucks a little too much

[If you’re just joining us, see part one.]

I recently felt like I needed a new crappy camera in my life. I found myself in a drugstore yesterday, where I purchased one of those miniature ones, a Vivitar Clipshot (née Sakar 11693). At $10, the price was right but it’s a little too cheap to have a screen built-in, and the “viewfinder” is a laughably inaccurate hole in the body. Even more exciting, I thought! It’ll be like taking photos with film and waiting to see what develops!

I couldn’t find reference to the camera working in Ubuntu with a quick Web search, but the specs on the package claimed that it works in OS X without drivers. This seemed to imply that it was a standard USB Mass Storage device, the kind you plug in and have just work, as it appears to the computer as a removable drive.

So I expected quick and easy access to my photos. I was wrong.

The OS detects the device, but not as a normal camera device, nor a Mass Storage device. This is what lsusb had to say about it:

Bus 007 Device 008: ID 0979:0371 Jeilin Technology Corp., Ltd

Searching for that lead me to a number of blog and forum posts where people discussed ways to possibly get the camera working, but to no avail. This post received a number of replies, with this reply being the most helpful: (emphasis mine)

Professor Theodore Kilgore from Alabama has been working on a driver for this camera. As of about 6 months ago, the Professor had me download his driver for the camera, and the driver lets download files from the camera. But since the pictures are stored in an encrypted format on the storage media of the camera, there is still work to be done to decrypt the picture files into a viewable format (this is the last I heard anyway).

The photos are stored encrypted on the camera, so you have to use the included Windows software to download them. Glad to know they’re being protected… from me. This crappy camera is a little too crappy for me. I haven’t tried it on a Mac yet, but I can’t imagine how this could possibly work without drivers.

There will be more crappy digital cameras in my life, but one can only hope that the next one sucks in the way it should.

Breaking news: This piece of garbage does not work in OS X either.

More introduction (this time, the geek side)

I understand that self-identifying as a geek in 2010 makes me neither cool nor special, now that geeks are considered… you know… cool and special. But having laid out my blogging cred, I’d still like to make the case for the geek side of the equation (equations being something I actually know very little about).

Yep, a distaste for mathematics curtailed dreams of studying computer science, or something along those lines, in college. Back in middle school, however, I was happily hacking BASIC in my school’s Apple //e lab. I had sort of a knack for it; in computer class, I raced through the packet of programs we were required to transcribe faster than anyone else, and began spending my time writing my own programs, which would do things like tell my friend that his favorite football team sucked, repeatedly, through the magic of 20 GOTO 10.

I didn’t really apply this knowledge very well at the time; it would still be a couple of years before I had a computer at home. And even when I finally did, a completely awesome Pentium 166 MHz IBM Aptiva1 running Windows 95, I didn’t quite know how to get started programming on it.2

Another device appeared in my life a few years after the computer; I received a TI-83 graphing calculator for use in Algebra II. I initially found that it made a great mobile Tetris machine, but it wasn’t until reading Bill Gates’ The Road Ahead, in which he recounted his early days programming primitive computers, that I found myself inspired to do more with it.3

The calculator seemed like a good place to start programming, especially because the user manual contained an entire chapter devoted to teaching the TI-BASIC language! I picked this up pretty quickly, since I still remembered a lot of concepts from Apple BASIC. In my junior year of high school, I was soon writing programs to help me take shortcuts to solving math and science problems. But most importantly, I wanted to make games.

So I made a game. How I did so could be its own entry, and very well may be in the future.

This inspired me to sign up for the Computer Programming I elective in my senior year. They taught us Visual Basic, and the class was neither interesting nor fun. This, paired with the realization that studying computer science in college meant taking lots of math (something I’d always heard, but college course catalogs assured), made it clear that I should focus on the other thing I liked doing: writing.

I majored in communications, and the rest is history. Except for a fruitless foray into Python a couple of years ago, I haven’t programmed much lately.

But I still embody, I think, the hacker ethos. For me, 2005 could also have been called the mythical Year of Linux on the Desktop, thanks to the then-nascent, but still quite amazing, Ubuntu distribution. While it was alien to me, and didn’t quite ‘just work’ on my laptop, I persevered (smug Windows-using friends would say I “suffered”) and use it to this day. I love Ubuntu, and it still… almost just works.

Along the same geek lines, doing more with the devices I own seems to be a recurring theme in my life. These days. I carry in my pocket a rooted Android phone (running CyanogenMod), and at home have a homebrew-enabled Nintendo Wii and DS, a Canon PowerShot sporting CHDK, and Linksys routers running the dd-wrt and Tomato firmwares. My (lack of) skill-set means that you won’t find me helping the cause of hacking open a new device, but I’m glad to file the occasional bug. In short, I like to get as much as possible out of my devices, including, quite literally, my data. Backup is a topic I’ll be coming back to, for sure.

I think that about sums up my geek side (and unintentionally makes a pretty good case for my navel-gazing side).

  1. Mine looked exactly like the tower pictured there![]
  2. Let’s remember this when we talk about the iPad.[]
  3. My 2010-self is a little embarrassed by having drawn geekspiration from Bill Gates, but you’re reading a truthful blog.[]