Wednesday, July 11, 2007

Handler "$HANDLER" has a bad module "IsapiModule" in its module list

If you've seen this error when trying to get a CGI handler working in IIS7 on Windows Vista, check your applicationHost.config file (in c:\windows\system32\inetserv\config). Specifically, look in the <modules> list to make sure you have an entry specifying:

<add name="IsapiModule" type="" precondition="" />

I was beating my head against the wall with this error message until I added this. (In my case it was within <location path="My Website"><system.webserver><modules>, just to be specific.)

I already had an entry for IsapiModule in globalModules, mind you. I have no idea why this is required, so far the IIS7 configuration system leaves a lot to be desired.

Microsoft, when providing a gun that can shoot you in the foot, it might help to add some safeties. How about making it really easy to configure common CGI modules like Perl, PHP, Python, Ruby, etc?

Wednesday, May 23, 2007

Ummm... my BlackBerry has GMaps+GPS and NO support?

Official Google Blog: Cingular BlackBerry 8800 has Google Maps and GPS

Steve acts like this is some new development in phones... yet my BlackBerry 8703e has full GPS support, runs Google Maps, and does not benefit from this special code unlock that google has provided for these 8800 phones.

Why?

Oh... my phone runs on Sprint PCS network. Perhaps Sprint hasn't paid google for the favor yet?

Wednesday, April 18, 2007

Handy SQL Server Query: Date String For Filename

Here's a simple piece of code for creating a string in YYYYMMDDHHMMSS format, suitable for use as a filename:

REPLACE(REPLACE(REPLACE(CONVERT(char(19), GETDATE(), 120), ' ', ''), '-', ''), ':', '')

If you ran this at 1:23:05 PM on December 3, 2006, it would return "20061203132305".

SQL Server 2000 Database Doesn't Shrink After Removing Columns

If you've ever come across a situation where you've removed text, ntext or image columns from a SQL Server 2000 database, and the size of your database doesn't shrink even after compressing it, you may have run into the problem described here:

DBCC SHRINKFILE and SHRINKDATABASE commands may not work because of sparsely populated text, ntext, or image columns

The solution is to create a DTS package to transfer all of your database objects into a new database, and remove the old one, and then rename the new one to your original database name (if necessary). We did this recently and recovered 50% of the disk space wasted.

Hopefully this problem was solved in SQL Server 2005.

Using SQL Query Analyzer via RDP Can Be Slow

I won't bore you with how I discovered this phenomenon, but rest assured if you run Microsoft Query Analyzer on a remote computer using Remote Desktop Protocol (RDP), you may notice strangely slow execution times when returning a large number of rows in text-result mode. If you switch to grid results, or if you minimize the query analyzer while the query is running, you will not have this problem!

A real world example:

A SQL Query that returns 40,000 records. When running this query in text results mode via RDP, Query Analyzer consistently took 8-9 seconds to finish. When running in grid results mode, it took < 1 second! When minimized in text results mode, it took 2-3 seconds (most likely due to my slow reflexes minimizing the window). You may find that this is true for many programs that are outputting a large volume of text to the screen -- keep then minimized if possible. And it's not what you might initially think, that a large number of screen-draws are being performed, slowing things down. Nope, my query analyzer results were not scrolling down the screen visibly. This is just some weird behavior with RDP and certain text displaying screens. If anyone knows why this happens, feel free to comment below.

(Note: this behavior was specifically observed using RDP connected to a Windows 2003 Server running SQL Server 2000.)

TimeZones in JavaScript

If you want to obtain the user's timezone offset in JavaScript (that is, the difference between their timezone and Greenwich Mean Time, or GMT), use this snippet:

(new Date().getTimezoneOffset()/60)*(-1)

Monday, April 16, 2007

Syncing a Keychain from One Mac to Another

As a companion piece to our Entourage Encryption Setup guide, this document will explain how to take the keychain you created (or any keychain) and have a copy of it installed on another Mac.

You have two options. The first is easier, the second is more secure (and is cheaper).

.Mac Sync. Transfer over the internet using .Mac (easier but not as safe, and expensive if you don't already use .Mac, although there are 60-day trials of .Mac available).

  1. Edit your keychain settings in the Keychain Access program so that it syncs the keychain up with your .Mac account.

  2. Sync all your Macs up with .Mac, and you will have all your public/private keys on all your systems.

  3. Turn off the sync feature for this keychain once you've finished syncing up all your Macs.
... or ...

Sneakernet. Transfer by hand using a burned CD or USB key.
  1. Make a copy of the .keychain file in your ~/Library/Keychains folder (the ~ represents your home directory, usually your name). If you followed our Entourage Encryption guide, this file will be named "Encrypted Email.keychain."

  2. Burn this copy to CD, and safely transport it to the Mac you want to sync it to.

  3. Securely erase the COPY (not the original) .keychain file once you've finished burning it to CD, using the "Secure Empty Trash" from the Finder menu. (You may also try to skip the entire copy/erase step by burning the .keychain file directly from your Keychains folder, although we received CD Burn errors when we tried this method.)

  4. Copy the .keychain file into the ~/Library/Keychains folder on the destination computer.

  5. Open the Keychain Access program on the new computer.

  6. Select the Edit menu, and then Keychain List.

  7. Press the + button at the bottom/left side of the window.

  8. Locate the .keychain file you copied over, and select it.

  9. The keychain is now installed into your Mac.

  10. Destroy the CD you used to copy the keychain.
Your data is only as safe and secure as your keychain file... be careful with it!

If you notice any mistakes, please let us know by commenting on this article.