Raam Dev’s Weblog

Avatar

Look for what you do well, and excel.

  • In attempt to fix a slight usability issue with this blogs’ theme that caused the post comments link to appear that it might belong to the previous post, I moved the comments and date line underneath the post title (as opposed to above it) and adjusted the spacing to bring the two closer together. (0)
  • I installed WP Super Cache on this blog as a drop-in replacement for WP-Cache (which I disabled because of compatibility issues with PHP5). After enabling WP Super Cache and turning on the Super Cache Compression option, I can see a huge improvement in page load times. A page I always use for testing is the Archives page, which normally executes almost 2,000 SQL queries. Without the cache plugin, that page took almost 5 seconds to load. Now it loads in less than 2 seconds. (1)

HOWTO: Disable OS X Window Drop Shadow for Screenshots

One of the awesome features of OS X is the built-in screenshot mode. It allows you to easily select areas of the screen to capture (press Cmd+Shift+4 to activate screenshot mode), or select an entire window to capture (while in screenshot mode, press the spacebar to switch to window-capture mode).

I frequently post screenshots on this blog and I hated that the window screenshots included the drop shadow added by OS X around the window. This meant the width of the resulting screenshot was actually 50px bigger all the way around.

Luckily, there is a way to disable the drop shadow when taking screenshots. Simply open the terminal (Applications -> Utilities -> Terminal.app) and run the following command:

defaults write com.apple.screencapture disable-shadow -bool true

Now logout (or reboot) and when you login again your screenshots won’t include the drop shadow! For more helpful shortcuts and commands for screenshots in OS X, check out Taking Screenshots in Mac OS X.

Evil Google Secretly Installs Software Update

I was shocked to see this Google Software Update window on my Mac this morning asking me to install an update to the Google Talk Plugin:

Google Software Update

First of all, I had never seen this update window in my life and I never approved the installation of any such Software Update Engine! Secondly, what Google Talk Plugin is it talking about? As far as I can remember, I never installed a GTalk plugin. I use Adium for chatting on GTalk and I never had to install a plugin to use Google Talk! Maybe the update engine is trying to update the GTalk plugin that came with Adium?

There are some other people who are also quite annoyed by this secret update engine installation. Apparently the update engine is fully open-source, but there is no uninstall program. To uninstall it, you must unregister applications that are using it and wait a day for it to automatically uninstall itself. How ugly.

Browser Resolutions of the Interweb

I have often advocated designing websites to support as many screen resolutions and browsers as possible, including tiny mobile devices and text-based web browsers like Lynx (though I prefer Elinks myself). Whether I’m under-the-gun at work, or just designing a new WordPress theme for my blog, when time and resource constraints force me to decide on a minimum resolution I look for statistics to back up my choices. In a perfect world, all sites would be usable with all browser resolutions (and CSS would play nice with all browsers and 1px would be 1px… don’t get me started).

It wasn’t too long ago that a lot of people were still browsing the web with an 800×600 screen resolution. For most of us now though, the only time we see that screen resolution is when we don’t have the correct video drivers installed. W3CSchools keeps lots of interesting web stats based upon visitors to their site, including Browser Display Statistics. Here you can follow a clear trend to higher browser resolutions through the years:

Browser Display Statistics

This lead me to check my the visitor browser resolutions for this blog through Google Analytics. I’ve been keeping stats on this blog since September 2007 and with over 40,000 visits I figured I could get some good metrics:

raamdev.com Visitor Screen Resolutions

These stats seem to indicate the same thing as W3CSchool’s stats: 1024×768 is a clear winner. This got me thinking though. How many of the popular sites out there are viewable in 1024×768? What about 800×600, or even 640×480?

Yet Another Window Resizer is an excellent Firefox add-on that allows you to easily resize your browser to various resolutions. I visited various popular sites and tested their minimum browser resolutions:

[1024x768] - Amazon.com
[1024x768] - eBay
[1024x768] - Yahoo!
[1024x768] - Wikipedia
[1024x768] - CNN
[1024x768] - YouTube
[1024x768] - Apple
[1024x768] - Microsoft
[1024x768] - Digg
[1024x768] - Delicious
[1024x768] - Facebook
[800x600] - Twitter
[800x600] - WordPress 2.7 Admin Dashboard (screenshot)
[640x480] - Google Search (screenshot)
[640x480] - Google News
[640x480] - Google Maps

Clearly most sites have chosen to ignore smaller browser resolutions in favor of supporting only the most popular as a minimum. (Although this blog has a 1024×768 minimum requirement, the main content area is fully visible in 800×600.) The nature of the content presented by the site dictates a lot of the size requirements. For example, Google search presents textual content that can easily be (and most certainly should be) confined to a small area. In fact, the Google search results maintain a 640px width even when you’re using a much higher resolution (leaving a lot of white space to the right, but maintaining readability).

There is much to be said about textual readability on the web, but I’ll leave that for another post.

Yahoo DNS Issues Cause Problems in the United States

Yahoo! appears to be inaccessible to people in the US. Visiting yahoo.com redirects to www.yahoo.com and fails to load. I confirmed it was at least somewhat limited to the US by trying the connection from a shell account on a server in Europe.

Using dig (a Unix DNS lookup utility), we can see from within the United States that there is a problem with DNS. There is no A record with an IP address listed in the ANSWERS section:

;; QUESTION SECTION:
;www.yahoo.com. IN A

;; ANSWER SECTION:
www.yahoo.com. 129 IN CNAME www.wa1.b.yahoo.com.

And from the server in Europe:

;; QUESTION SECTION:
;www.yahoo.com. IN A

;; ANSWER SECTION:
www.yahoo.com. 272 IN CNAME www.wa1.b.yahoo.com.
www.wa1.b.yahoo.com. 33 IN CNAME www-real.wa1.b.yahoo.com.
www-real.wa1.b.yahoo.com. 33 IN A 209.191.93.52

;; AUTHORITY SECTION:
wa1.b.yahoo.com. 273 IN NS yf2.yahoo.com.
wa1.b.yahoo.com. 273 IN NS yf1.yahoo.com.

If you try connecting directly to the missing IP address, you should at least be able to get the main Yahoo page: http://209.191.93.52. You might also try temporarily adding an entry to your /etc/hosts or C:\Windows\system32\drivers\etc\hosts if you want to continue being able to use the FQDN.

UPDATE: As of 15:50 EST, Yahoo appears to be working again. The outage appeared to start around 15:11 EST, so that’s a good 40 minutes of downtime.

WordPress 2.7 RC1: A Preview of What’s Coming

I’m following WordPress on Twitter and I was excited to see a recent tweet that WordPress 2.7, Release Candidate 1 had been released. I was very curious to see if comment threading was added or if it had been dropped since Automattic’s acquisition of IntenseDebate a few months ago. (I’m sure I could have gotten an answer to that by poking around on the WordPress Trac, but it wasn’t that important.) Yesterday, I wrote about how I decided not to outsource my comments to IntenseDebate so if you read that post you’ll understand why I’m excited about the possibility of native comment threading.

For testing WP 2.7 RC1, I decided to upgrade an existing blog that I set up a few months ago, but that I haven’t launched yet. My first impression upon seeing the new WordPress Dashboard? Wow. It’s amazingly different (but in a good way). Oh, and there is native comment threading support!

I’ve included some screenshots below, including the Discussion Settings where you can see the new options for comment threading and Avatars. Also, I also did a quick threaded comments test using the default WordPress theme, which you can see at the end. Enjoy!

And for the finale, comment threading!

Not Outsourcing my Comments to IntenseDebate

I’ve been hearing a lot about IntenseDebate recently, in various blog posts and news sites (they were acquired by Automattic, the company behind WordPress, back in September). IntenseDebate is basically a set of tools that allows for enhanced commenting on your blog or website. Two features that caught my attention were Comment Threading and Reply-by-email.

Comment Threading was of particular interest to me because I find that being able to respond directly to a specific comment keeps the comments organized and relevant. Normally the way you respond directly to a comment without threading support is to prefix your reply with the persons name (e.g., “@raamdev That’s a great idea!”), but constantly searching the list of comments for the comment being replied to gets tiresome.

I don’t really have enough comment traffic on this blog to deal with the aforementioned problem on a regular basis, but I decided to install the IntenseDebate WordPress plugin to see how easily I could integrate it. I was impressed with how smoothly the process went. All my old comments (1,300+) were synced to IntenseDebate and there was nothing I needed to change on my theme templates — the entire commenting system was replaced with IntenseDebate’s commenting system, with threading support, a comment reputation point system, and all those other fancy features.

In the end, however, I decided to deactivate the plugin. I didn’t like that my comments were being loaded from an outside source, which both increased the average load time for each page and added yet another dependency on an external service. (In contrast, my Twitter sidebar uses Twitter Tools, which actually syncs tweets to the same database as WordPress and loads them from there. Dependency problems solved! To be fair though, the IntenseDebate plugin maintains a copy of all the comments in the WordPress database, just in case you decide to stop using it.) Customizing the look and feel of the comments also meant modifying CSS through my IntenseDebate account and right from the start I felt the need to customize and make the comment system less “busy” and self-advertising. There were no themes to choose from either. Ugh.

While doing all this thinking about the disadvantages of outsourcing my comments, I came across a post on Robert Nystorm’s blog where he decides to literally outsource all of his comments. Instead of having any form of commenting system, he simply provides a link to reddit, Digg, and StumbleUpon where he encourages people post their comments on his post. His rationale behind this is that people already use these other sites for commenting and those commenting systems are specifically tuned to handle comments. If you can’t beat’em, join’em.

But that’s extreme. Although I can sympathize with some of Robert’s frustration, I think a commenting system, even if only a simple one, is important. While some people may be familiar with reddit, Digg, and StumbleUpon, not everyone will use those sites regularly or, for that matter, want to go through the trouble of creating an account just to post a comment.

Back in September, I wrote about how excited I was to hear that Comment Threading was coming in WordPress 2.7. I hope the features and functionality of IntenseDebate are somehow integrated into WordPress down the road, instead of indefinitely relying on an external service to provide the same functionality.

Stop all the Questions and Definitions!

Sites and services like Facebook and Twitter ask you questions. In fact they can even be configured to pester (i.e., “nudge”) you if for some reason you feel a moral, religious, or social obligation to keep the vast world of unknown people updated with your every mood, feeling, thought, current activity, or location.

I sat down in front of my computer with a splitting migraine, a migraine that had been piercing through my head the entire day, like an alien parasite whose only job was to disrupt, distract, and otherwise make my day as mentally challenging as possible. As I turned on the monitor, I saw that I had left the Twitter website open. “What are you doing?” the screen pestered, as if instantly joining forces with the alien parasite to make my brain work harder. But it had been 22 hours since I last wrote something on Twitter! Oh no! The world is going to end! I must update everyone immediately!

I suddenly realized that as I begin to use more social-networking sites and write more things on my blog, I am increasingly being pestered with questions and buttons that contain definitions of what I should be writing:

Write a New Page
Write a New Post
Write something…
Write another comment…
What are you doing right now?
Write something about yourself.
What are you doing?

How annoying! I mean really, it’s annoying. No, that’s not the alien parasite talking. This stuff is right in line with Google’s growing visual clutter, only worse. It’s bad enough that I come up with an interesting thing to search the Internet for only to have Google’s suggestions magically chase the original query away, but when everywhere I look for an outlet to express myself I find a question or a definition of what I should be writing, we’re bordering on mental invasion and theft!

These subtle things are killing the creative thought process and subtly removing truly free expression. I feel as though I’m fighting to keep my thoughts to myself just long enough to express them genuinely to whomever might be listening (even if that person is only a future version of myself).

HOWTO: Count Files Recursively with Exclusion on Linux

Find all files in this directory, including the files in sub-directories, and exclude all files that start with a period (dot files) and any directories named .thumbs. Then pass the list of results to the wc command to get a total count:

find . ! -name ".*" ! -path "*.thumbs*" -type f | wc -l

HOWTO: Make iTunes Read Ogg Files

After downloading the only available torrent of Hang Drum music I could find, I was shocked to discover that iTunes wouldn’t read the Ogg files it contained. I was so close to losing a ton of respect for Apple until I searched Google for a solution. Hoorah for the xiph.org open-source community!

Simply visit their site and download QuickTime Components binary package. After opening the .dmg file (Windows users should be able to just download and run the .exe file), copy XiphQT.component to ~/Library/Components (user-only) or to /Library/Components (system-wide).

If iTunes is open, restart it and wallah! You’ve got .ogg support in iTunes!

Google’s Growing Visual Clutter

Google’s latest “feature” is nothing short of annoying. I fell in love with Google Search for the clean, textual layout of the search results. The colored text I can deal with, but not visual buttons next to every single result! To make matters worse, Google doesn’t provide a way to disable this feature either, so your only two options are logging out of your Google account or installing a Greasemonkey extension.

Oh, and my rant doesn’t end there. Another feature that was recently added, Google Suggest, has been more trouble than it has help. I can’t even count how many times I’ve went to Google something only to have a big list of suggestions instantly erase the original search query from my head. There are hacky ways to disable that too, but come on Google! There should be options to disable this stuff!

Mounting HFS+ with Write Access in Debian

When I decided to reformat and install my Mac Mini with the latest testing version of Debian (lenny, at the time of this writing) I discovered that I couldn’t mount my HFS+ OS X backup drive with write access:

erin:/# mount -t hfsplus /dev/sda /osx-backup
[ 630.769804] hfs: write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.

This warning puzzled me because I was able to mount fine before the reinstall and, since the external drive is to be used as the bootable backup for my MBP, anything with “at your own risk” was unacceptable.

I had already erased my previous Linux installation so I had no way of checking what might have previously given me write access to the HFS+ drive. A quick apt-cache search hfs revealed a bunch of packages related to the HFS filesystem. I installed the two that looked relevant to what I was trying to do:

hfsplus - Tools to access HFS+ formatted volumes
hfsutils - Tools for reading and writing Macintosh volumes

No dice. I still couldn’t get write access without that warning. I tried loading the hfsplus module and then adding it to /etc/modules to see if that would make a difference. As I expected, it didn’t. I was almost ready to give up but there was another HFS package in the list that, even though it seemed unrelated to what was trying to do, seemed worth a shot:

hfsprogs - mkfs and fsck for HFS and HFS+ file systems

It worked! I have no idea how or why (and I’m not interested enough to figure it out), but after installing the hfsprogs package I was able to mount my HFS+ partition with write access.

Understanding the Linux Load Averages

I have been using Linux for several years now and although I have looked at the load averages from time to time (either using top or uptime), I never really understood what they meant. All I knew was that the three different numbers stood for averages over three different time spans (1, 5, and 15 minutes) and that under normal operation the numbers should stay under 1.00 (which I now know is only true for single-core CPUs).

Earlier this week at work I needed to figure out why a box was running slow. I was put in charge of determining the cause, whether it be excessive heat, low system resources, or something else. Here’s what I saw for load averages when I ran the top command on the box:

load average: 2.86, 3.00, 2.89

I knew that looked high, but I had no idea how to explain what “normal” was and why. I quickly realized that I needed a better understanding of what I was looking at before I could confidently explain what was going on. A quick Google search turned up this very detailed article about Linux load averages, including a look at some of the C functions that actually do the calculations (this was particularly interesting to me because I’m currently learning C).

To keep this post shorter than the aforementioned article, I’ll simply quote the two sentences that gave me a clear-as-day explanation of how to read Linux load averages:

The point of perfect utilization, meaning that the CPUs are always busy and, yet, no process ever waits for one, is the average matching the number of CPUs. If there are four CPUs on a machine and the reported one-minute load average is 4.00, the machine has been utilizing its processors perfectly for the last 60 seconds.

The machine I was checking at work was a single-core Celeron machine. This meant with a continuous load of almost 3.00 the CPU was being stressed much higher than it should be. Theoretically, a dual-core machine would drop this load to around 1.50 and a quad-core would drop it to 0.75.

There is a lot more behind truly understanding the Linux load averages, but the most important thing to understand is that they do not represent CPU usage. Rather they represent the load on the CPU by processes waiting for their chance to use the CPU. If you still can’t get your brain away from thinking in terms of percentages, consider 1.00 to be 100% load for single-core CPU’s, 2.00 to be 100% load for dual-core CPUs, and so on.

  • Sun Microsystems has added PHP support to their open-source Netbeans development IDE. I just tried the latest version (6.5) and I’m not impressed at all, at least with their OS X version: It’s slow and the Open File dialog takes a good 45 seconds (!) to load. (0)