Tips 'n Tricks

Cheap 3Ware RAID cards are awesome


Just a quick tip this time. As part of a server reshuffle at work we picked up a 3Ware Escalade 7006-2 PCI IDE RAID card that has turned out to be quite brilliant. Instead of dealing with CPU and I/O-intensive software RAID (as this particular server was set up with before), now we have reliable, hardware driven RAID that only cost $100! It was unbelievably easy to set up to boot, I simply plugged in the card with the machine's two 33gb drives, did a quick firmware update, booted into the BIOS-level configuration panel and within 30 seconds had a RAID-1 (drive mirror) setup created. My SP4-slipstreamed Windows 2000 Server installation went without a hitch, besides catching the driver-installation prompt before it disappeared, and right now I'm installing the usual boat-load of Windows Updates. This is one card that I thoroughly recommend to anyone who needs some basic drive redundancy, and as its available on ebay for $100 there's no reason not to put it on all your basic servers or anywhere else you would otherwise use software-based RAID.

A huge thanks to Bryan Smith who tipped me off to this card, and continued thanks to him for the continued tips and insight.

TIP: Installing Sqlite-Ruby causes errors


After installing Instant Rails on one of my machines I then set to install Sqlite, an extremely simple to use database program, and the connector to link it to Ruby. Simple enough, I thought, there's a Gem for it right there. While it was simple to install, there was a little problem with it that it took me a moment to realize what was going on. During the install it said the following:

D:\InstantRails\rails_apps>gem install sqlite3-ruby
Attempting local installation of 'sqlite3-ruby'
Local gem file not found: sqlite3-ruby*.gem
Attempting remote installation of 'sqlite3-ruby'
Updating Gem source index for:
Successfully installed sqlite3-ruby-1.1.0-mswin32
Installing RDoc documentation for sqlite3-ruby-1.1.0-mswin32...
lib/sqlite3/database.rb:637:65: Skipping require of dynamic string: "sqlite3/driver/#{driver.to_s.downcase}/driver"
lib/sqlite3/database.rb:642:59: Skipping require of dynamic string: "sqlite3/driver/#{d.downcase}/driver"

As it turned out the errors listed ("skipping require of..") turns out to be not too serious. As you can see above those lines it has said that the basic install succeeded ok, where it got stuck was automatically generating the documentation, which really isn't a big deal for Rails usage as we won't be hitting the Sqlite functions directly.

Firefox browsing carrots?!?


For the last two days the Firefox install on our home PC has been behaving oddly, specifically moving the arrow keys no longer moves the page as a whole, instead it scrolls through the text like in Notepad, MS Word or something. As it turned out I had inadvertantly turned on caret browsing/navigation where you can move around the page and select content with your keys rather than the mouse. Most likely I accidentally hit the F7 key which turns it on while I was tidying the desk at home, ironically I found out about it while cleaning my desk at work and wiping down my keyboard when I accidentally hit the relevant key. I can see how it would be beneficial at times but I wish there was a status display to say it was turned on/off to at least give a clue to newbies that it was at least possible, so they don't think they're going insane when their computer starts doing something funny. Doh.

Tip: Thunderbird and IMAP caching


A small tip for all your Thunderbird users who read your email via IMAP.

For some reason I was under the assumption that Thunderbird stored a copy of each message in subscribed IMAP mailboxes. As it turned out, this assumption was 100% incorrect with the default settings, and so a large chunk of email archives that I thought I had stored from 2004 and 2005 are now gone. Darn.

It is possible, however, to enable this life-saving feature. What you have to do is go to your account settings (Tools menu, select Accounts), then on one of your IMAP accounts go to the Offline & Disk Space section. On this page make sure to check the two top options (Make the messages in my inbox available when I am working offline and When I create new folders, select them for offline use), then click Select folders for offline use, and in the window that pops up go through the list checking off all of your important folders (usually everything except for your Trash and Junk mailboxes).

That turns on the feature, but it won't automatically cache all of the email that has already been listed. To do this you simply go to the File menu in the main program, select Offline and then Download/Sync now. The window that pops up lets you select what you want to download (email, news or both), then just click OK to have Thunderbird fly through your email and download it all.

While I'm not sure why this extra level of caching is not turned on by default, a little bit of fiddling to get it working will ensure that you don't end up loosing two years of email.

MySQL Tip: phpMyAdmin export filename


A quick time for any users for phpMyAdmin and MySQL.

When you backup your database using phpMyAdmin, an "export" in their terminology, by default it names the file simply databasename.txt, e.g. damien_blog.txt. If you do regular backups this becomes a slight hassle as each time you have to rename the file to something more useful, and decide if you want to name it after the date, or add a version number (e.g. "database_backup_5.txt"), etc.

There's an easier way to take care of this. Instead of letting phpMyAdmin name the backup file after the database, have it automatically add the date to the filename too. Then, when you download the file you'll be able to list them in order, oldest through newest, and never wonder whether you named the file correctly the last time, or which one is newer.

To do so is quite easy, simply go to the Export page in phpMyAdmin, change the Save as file filename template to __DB___%Y%m%d%H%i and your backup will now be named e.g. damien_blog_200602131315.txt. What makes this even more useful is if you click the option labelled remember template, that way you'll never have to remember this again, simply click it and all backups that you do from then on (from that computer and that web browser) will be named accordingly.

Note that the date is listed as year, month, day, hour and then minute, which when you have several files listed in a directory one after the other makes it really easy to see the files in the correct order, rather than trying do list them with e.g. the European date format of day-month-year or the American format of month-day-year.

Update: Thanks to reader Jörg for pointing out that the last part of the string should have been %i rather than %m to output the minutes.


Subscribe to Tips 'n Tricks