Friday, September 14, 2007

SSL / HTTPS stops working on localhost under IIS 5.1

I have an ASP.NET web application that uses SSL.

The other day it stopped working on my development machine (Win XP Pro SP2). Whenever I tried to navigate to the SSL page my browser said it couldn't find the page.

I spent hours trying to google an answer to this problem.

The thing that finally fixed it was.... (drum roll)... a reboot.

Now here's the proof that I've taken leave of my senses. My colleague had the same problem a few days ago. I helped him resolve it, and even suggested the reboot solution. It worked for him. But today when this problem happened to me, I forgot all about that episode, and wasted time until I came up with the same solution. Again.

I must be getting old.

Incidentally, if you need an SSL certificate for testing purposes, try Microsofts SelfSSL utility. It creates the certificate and installs it for you.

It's available at https://www.microsoft.com/downloads/details.aspx?familyid=56FC92EE-A71A-4C73-B628-ADE629C89499&displaylang=en or search for "Internet Information Services (IIS) 6.0 Resource Kit Tools".

IMPORTANT UPDATE: Microsoft's SelfSSL utility will cause MSDE to stop working. It tries to install certificates in the SQL Server which makes it impossible to connect to.

Thursday, May 31, 2007

BuzzNet to Blogger woes

There was a cool feature at BuzzNet.com. It let you email a photo to a secret email address and would then create a blog entry at BuzzNet from the email. Really handy when you were on the road, had some nice photos, and wanted to upload them quickly without stuffing around with URL's and HTML image references and crap like that.

What was also nice was the BlogThis! facility that let you convert the new BuzzNet entry into a Blog Entry here at Blogger.

After I upgraded to Blogger's new gmail accounts, I was unable to use the BlogThis! facility at BuzzNet.

I've been stuffing around with this for ages, and every time I tried to get BuzzNet to talk to Blogger I got errors, and it wouldn't retrieve a list of Blogs.

Eventually I gave up in disgust and tried Flickr.Com.

It works! Perfectly! Easily!

I created a new Flickr account, told it that I had a Blogger account, and it directed me to a page at Google which let me authorize Flickr to update my blog.

Now I can email a photo to a Flickr address, and it automatically creates a new Blog entry for me.

Next time I go on a cruise, I'm all set to upload my new photos every day without spending hours trying to figure out all the HTML references.

I am a very happy camper. If anyone else has this problem with Buzznet - forget them - just upgrade to Flickr and make your life easier.

Wednesday, April 11, 2007

Laptop Runs like a Dog

My laptop has been running slowly for months. I thought I had problems with the CPU temperature, the CPU itself, spywarre, viruses, global warming, little green men - you name it.

The penny finally dropped. (D'OH!)

My power management settings were set to "Default Power Scheme". So Windows was throttling the CPU to reduce power usage and extend the life of my battery. That's useless to me because my computer is rarely un-plugged.

I changed it to "Minimal Power Management" and WHOOOOSH!!!!! It's running as fast as it used to.

Nice to have decent laptop power again. I've been putting up with crawling speeds for months. If only I'd found this solution earlier!

Thursday, January 25, 2007

Outlook 2003 Runs like a Dog

I've been growing increasingly frustrated with the amount of CPU time consumed by MS-Outlook 2003 on my laptop.

When Autoarchive runs every morning at 9am, the system grinds to a halt. There's no way in Outlook you can change the TIME at which this process runs. So my solution to the problem is to disable Autoarchive, wait till midnight, enable it, and tell it to run every day. That way I won't be around while it's archiving. How stupid that I have to stay up till midnight because MS products don't work properly. Does anyone know any better solutions to this?

The other contributing factor is my archive folders. I have them visible in the folder window that appears on the left hand side of outlook - so I can see "Mailbox - Me", "Personal Folders", "Archives" etc down the left hand side. I thought this might be slowing things down a bit, so I right-clicked on the Archove and Personal Folders, selected "Close", and the folder disappeared from view. After I did this, Outlook seemed to consume less CPU time, so I think I've solved this problem.

One final thing that might be adding to the overall slowness is the fact that my main outlook mail folder connects through a VPN to my exchange server (i.e. its not local to me). I think the combination of VPN and Exchange might be using up a lot of CPU.

Surely there must be something better?

Friday, January 12, 2007

It Works!!!!

Ben Tatasciore and his team at Fone Zone Strathpine are legends.

I complained to Ben yesterday about my poor experience with Telstra and he solved my problem. Basically the upgrade to a 3G sim card broke my messagebank service, and Ben helped me navigate the labyrinth of Telstra to find an intelligent lifeform that was able to "Re-provision" my phone and get my messagebank working again.

Thanks for the excellent service, Ben.

Special thanks also to Anthony at Telstra who flipped the right switches and made the right incantations to get it all working for me.

As an addendum to my report about MyPhoneExplorer that I mentioned yesterday, another nifty feature is that when it's connected to my computer, and I receive an incoming SMS, it pops the SMS up on my compuer screen. Plus when someone calls on the mobile while its connected to the computer, a popup flashes on the screen to tell me someone is calling, and it tells me who the caller is.

I am a very happy customer now!

Thursday, January 11, 2007

It's a Sony :)


I love my new Sony K800i mobile phone.

I can email, take photos, videos, browse the net, watch Fox-Tel, listen to the radio and use it as an MP3 player. Mine came with a 500mb memory stick, and a nifty little adapter so you can plug the stick into your laptop.

I have two gripes:

GRIPE 1. The softwae that comes with it is useless. This bloatware is almost 50mb to download. It fails to install, with heaps of DLL errors. Gives errors when you uninstall it, blurts out wierd pop-up messages in chinese when I reboot my machine, and renders the phone unusable when connected to the laptop via USB.

SOLUTION 1. A FANTASTIC program called MyPhoneExplorer - it's free, only 2mb in size, installs with no problems, does everything the Sony software pretends to do and more, and is easy to use. It even has a great utility where you can use your computer keyboard to navigate around the phone rather than pressing the small keys on the phone. If you download it and like it, don't forget to send a donation to the author. He accepts paypal.

GRIPE 2. Telstra. It took 18 hours to get my new 3G Sim Card activated. While they were doing that, by messagebank service died. I tried phoning them 4 times, each time on the phone for 30 to 40 minutes. On 3 of those occastions they cut me off after 30 minutes.

SOLUTION 2. Any suggestions? I won't touch Optus with a barge-pole because they're majority owned by the Singapore government who has the nasty habit of executing people by hanging. I don't know anything about Voda, 3 or AAPT. Telstra is sort of like an alcoholic uncle. You don't like him very much, he does nasty things, but you're worried if you swap him for someone else's uncle you might end up with someone even worse.

Tuesday, December 05, 2006

This is "cool" (well not as hot as it used to be).

The screen on my LG LW70 laptop is slowly degrading. Every week I get a new vertical line on it as the pixels die.

I've got an extended warranty on it, so I could return it to get a new screen, but I run my life and my business on my laptop, so I'd rather buy a new one than let it out of my sight for more than a few hours.

I noticed that it was pumping out a lot of heat from the heatsink on the left hand side of the unit, and thought that was normal for laptops. But when the next vertical line started flickering on my screen I got desperate and googled "lg lw70 laptop temperature" and discovered a new utility.

Speedfan (http://www.almico.com/speedfan.php) is a clever utility that monitors the temperature of a PC at several different points (HDD, CPU, Video) and lets you configure responses to certain events if the heat gets too high.

To my horror, when I ran it on my laptop, I discovered that it was running at 66 Celsius, which is pretty hot.

I racked my brain trying to figure out a way to reduce the temperature and came up with two ideas:
  • I put the laptop on a U-shaped metal tray. The U-Shape meant that air could get underneath it, and the metal tray conducted the excessive heat away from the laptop.
  • I made the windows power schemes the same whether the laptop is running on batteries or not. So the HDD spins down after 5 minutes, and the Laptop tries to conserve as much power (i.e. produce as little heat) as possible.

The results were drastic. The laptop temperature dropped from 66C down to 44C in about 2 hours.

It won't undo the heat damage that's already been done to my screen, but at least the screen won't sustain any more damage.

Now all I have to do is figure out how to live without my laptop for a week so I can get it repaired :)

I'd recommend speedfan for any machine that has a decent bios and allows monitoring of temperatures.

Friday, September 01, 2006

Sharepoint doesn't send out alert emails

There are a lot of useful articles in the Microsoft Knowledgebase to help you resolve the problem where sharepoint won't send out email alerts. Some of them are really complex.

BUT!!!! Before you spend hours (like I did) trying all the complex solutions to make it work, try the simplest solution first:

Make sure your mail server allows relays from itself. In exchange, go into the SMTP server properties (Start / Programs / Microsoft Exchange / System Manager / Servers / My Server / Protocols / Smtp / Default Server / Access / Relay / "Only the list below" - Granted to 127.0.0.1.

Wednesday, June 21, 2006

Memes and viruses of the mind

A while ago I posted my thoughts about "The Virus of Ideas".

Since then I've been lucky enough to discover the work of Richard Dawkins. His 1991 article "Viruses of the Mind" explains the concept of an idea being analogous to a virus that infects the mind.

He says:
Like computer viruses, successful mind viruses will tend to be hard for their victims to detect. If you are the victim of one, the chances are that you won't know it, and may even vigorously deny it. Accepting that a virus might be difficult to detect in your own mind, what tell-tale signs might you look out for? I shall answer by imaging how a medical textbook might describe the typical symptoms of a sufferer (arbitrarily assumed to be male).
It's worth reading his description of those symptoms. Check out his article if you get a chance - especially if you think you might have been infected :)

Tuesday, August 16, 2005

Easy backup

I downloaded Image for Windows (IFW) from http://www.terabyteunlimited.com/imagew.html

It lets me backup my entire hard drive to DVD or CD. Plus it makes the DVD or CD bootable. That means if my hard drive ever crashes, I just boot from the DVD, and it will automatically restore everything.

Amazing. Easy to use. Only $US 27.

My only gripes:

1. It doesn't write to DVD-RW so you can't re-use DVD's.
2. Someone stupid like me could accidentally boot from a DVD and wipeout everything on the hard drive.

Both those gripes are solvable - just use cheap DVD-R disks, and (easier still) don't be stupid.

I'll email their tech dept and let you know if they have a solution for the DVD-RW's.

Addendum (17-Aug-05)

IFW can handle DVD+RW disks without any problems. DVD-RW's need to be fully blanked or brand-new before they will work. So I think I'll buy some +RW's and see how I go! The article is here: http://terabyteunlimited.com/kb/article.php?id=215

Thursday, August 11, 2005

Crash recovery - a litany of errors

Here's how NOT to recover from a faulty hard drive.

I turned on my laptop and got an error while booting about a faulty NTLDR.SYS file - or some name like that. The error said to insert the Windows CD and select option "R" to recover.

My Acer laptop didn't come with a Windows CD, it came with a "Recovery CD". So I inserted that CD, booted from it, and the damned thing started formatting my hard drive. Yes there was some vague warnings in broken English about backing up data, but I was expecting to see a Windows message, and got something totally different.

"Ah!!!!" I screamed as I saw what was happening, and turned my machine off in the middle of the format.

Now the disk drive was partially formatted, and had no directory info on it.

So I plugged in my trusty USB drive backup, and went about getting the machine ready to Ghost the backup drive back to the original drive.

Getting a laptop to boot from a CD and run Ghost is an effort in itself and took me about 2 hours to figure out. If you want to try it yourself, get Ghost to burn a bootable floppy that does the same thing, and use something like UBCD to convert the floppy to a CD.

So I ghosted the backup drive back to the laptop, booted the laptop and.... NOTHING. The USB drive was faulty, and the backup drive was unreadable.

"Ah!!!!" I screamed again in a Homer Simpsonesque panic.

I ran Spinrite on the USB drive in a vain attempt to fix it. But the back up drive was faulty (remember, Neil?) and so it just made things worse - and I lost the partition table on the backup drive.

So I threw the USB drive caddy out the window, and connected te Backup drive to a spare IDE port on my desktop computer. Still no joy.

So I tried a thing called "Diskpatch" which is supposed to fix partition tables. It said a few encouraging words, and did absolutely nothing.

Finally, I tried a thing caled "iRecover". It was able to see stuff on the drive. Most of it was scrambled, but I used it to pump as much corrupted data from the drive as I could.

It has been running for about 7 days, and has almost finished pumping everything from the 60GB backup drive. about 75% of the stuff is rubbish. I was able to recover one or two snippets that were some use to me.

Bottom line - I lost about 6 months worth of work - but was able to scrounge a lot of it back from other sources.

I NEVER EVER want to go through this again. It's bad for my health, my marriage and my business. Here's what I will do in future:

1. Backup more regularly to multiple locations.
2. Use something like NTI to create a bootable backup DVD of my drive.
3. Get a new Laptop - the Acer Travelmate is rubbish.
4. Never try to run windows repair on a faulty drive until I've pumped it for all the information I can.
5. Never trust a USB drive. Especially one that runs hot.
6. Backup more regularly to multiple locations.
7. Buy high quality equipment

The other thing with Laptops - don't move them around until you've put the machine in standby mode. If you do, the diskdrive is still spinning, and there's a good chance you'll stuff the drive up.

You will have one of your disks crash on you sometime in the next few years. It's happened to me 4 times in the last 12 months on 2 different machines. Make sure you can recover from it. Do something about it today.

iRecover is available from http://www.diydatarecovery.nl

It works, but it is damned slow.

Saturday, March 12, 2005

Loan repayment calculations and high school algebra

FV = (PMT*(1+RATE*TYPE)*(1-(1+RATE)^NPER)/RATE) - PV*(1+RATE)^NPER

This is the formula for the "Future Value" (FV) of an investment assuming an initial investment (PV), constant repayments (PMT) and a constant interest rate (RATE) over a fixed term of months (NPER). When "TYPE" is zero, loan repayments are made in advance. When "TYPE" is 1, loan repayments are made in arrears.

You can algebraically rearrange the formula to give an expression that calculates PMT.

You can also rearrange the formula to give an expression that calculates PV.

Both of these just require simple high-school algebra.

But you CAN'T rearrange the formula to give an expresion that calculates RATE or NPER.

To work out these figures, you have to use an iterative method where you "plug in" a guess of what you think the rate or period should be, evaulate the result, and adjust your guess accordingly.

If you use some smart iterative methods, you should only have to loop about 5 times. The simplest way is given two guess / result pairs (x1, y1) and (x2, y2), and wanting to find the "x" which will result in "y", your next best guess is to try x = y*(x1-x2)/(y1-y2).

In subsequent iterations, discard the (x,y) pair furthest from the desired result, and repeat the process with the new results.

RAID-1 Upgrade (RTFM!!!)

My server had 2 x 60gb Seagate IDE drives in a software RAID-1 array.

For those of you who don't know, this means that although I had two 60gb drives in the server, it only looked like I had one, because I'd set it up so that Windows kept a "mirror" of the drive. That meant that if one drive failed, my machine would still work ok because the "mirrored" copy would still be available.

One of the drives recently started showing errors, so I decided to replace it.

Although 60gb drives are still available, I decided to replace the array with two 160GB drives to give me a bit more space.

The big question was, how to replace the drives without taking my server offline for too long?

One alternative would be to break the mirror (remove the faulty drive from the machine) and replace it with the new 160GB drive, then add that 160GB drive to the mirror. Althoug I wasn't 100% certain, I thought that if I did this, the 160GB drive would only use 60GB of the available space, and I'd be wasting most of it. Despite this, the advantage would be that the machine would only be offline just for the time it took to replace the drive and turn it back on again.

Instead of this approach, I decided to add one of the 160gb drives to the machine as a 3rd disk drive. I would then use Norton Ghost to copy the contents of the mirrored volume onto the new drive. The disadvantage of this approach is that Norton Ghost requires the machine to be offline while it runs in DOS mode to copy the entire contents of the drive, ensuring that nothing gets changed inadvertently while copying from one drive to another.

For some reason I cannot fathom, 10 minutes after starting the Ghost, the screen on the server went blank, and the server died. Initially I thought it was just some sort of lowlevel screen saver in the video card (optimistic, aren't I?) so I left the machine for a couple of hours, hoping that ghost would finish.

Eventually, after trying the same process several times, I came to the conclusion that ghosting a mirrored volume just wasn't going to work. I thought perhaps it was because my power supply couldn't cope with 3 drives, tape drive and DVD drive and so disconnected the DVD and tape. This still didn't fix the problem, so all I can suggest is that Ghost doesn't like copying mirrors.

In the end, I read the instructions on the label of the new disk drive, downloaded a utlility from http://www.seagate.com/support called "DiscWizard for Windows" and ran it.

It's great!!! It found my new drive, formatted and partitioned it for me, then asked me if I wanted to replace an existing bootable drive. I said yes, it copied all the files, then gave me a printout telling me what jumpers to change on each of the drives, and whereabouts on the IDE cable to put the new drive. All with friendly illustrations.

AND it did all the copying while the server was still online.

AND (best of all) it worked!

The added bonus is that DiscWizard is free. It comes with all Seagate drives.

So the moral of the story is that I was trying to be too smart. In this situation, if I had just RTFM (read the fine manual) I would have saved myself about 12 hours of frustrating heartache.

Today I've got two 160gb drives in a mirrored array, and feel very relieved that it's all working again. I'll know next time how to swap my disks over with the minimum amount of messing around.

Saturday, February 19, 2005

What's in a #Name?

Sometimes I've seen #Name? on MS-Access reports.

When it appears, the report is impossible to export to excel.

Rather than pull your hair out, check to see if the correct ADO reference is loaded in Tools / References. Usually the problem shows up as a missing reference. Fix the reference and the problem goes away.

The REAL challenge is when you're deploying and MDE or ADE, because the end user can't change tools / references.

In this case, you should make sure that the DLL MSADO15.DLL is registered. On my machine it lives in "C:\program Files\common Files\System\ado".

The command to register this file manually is:
regsvr32 "C:\program Files\common Files\System\ado\msado15.dll"

Republish info from a web site

It's really easy in .NET to output your own censored / transformed version of another web page.

Here's a code snippet which reads the contents of one web site, does some changes it, and re-publishes it on your own web site.

Make sure strURL has the "http://" at the front of it, and be sure to take acount of the fact that any relative references in the source web will still be relative in the target web.

Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(strURL)

Dim objResponse As WebResponse = objRequest.GetResponse()

Dim sr As StreamReader = New StreamReader(objResponse.GetResponseStream())

Response.Write(Page, SomeTransformationOf(sr.ReadToEnd()))

What the?

Tech Musings is a collection of technical thoughts and ideas by Neil