Why is "Content-type: text/html" displayed at the top of my CGI pages?

Recently one of my clients was having some issues with a CGI script they purchased. They’re running IIS on all of their servers, and oddly, this purchased script worked on one of their servers but not the other. On the server where the script wasn’t running correctly, IE displayed “Content-type: text/html” at the top of the CGI page. If I remember correctly FireFox displayed the entire markup of the page in text.

After quite a bit of research I found this excellent Perl for Win32 FAQ and learned that when you setup Perl for IIS you have two options, you can use “Perl for Win32” or you can use “PerlIS.” In my client’s case, they were running Perl for Win32 on the server with the working script and PerlIS on the server with the broken script.

Perl for Win32 = perl.exe
PerlIS = perlis.dll

They are both the same version of Perl, and both come included when you download Perl for Windows. However, even though they are the same version of Perl, they are different “interpreters.”

Perl for Win32 and PerlIS are mostly alike, but PerlIS requires that your scripts include the HTTP response status line as well as all headers for the response. Using Perl for Win32 you only need to specify the headers.

PerlIS is about two times faster than Perl for Win32. However, most CGI script that you purchase, or download for free, do not specify the HTTP response status line. This is because most scripts are not written for PerlIS. (Ok, I can’t backup that claim, but that seems to be the case in my experience.)

If your Perl scripts are displaying the content-type at the top of the page, try configuring your IIS server to run Perl using perl.exe instead of perlis.dll.

How to delete an entire directory via SSH

I know this is probably common knowledge to Linux and Unix geeks. But every time I need to remove a directory with files in my NearlyFreeSpeech.Net SSH terminal I end up having to google for the command. So here it is for anyone else who’s out there googling!

rm -r -f YourDirectory

rm = remove / delete
-r = recursively deletes the directory and all files in it, including subdirectories
-f = will not ask for confirmation before deleting

A Windows Genuine False Positive!

So this evening my $300 genuine copy of Windows Vista Business decided it was no longer genuine. But my favorite part is I have lots of work due in the next few days and I’m paid by the hour. That means I am now losing money and face! So needless to say I’m a little upset.

But hey, surely Microsoft has some mechanism to get me back in the game right? Not after 6:00pm! Nope. I have to write them a pleasant email and kick back and wait for a response in the next 24 hours. Of course this should be fine. It’s not like I shelled out $300 big ones for the privilege of running Windows Vista Business. And hey, who uses Vista Business for business right? And even if it was for business purposes, who works after 6pm? Yes, a 24 hour turnaround email is the PERFECT solution. *That’s sarcasm Microsoft!*

I must admit, I was able to “chat” with a Microsoft rep. He was a tremendous help providing me with a link to the webpage I initiated the “chat” from, that also contained the support email address. He also ensured me Microsoft would respond to my email within the next 24 hours and he informed me that the email support is absolutely FREE! Can you believe it!? Bless my lucky stars, it’s FREE! *That’s sarcasm again Microsoft!* Free… humph. Give me a break. I should be billing Microsoft my time spent dealing with WGA.

If it wasn’t for Visual Studio Microsoft would have one less developer. Hell, maybe I’ll migrate over to Mono and run Linux and OSX.

I’m crushing over Drobo!

I’m in love with Data Robotics, Inc. no hassle data redundancy device, Drobo. I’ve been kicking around the idea of building my own RAID 5 network file server to store all of my music, videos, pics, and et cetera for a couple of years now. But that, of course, is no easy task, nor is it easy on the pocket book. And now here comes Drobo to my rescue!

So I’m dropping the “build my own RAID 5 network server” idea. Now I want to get a Drobo and new wireless Linksys router with USB storage support. Although, I’ve heard a rumor that Data Robotics, Inc. is planning on coming out with a new Drobo with built in network support later this fall or early next year. I’m not sure I can wait that long. This thing is just too cool.Oh, I heard about the Drobo and this YouTube video on TWiT. Great Podcast.

My new MacBook OR How to manually eject a CD from your MacBook Pro

I just bought my first Mac. It’s a 2.33 Ghz Intel Core 2 Duo MacBook Pro 15inch model. It has taken me a little bit of time to get use to, but I’m starting to get the hang of it after I plugged in my favorite 2 button cordless mouse. Let me tell you, coming from a Windows background, right-click makes all the difference in the world.

Anyways. I’m working on setting up Windows XP using Boot Camp. Then I plan to use Parallels to quickly switch between OSX and my Boot Camp partition of Windows XP. By using a Boot Camp partition instead of a pure Parallels virtual machine, I can boot directly into Windows if I need more resources for playing games or whatnot.

To do all of this I had to slipstream my old copy of Windows XP with Service Pack 2. This requires creating a bootable CD. I thought I did everything correctly, but when Boot Camp Assistant restarted my Mac to install Windows, my Mac hung on boot-up. Turns out my CD burning software didn’t have all the features I needed. So now my Mac is stuck trying to load a boot CD that is incapable of booting. How the hell do I get the CD out to get back into OSX!? There is no manual mechanism to eject a CD on the MacBook Pro.

The Payoff
Do a hard restart. Then click and hold down the mouse button while the system boots up. Continue to hold down the mouse button until the CD ejects.

Totally intuitive. Not sure why I didn’t immediately think of that. 😉