NPR: When Patents Attack!

I write software for a living, and I have a hard time recognizing redeeming value of software patents (other than to have something to negotiate with when someone tries to sue a company). Reading the NPR transcript about patents got my blood boiling. The system has been gamed, and patent troll companies legally extort money from other companies.

Read or listen here. Are there good reasons to have software patents, and if so, on what types of inventions and in what circumstances?

Norton 360: Unbearably slow

I’ve got a Windows Vista laptop that’s about five years old. It’s a dual CPU machine with 2G of RAM. After installing several bits of new software, I noticed that it was unbearably slow when logging in, switching users, and logging out. The CPU use wasn’t too high, but the disk drive light indicated that it was being kept very busy. I booted Fedora 14 Live from a USB drive, and the computer was snappy and responsive.

I monitored the system processes, and most of the I/O reads and writes were attributed to svchost. On a Linux or UNIX machine, it would have been easy to identify which service was the culprit because each service (known as a daemon) runs as a separate process. But in Windows, services run as part of svchost, making them hard to identify and monitor individually.

Since I didn’t know what was causing the slowness, I guessed and uninstalled Mozy backup. Nope. That wasn’t it. My computer was still slow. So I uninstalled Norton 360. Problem solved. The computer is responsive and snappy again, and has remained so for the past month.

Shortly after I uninstalled Norton 360, a neighbour called and asked if I could figure out why “the Internet was running so slowly”. He thought he had Windows 7. When I arrived, I found that it was Windows XP running in 512M of RAM. I booted Fedora 14 from my USB flash drive, and found that his computer ran quickly and loaded web pages quickly. His Windows XP machine was running Norton 360, and task manager showed that Norton processes were consuming large amounts of disk I/O.

I uninstalled Norton 360, and on the recommendation of a smart colleague, installed the free Microsoft Security Essentials. The computer ran quickly after that. My neighbour is pleased. I went home and installed Security Essentials on my Vista machine, with little noticeable slowdown.

My conclusion is that Norton 360 may only be appropriate for newer hardware and generous amounts of RAM (4G or more).

Gnome 3: Not quite ready for prime time

Just over a week ago, I installed Fedora 15. After using Gnome 3 for two days, I decided that I’m better off using Gnome 2, KDE or XFCE.

With Gnome 3, I like the ability to type the name of the application I want to run instead of hunting for it in a menu. This is a feature I’ve enjoyed for the past five years with Windows Vista, so it’s refreshing to finally have it appear in Gnome.

With Gnome 3, however, I miss the following:

  1. A system monitor applet. When my system starts to feel slow, I pay attention to CPU and I/O wait overhead.
  2. Multi-monitor support when changing workspaces. When I move to a new workspace, Gnome 3 only moves one of my two screens to a new workspace. The other stays the same.
  3. Quick launch icons. I use them for Firefox, gVim, Eclipse, and other frequently used apps.

I expect that Gnome 3 will be improved rapidly, and Fedora 16’s Gnome 3 will more productive.

Update: There’s a list of ways to tweak Gnome shell to make it almost bearable: http://forums.fedoraforum.org/showthread.php?t=263006. In particular, by installing and using “gnome-tweak-tool”.

Misc Linux things: PATA or SATA, mutt and mailcap, tarsnap backup

The other day, I wondered whether the drive in my laptop was PATA or SATA. Fortunately, I didn’t have to tear it apart to find out. I simply wandered over to stackexchange.com and asked the question. Here’s the answer:

lspci -d $(cat /sys/block/sda/device/../../../vendor):$(cat /sys/block/sda/device/../../../device)
readlink -f /sys/block/sda/device/../../../driver

I’m a long time user of the mutt email client (as well as Thunderbird). At some point, viewing the HTML attachment (with the ‘v’ key) stopped invoking ‘lynx’ via my mailcap file. It turns out that the developers of mutt added an internal viewer, and moved mailcap support to the “m” key. I took the time to switch from using ‘lynx’ to using ‘links’. Here’s the entry from my $HOME/.mailcap file:

text/html; /usr/bin/links -dump -force-html %s; copiousoutput; nametemplate=%s.html

I’ve been gradually looking for an online, off-site Linux backup tool for  the past few years. I tried spideroak, but wasn’t pleased with the giant log files it kept in my home directory, and it wasn’t designed to back up files outside of my user account. Lately, I stumbled on another promising tool: tarsnap. I haven’t tried it yet, but I will. Pricing looks reasonable, and since it “deduplicates” storage, it means that I shouldn’t be backing up the same thing repeatedly. Here’s how one person configures tarsnap to keep up to X daily backups, Y weekly, and Z monthly.

Fedora 14, SSH ports and SELinux

SELinux in Fedora 14 is configured to constrain the ports on which SSH can listen (see the bug report). The solution:

setsebool -P sshd_forward_ports 1

This allows SSH to listen on ports besides 22, and to forward ports. Reading the bug report is interesting. In my opinion, OpenSSH has an outstanding security track record, and we probably don’t need additional SELinux policy to constrain it. It’s probably wise to practice security in-depth (to have more than one line of defense), but it creates a large road bump for most SSH power users. From what I read, it sounds like most people still disable SELinux.

Teriffic Linux Books

One of my QA coworkers had The Linux Phrasebook sitting on his desk. I noticed it was by Scott Granneman, and immediately thought, “if it’s by him, it’s got to be good.” As I thumbed through the pages of the book, I was impressed at the practical coverage of command line utilities including yum and rpm, apt and deb, etc. I highly recommend this book. It’s small so it’s easy to keep on hand.

For anyone wishing to write applications that take advantage of all that Linux has to offer, I recommend The Linux Programming Interface (also available from Amazon), aka TLPI. I used to recommend Stevens’ Advanced Programming in the UNIX Environment, but now I recommend TLPI because it is more comprehensive and just as readable. It’s not a small book, so a PDF makes it easier to keep on hand. I purchased my copy through the publisher, NoStarch with the coupon code “Mamaku” that gave me 30% off and a free PDF. The order total came to $80.00, including shipping.

Awesome Linux profiling tools: top -H and pstack

When I needed to figure out where the performance bottlenecks were in some Linux software, I found helpful answers at http://stackoverflow.com in the form of two tools: 1. naming threads in combination with “top -Hp <pid>” and 2. “pstack <pid>”. The first was helpful in watching which threads were consuming the most CPU. The second was useful in sampling the application over time to find the hot spots and their stack traces.

  • How to name a thread in Linux (or a process) — use prctl().
  • How to use stack sampling to find performance problems — use pstack.

Preventing laptop hard drive from overheating

Six months ago, I replaced the failing hard drive in my Linux laptop, and already, the SMART tools are telling me that I should back up and replace the hard drive — a high number of sectors have gone bad.

Hmmm. What’s this? SMART also reported that the hard drive had reached “overheating” temperature ranges. Why would that be? I did some Google searching, and came up with the following advice:

  1. Don’t close the laptop lid while it is powered up! This is how I had normally run my Linux laptop — it’s a server, and I leave the lid closed. Oops! I’ve changed the power settings so that when the laptop lid is closed, it sleeps.
  2. Edit /etc/grub.conf and add acpi_osi=Linux or try acpi=off to seee if apm (automatic hardware control) will take over. I’ve just started trying the former. UPDATE 8 Feb 2011: Using this prevented my laptop from waking up from sleep, so I stopped using it.
  3. Vacuum the dust off the fan screen (to prevent airflow blockage)
  4. Monitor the temperature with ‘smartclt’

Based on a tip from my father (a long time Linux expert), I ran “smartctl -H /dev/sda”, and it says “SMART overall-health self-assessment test result: PASSED”. I assume it means the hard drive is still okay, but I had better not forget to make regular backups, and monitor the status of the hard drive.

iPod Touch: what’s great, and what’s not

Janice gave me an iPod Touch, 4th generation, for my birthday. Here’s my take on it, compared to a Palm T|X and a Nexus One.

I’m going to take a list of features that I claimed I wanted, and recast it in terms of the iPod Touch. Next, I’m going to describe what pleases me about the iPod Touch, followed by what is annoying.

  1. Quick access. For some reason, I can forgive this omission with the iPod Touch, while I couldn’t with the Nexus One. Maybe the Nexus One prepared me so that I wasn’t disappointed.
  2. Bluetooth Keyboard support. Excellent. My Palm Bluetooth keyboard (3245ww) works like a charm with iOS 4. No Android devices do, that I know of.  This is a “killer feature” for me. Taking notes on a touch screen is vastly inferior to using a real keyboard.
  3. CalenGoo Calendar. Apple’s default calendar isn’t too bad, but CalenGoo is vastly superior, and worth more than the $6.99 that the author charges for the application. CalenGoo includes local alarms (on iOS 4), and snooze buttons. It lets me integrate my Google tasks into my calendar. CalenGoo isn’t quite as good as DateBk5 for Palm, but it’s close.
  4. Configurable alarm snooze length. With CalenGoo, I can configure the snooze length. Hooray!
  5. Contacts. With iOS, I can configure it to sort by last name, then by first name — unlike Android. I find that I usually use the search feature to look up contacts.
  6. Copy-and-paste in email, etc. Copy and paste on iOS 4 is outstanding, and works in nearly every app including email and the web browser. Copy and paste is better than on Android, and far superior to Palm, where I was limited to, at most, copying two paragraphs of text.
  7. Camera with good auto focus. I don’t particularly care about the camera in the iPod Touch, but it does do a good job with auto-focus.
  8. Standard headphone jack that isn’t finicky. What a relief! The iPod Touch headphone jack works as expected when I connect it to a variety of headphone jacks (my stereo), whereas the Nexus One would go into random shuffle preview mode.
  9. Record audio to a standard, ubiquitous format such as wav, ogg vorbis or mp3. Nope. Oh well. That’s what my Sansa Clip is for, I suppose.
  10. Full backup and restore. iTunes reportedly backs up my device.
  11. FM radio receiver. Nope. Good thing I have a Sansa Clip.

Things I love about the iPod Touch:

  1. Cost effective. It’s more cost effective than iPhone and Android because there’s no expensive monthly plan.
  2. The Retina display is outstanding and pleasing to look at, far better and more crisp than either the Nexus One or the Palm TX.
  3. The Safari web browser works very well. The browser on my Palm TX barely hobbled along, and often, that was too much, and it would crash, rebooting the Palm. So I never used that feature. Android’s browser is also excellent. It’s based on the same code: WebKit.
  4. When apps crash, it doesn’t take down the entire OS like on Palm.
  5. Slim and small. It fits in my pocket much better than my Palm TX.
  6. The Note Pad app lets me email notes to others. It also syncs the notes to my Google email.
  7. Availability. Purchase it from any Wal Mart, Target, or other department store.
  8. Accessories. The local Wal Mart had dozens of protector cases, alarm clocks, stereos, and other gear designed for iPod Touch. Try finding accessories for an Android device. They’re going to be sparse, and available online only. In its heyday, Palm had a variety of accessories (not nearly as much), but Palm is history.

Apps I love:

  1. Pandora music. I love being able to pick a music genre, and have it play excellent music that I’m not familiar with. http://www.pandora.com/
  2. LDS Gospel Library.
  3. LDS Hymns and LDS Children’s Songbook.
  4. Dictionary.com free dictionary.
  5. CoderCalc RPN calculator with four lines of stack on the display. With a clumsy touch screen, I find it vital to know that what I entered was correct, and with the four lines of stack, the problem is solved. A calculator with real, physical keys still beats a touch screen calculator.
  6. Mint.com app to keep me up to date on my finances.
  7. AIM Free, for when I need to send free SMS messages. Yes, AIM supports SMS.
  8. Kindle. The Kindle reader includes the New Oxford American dictionary.  Simply tap on a word in a book, and a definition pops up.
  9. iBooks. iBooks also supports pop-up definitions of words.
  10. Google. This app launches various Google services online. Google has made its web apps customized to work very well on iPhone. The google email web app is better than the iOS email app.
  11. Password Manager. I’ve chosen MyKeePass, not because it’s the best, but because it allows me to manage, store, and retrieve my passwords on Linux, Windows and the iPod Touch. I also figured out how to translate my Palm GNU Keyring password database into a format that Linux keepassx could import.

Annoyances:

  1. No standard menu button in apps. Both Palm and Android got it right.
  2. Apple’s email configuration wizard misled me to sync with Google Mail instead of Exchange. This meant that I didn’t get my Google Contacts synchronized to my iPod Touch until coworkers told me that Google supports an exchange connector. Instructions for setting it up are at http://www.google.com/mobile/sync/
  3. The music app didn’t show me a “seek in track” option. A friend helpfully showed me that by single-tapping on the (non-existent) album art, it would pop up a previously-hidden slider.
  4. No ogg vorbis support. I know this thing is billed as an iPod, but in my opinion, the Sansa Clip is a far better iPod. My music collection is in ogg vorbis format. The Clip supports vorbis, and it has an FM radio tuner, clips to my shirt, and is more convenient for outdoor activities.  For me, the iPod Touch is a Personal Digital Assistant, not an iPod. On the other hand, the Sansa Clip doesn’t have Pandora.
  5. Tethered to iTunes. When first unpackaged, it won’t do anything without first being connected to iTunes on Windows or Mac. I’m not sure whether Linux gtkpod would do the trick or not.
  6. Touch screen interfaces are inferior to stylus interfaces. The stylus on Palm was far more precise for selecting text, tapping on hyperlinks in Plucker e-books, etc. On the other hand, with a fat-finger interface, there’s no stylus to misplace. I love pinch-and-zoom.
  7. No way to send contacts to other devices via bluetooth. Palm had peer-to-peer networking down ten or more years ago, first with InfraRed, and then with Bluetooth. I suppose that in an always-connected iPhone world, people email things to each other. I’m not always connected.

I’ve never owned an Apple device until now. They’ve created an excellent device with the iPod Touch. It’s not perfect, but it’s adequate to replace my Palm TX as a personal digital assistant, and in many ways, it’s far superior.

“In 1976, the basic computational power of a $200 iPod would have cost one billion dollars, while the full set of capabilities would have been impossible at any price, much less in a shirt pocket.”  — Erik Brynjolfsson, Paul Hofmann, and John Jordan, Communications of the ACM, May 2010, p 33.