My new workstation set-up

Working mostly from home (save for the occasional coffeehouse “office” day) for the last year and a half as a freelancer, my workstation set-up has been a slowly evolving arrangement. First I was in a bedroom on the main floor; now I’m in a dormer upstairs. I’ve been working exclusively with my MacBook for most of that time, but with increasing frequency I’ve had to work on large-layout web pages for clients with no access to a screen larger than 1280×800. Yesterday I finally decided it was time to make a change. I wasn’t up for the $899 outlay for a 23-inch Apple Cinema Display, so after a little (OK, very little) research, I settled on an LG 20-inch LCD that supports 1600×900 resolution, for $159 at Best Buy.

I quickly found that using the keyboard on my MacBook while looking at the LG display was not a satisfactory arrangement, so I also added an Apple Bluetooth wireless mouse. I also found that my desk surface was too low for the new monitor, so I solved that problem with a $6.99 wall shelf from IKEA. That shelf also works well for elevating my computer speakers — a change that makes a surprising difference to the sound. While I was at IKEA I also picked up a solar powered LED desk lamp. Anything to help reduce the number of cords on my desk.

The only problem I’ve encountered so far is the Mini DisplayPort jack on my MacBook. There’s… something… wrong with it. Not sure what, but the Mini DisplayPort adapter doesn’t fit properly. In fact, it requires a tremendous amount of force to insert the plug into the jack. So much so, that I was convinced at first that it was the wrong adapter. But it’s not. It works. But I’ve confirmed that forcing the plug into the jack has actually damaged the plug. But it still works, so for now I’m living with it.

Overall, I’m happy with the arrangement, even if some of the details (the intense brightness of the LCD display, the need to put the solar cell in the window to charge it during the day, along with a few other quirks) are imperfect. But my improved posture itself is enough to justify the effort.

And now, a crappy picture:

New workstation set-up

Added bonus: I hadn’t even thought about the awesomeness of dual displays when I set out to get the LCD. Also, it’s nice to put my Mighty Mouse to use again after it’s been sitting in the desk drawer for months. But the biggest unexpected change — I figured out that the vintage optometrist’s chair I use (along with the vintage optometrist’s desk you see in the picture) actually can be raised… so I cranked it all the way up.

Download those PDFs!

Wow, I really like these 512x512 icons in Snow Leopard...This post is strictly for web developers/server administrators. The rest of you can resume your daily activities, confident that nothing that was even remotely relevant to you transpired here.

PDFs. Web browsers. Both are a daily, or at least frequent, part of the lives of most computer users. But not all web browsers are created equal when it comes to the matter of handling PDFs. Some browsers (say, the ones developed by commercial OS makers) take the approach of trying to manage everything for the user. They include PDF readers that are embedded right into the browser, and PDFs load almost like another web page. Other browsers (most notably Firefox) treat PDFs as downloadable files, and when the user clicks a link to one, the file gets downloaded to their hard drive to be opened in a “helper app” — usually Adobe Reader.

Most website owners prefer the latter approach, and I suspect most users do as well. PDFs in general are not much like web pages, and it does not seem logical that they should be viewed within a web browser. Generally when people are accessing a PDF, it’s because they want to download the document to their computer to be used offline or to print. It is illogical for these actions to take place in a web browser. Sure, savvy users can right-click (or on Mac, Ctrl-click) and select “Save linked file as…” or some such nonsense from the contextual menu. But a lot of Windows users don’t even know their mouse has a right button, a lot of Mac users have no idea that you can press keys and click the mouse button simultaneously to perform special actions, and a lot of both would be confused by this entire process.

So we come to the matter of web developers (such as myself) trying to find ways to force the web browser to download the file instead of loading it directly. A trick I have used often is to link not to the file directly, but to a special PHP script that reads the file into the server’s memory, changes various aspects of the response (such as the MIME type), and then streams the content out to the browser. This is especially useful when you want to restrict access to files, say only to logged-in users, or only to users who have entered a special passcode. The PHP script is perfect for that, because it allows you to execute some code before sending the file to the browser. It even lets you store your files in a directory on the server that web browsers cannot access directly, ensuring (more or less… this article isn’t about hacking) the security of your files.

But what if your files aren’t in a protected area? What if you don’t want to bother with the mucky-muck of the PHP wrapper — you just want to link directly to the (browser-accessible) file, but you still want to force the download? Well, if you’re using Apache, you’re in luck. I found this great explanation of a small block of code you need to add to your httpd.conf file to achieve the same effect.

Ultimately, what you want to do is change the MIME type of the response. Browsers that are inclined to load PDFs internally perform this magic by seeking out files that are sent with the application/pdf MIME type. But there’s a very handy, “generic” MIME type for binary files, which all browsers treat as files to be downloaded rather than displayed directly: application/octet-stream. It may sound like a group of 8 singers standing in a small river, but it really just means… a generic binary file.

Here’s the complete block of code to put into your httpd.conf file, or into the appropriate virtual host configuration, however it’s stored on your particular server. I placed the code just within the virtual host configuration for the client in question, so the change applies only to their site, and not to any others that are also running on the server:

<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

If you’re not the server admin, you should also be able to put this in a .htaccess file in your site’s root directory, but I haven’t actually tested that to see if it works.

Pocket Sysadmin

I’m leaving on a jet plane, don’t know when I’ll be back again. External link

Actually, that’s not true: I will be back on Sunday. But the point is, I’m going on a trip… and more importantly, I’m not taking my laptop. Gasp! Can it be true? I’ll answer that for you: yes, it’s true.

OK, enough with this absurdly bad writing. On to the matter at hand: traveling sans laptop. Since I began freelancing in mid-2008, it’s been a given that I would always have my laptop with me. Not because I am a workaholic (not true) or because I’m an Internet junkie (true), but primarily because I needed to have a way to monitor and troubleshoot web server performance in case any of my clients had technical problems while I was gone.

But for this trip, I’ve decided I want to make it a real vacation. I want to remove the temptation to work when I really shouldn’t. I need a break. But I still need to be accessible if an emergency arises, and I need to be able to do something about it. Accessibility has been a non-issue ever since I got a cell phone: just call me. Or, since I got an iPhone: email, text, or call me (preferably in that order). But heretofore, the best I could do with a phone/iPhone was become aware of a problem. I still needed a full-fledged computer to actually do anything productive.

Over the past couple of weeks I’ve been preparing my iPhone to become an all-in-one tool for managing my business on the road. That meant setting up all of the diagnostic and troubleshooting tools I could, to ensure that I can adequately monitor the performance of the web servers I’m responsible for, and fix any problems that come up. Here are the tools I’m using to make that possible:

iStat

iStat

iStat is a very polished little utility for monitoring system performance. Its main feature is that it provides detailed stats on your iPhone itself: battery capacity, memory usage, storage available, IP address, uptime, running processes, and MAC address. But what’s really cool about it is that there are remote monitoring tools that allow you to monitor your Mac from your iPhone, or, more importantly for me, you can monitor a Linux, BSD or Solaris server. It requires a fair bit of command-line mucky-muck to set up (including compiling from source), but in a matter of minutes I had multiple Linux servers set up, sending their performance data to my iPhone wherever I go. With iStat, I can be proactive in monitoring server performance.

TouchTerm SSH

TouchTerm SSH

So, great. iStat lets me see how my servers are doing. But what if there’s a problem? That’s where TouchTerm SSH comes in. When I work with servers from my computer, the main application I use is Terminal. The SSH protocol allows me to connect securely to my servers with a command-line interface, where I can do anything I need to do: check running processes, modify configurations, restart services, etc. TouchTerm SSH is a fully-functional SSH terminal on the iPhone. With it, anything that I can do via SSH from my computer, I can now do with the iPhone. I just installed it today, so I haven’t completely put it through its paces, but I am sure that before long this will be one of the most indispensable apps I have installed on my iPhone. Even more than Ramp Champ.

Slicehost

Slicehost Pro

This one’s a bit more specialized, obviously, but since Slicehost’s iPhone app was one of the main selling points for me to go with them in the first place, it’s worth acknowledging.

Slicehost is a VPS hosting company based in St. Louis. They offer great service at unbeatable prices. Running a VPS is not for the feint of heart, but if you’re not afraid of taking full responsibility for your own server, Slicehost is the way to go. Their simple web-based admin interface makes it a snap to set up your own server with one of any number of Linux distros (Ubuntu, Debian, Gentoo, CentOS, Fedora, Arch or Red Hat), and once it’s running, to monitor its performance and reboot if necessary.

The iPhone app’s functionality is pretty limited, but it has the one critical function I need: if the slice becomes unresponsive, you can reboot it. Sure, you can do that from their mobile website too, but it’s always fun to have another app on your home screen.

The saddest party ever

I’m not playing dumb here: I really don’t know why Microsoft is so defensive about Apple. Despite Apple’s inroads in market share (including, apparently, 91% of the $1000-plus PC market), Windows is still by far the dominant OS on computers worldwide. Windows 7 will probably sell more copies in the first day than any Mac OS upgrade does in its first month, just by virtue of shipping with new PCs. (But don’t quote me on that. I’d love to be proven egregiously wrong.)

Sure, most of Microsoft’s success over the years has come by copying Apple, or by acquiring other innovators. But still, some of the things Microsoft has been doing lately seem so reflexive, so derivative, so defensive, so… desperate. The “I’m a PC” ads and today’s news about hiring away Apple Store employees are just the tip of the iceberg.

And then, courtesy of the Nerdery, we have this: perhaps the saddest statement of all. One would be inclined to think this is a joke. But the production values and the quality of the acting (enthusiasm!) suggest it has to be legit. Begging the question: WHY? SWEET JESUS, WHY???

Believe it or not, I actually am enthusiastic about Windows 7. I probably won’t buy it on release day, but I almost definitely will buy it before my Windows 7 RC license expires next June. Still, who the hell is going to throw a party like this? And who would come to it, other than to give them a wedgie?

Come to think of it, after watching this video, I almost want to give myself a wedgie. But it was all worth it for what comes at 5:43. Priceless.

But just in case I haven’t adequately dissuaded you (and you know who you are), here’s how you can host your own.

Arial vs. Helvetica: a cheat sheet

Stoking the flames of the ongoing (mixed-metaphor) battle between Arial and Helvetica comes this cheat sheet courtesy of the ragbag. (Found via swissmiss via… wait for it… Daring Fireball, surprise!)

This guide hits all of the key differences I go by (the capital R and G; the lowercase a), and a few I hadn’t previously noticed.

Arial vs. Helvetica

The best part of the whole thing, though, is something I discovered in a comment on the swissmiss post: Helvetica, the Shirt. Sweet. Every one of these is bound to piss someone off, albeit for a different reason: the one actually in Helvetica will enrage those who hate Helvetica on principle (it’s overused, it’s not really neutral, it is really neutral, etc. etc.), while the one in Arial will piss off the Helvetica lovers (including myself), if they bother to look closely enough to see the differences.

The one in Cooper Black… well, I don’t know; for me that font will always be associated with Garfield in the early ’80s. I actually like Cooper Black in a cheesy, retro sort of way. But I think the point is probably that Helvetica is so neutral, or at least aspires to be, whereas Cooper Black is the epitome of a font with a personality of its own. (Well, OK, that title probably really belongs to Rosewood, but Cooper is at least a somewhat versatile.)

And then, of course, there’s the one in Comic Sans, which we will never speak of again.