Deleting the Postgres service in XP

Installed Postgres 8.2, but the obsolete service for Postgres 8.1 hung around. Here’s how to manually get rid of it.

Ever since I installed Postgres 8.2, I’ve been still getting Postgres 8.1 listed in my pgAdmin tool — postgres runs as a service, and I was surprised that even after uninstalling, manually deleting dependent files and directories, and cleaning out the registry manually and with automated tools that the old service still persisted to run.

Here’s how to remove the service.

Right click the service and go to properties. Look at the Path to executable and find the service name:
“C:\Program Files\PostgreSQL\8.1\bin\pg_ctl.exe” runservice -N “pgsql-8.1” -D “C:\Program Files\PostgreSQL\8.1\data\”

Now Start / Run… cmd and enter this at the command prompt:
sc delete pgsql-8.1

You’ll get a “[SC] DeleteService SUCCESS” message as confirmation it’s gone.

Vista: First Impressions

Just saw Vista for the first time in a long while. Anger ensues. Real anger. Microsoft has cut their own throat. Vista sucks the joy out of getting a new computer.

Well, we ended up with Vista at the office because Dell wouldn’t ship the specific machine we wanted without it. Out of the box, it was complaining that the audio driver Dell installed wasn’t compatible with Vista.

Meanwhile, I have this to say: if you are a developer or power user, you are going to hate Vista’s interface.

And I’m not talking the “Cancel or Allow” dialog that appears for every program you’re installing. No, I’m talking about the explorer.

It’s pretty, yes. However, usable is another thing. You know the trick, Start / Run… C:\ return?

Did that, up popped a window which showed half a dozen files, and no directories. Seems that Microsoft is now filtering the display of directories from the file listing by default.

Now, given that we had a directory that had directories, navigating became even more problematic when we entered the path because it looked like the directory was empty, when it wasn’t.

Instead of using backslashes in the address bar, you get drop down windows. That’s clever… until you try and actually use it. We found in the bottom left a “thing” labeled folders, and when we clicked it, it gave an explorer-like view of the hierarchy. At that point we had our directory name on the screen several times, but trying to figure out how to delete it became even more annoying.

We had, and I’m not making this up, three Windows experts of 20+ years in the room, and we were all trying to figure out where trivial operations had gone. Frustration levels went through the roof. From what we can tell there’s no good reason why stuff changed — it just did. It’s certainly not more usable. It’s far from intuitive. Basic navigation has become a game of hide’n’seek.

At the moment we’re flipping everything back to acting as Classic Mode as physically possible, but we keep bumping into the stupidest of things.

Vista may look very Mac-like, but it certainly doesn’t behave very Mac like.

I honestly thought my first impressions were going to hold prejudice to performance issues. No, one thing is for sure, this system is going to frustrate a lot of people.

First impression: Vista sucks the joy out of getting a new computer.

Normally I’d give Vista a thumbs down, but I want to give it a reasonable amount of time to change my mind. Adopting to any new operating system can be frustrating the first few hours. Except I don’t recall this with OS X.

UPDATE: There’s another trick you can normally do by default, and that’s open a command prompt window and drag a file in — Windows will instant expand the full pathname to the file; this is a great shortcut. It doesn’t work in Vista by default. But that’s ok, because you can highlight the full path from the address bar and cut’n’paste that into a command window. Oh wait, there is no path now, just drop downs, so you can’t just select with the mouse and Control-C / move to new window / Control-V. Not making me happy….

UPDATE: Some progress, we’ve been disabling security managers, getting lucky about more classic mode settings, and somehow, we don’t know how, got folders displaying in directory listings. It’s getting closer to usable. Tension dropping… that’s a good sign. Hate the new start menu, btw.

UPDATE: Argh, new problem: a print driver doesn’t exist for our corporate printer. We can’t print using Vista.

UPDATE: When installing Vista on a laptop, the touch pad was too sensitive (no way to change it until Vista installed) and an accidental double-tap proceeded forward in the installation wizard, but there was no back button. Not happy.

UPDATE: New problem surfaced – when Vista goes to sleep, it never wakes up. Pressing a key or wiggling the mouse doesn’t bring it back to life. Oddly enough, the computer is powered on, and drive bays open and close. Have to hold in the power button for seven seconds, but that reboots. We’ve lost a lot of work this way. Time to munge the power management settings.

MEANWHILE: Dell announces a new quad-dual-core machine, but states that it doesn’t work with Vista. What’s up with that?

UPDATE: We’ve finally had enough, we’re buying an external copy of XP, and are planning on blowing Vista away. As things stand today, a little more than after a month after this post was first written, I don’t see how anyone would want to use this. Pretty, yes. Pretty annoying, also yes.

UPDATE: Remember the disk defragmenter? Well, now there’s no visual status, it all happens in the background. You can’t tell how far along it is, how badly your drive is fragmented, nor how much better it has made things.

Behind the Blue Screen of Death, Is Microsoft Vunerable?

XP suffered a Blue Screen of Death due to a very simple cause, but this got the gears going — are phone-home-on-error systems vulnerable and not getting the attention they deserve?

This morning I came in to work and discovered my Windows XP desktop in a crashed state, you know the one, the Blue Screen of Death; the same one you see billboard sized at Times Square.

Given that I’m meticulous about patches, clean registry settings, and an army of spyware, malware, and anti-virus detectors, not to mention the machine is used for very limited purposes, it’s very likely this isn’t some bad 3rd party Windows driver. Oh, no, the error message squarely put the blame on the USB driver.

Knowing that, I can think back to what my very last activities were at the end of the day. I saved a file in a simple editor, that file was on my Dell USB stick, and after it saved, I initiated a Windows Reboot, and pulled my USB stick (whose activity light was well extinguished) and walked at the door as Windows was still shutting down.

I’m going to simply conclude that Windows was so “busy” with its shutdown that it didn’t “see” the USB device get removed, and it was left in some horrified state that it had to die (something that does not happen with my Mac, ever). This is further confirmed by the fact that, after a hard power reset, XP came up fine, and all of my diagnostic utilities passed. Windows had just, plain and simply, died.

Sometime after booting, however, I got a message that Windows had detected it had shutdown in a bad manner, and it wanted to know if it was okay to send the report to Microsoft. I’m all for making things better, but I thought it might be interesting to look into the post-Blue Screen of Death activities.

The Blue Screen of Death did a crash dump and some files were written to disk in a directory called C:\Documents and Settings\{username}\Local Settings\Temp\WEReeed.dir00.

The file manifest.txt consisted of name/value pairs separated by an equal sign, in much the same way as the contents of an .ini file might be done, sans section headers.

The more curious contents of this file revealed the server, a url, and some values, what data files were being sent, and a very obscure reference to what might be a “blue” screen report.

Server=watson.microsoft.com
Stage2URL=/dw/bluetwo.asp?BCCode=1000007e&BCP1=C0000005&
BCP2=BA2C4371&BCP3=BA503AF4&BCP4=BA5037F0&
OSVer=5_1_2600&SP=2_0&Product=256_1
DataFiles=C:\DOCUME~1\{username}\LOCALS~1\Temp\
WEReeed.dir00\Mini022207-01.dmp|C:\DOCUME~1\{username}\
LOCALS~1\Temp\WEReeed.dir00\sysdata.xml
ErrorSubPath=blue

The sysdata.xml file consisted of an XML file that listed every device, its description, hardware id, service, and driver, often the version and file size as well. Sure enough, the usehub.sys file was there, buried in the batch. It simply appears this file is trying to collect the configuration of the machine, perhaps to recreate it in the lab for some regression testing and battery of comprehensively abusive test suites. At least that’s what I would hope happens.

The Mini022207-01.dump is clearly the month/day/year-sequence_number of when the dump was made. When the Blue Screen of Death happened, it claimed it was dumping all of physical memory. Given this Mini-Dump is only 92K, some post-processing has clearly taken place.

In my case, the file was clearly a page dump of a section of memory, with what looked like uninitialized memory labeled with the bytes literally reading “PAGE”. Inside, this binary blob it was very easy to make out pgfilter.sys, USBSTOR.SYS, and kmixer.sys. Other device driver names and binary glop followed.

Actually submitting the report showed that watson.microsoft.com (as in the product Dr. Watson) was queried and an IP of 65.54.206.43 came back. An https: exchange was made, and moments later oca.partners.extranet.microsoft.com (131.107.112.111) was ask of the DNS server; more content was sent to that server. wwwbaytest5.microsoft.com (207.46.18.30) was then asked for a certificate, via GET /pki/mscorp/Microsoft%20Secure%20Sever%20Authority(3).crt; a few more of these went back and forth, and wer.microsoft.com (131.107.115.67) got involved, that when my browser reported the human readable response to the report. Compounding matters, no tracking number or email address is provided, so even if I wanted to provide Microsoft with more information to help them fix the problem, I can’t.

After all this happened another thought struck me… Microsoft doesn’t really have a good track record with security, especially when it comes to error checking and services that aren’t used that much. I ponder what would have happened if the information had been tampered with before being sent? Is there invalid input that could send the error reporting systems into a tizzy? Could some bogus changes make their debugger or tool execute malicious code? Would some false data send some poor analysis team chasing fictional ghosts? What would happen if an automated script kiddie generated millions of bogus machine crash reports; how would they get sorted out?

I ask the question because there are quite a number of phone-home-if-you-see-a-problem systems out there in popular open source projects. Seems to me that there should be solid secure conventions to detect if error report data has been tampered with, or is bogus, and to prevent the same kinds of attacks regular systems suffer from. This is something worth spending some design time on, even if it isn’t part of the main product functionality.

Update: Suffered another crash, this time in the ATI driver as the system was doing nothing and changing focus from one window to another. Oddly enough, again, all the diagnostics say the system is fine — I’m going to do a very intensive sweep.

For the curious, the new directory was WERdb4a.dir00 with similar manifest, dump, and sysdata files. WER is the Windows Error Report, and the stuff after it appears to be hex glop. This time it is blaming the video driver, so I’ll be checking if there are any updates with both Dell and ATI.

FIX: Apple’s Security Update 2007-001 for AirPort breaks internet connectivity

After installing Apple’s Security Update 2007-001 for AirPort, the AirPort icon on my toolbar stopped working correctly. This is the workaround I’m using until that gets fixed.

Immediately after installing Apple’s Security Update 2007-001 for AirPort, I no longer had wireless connectivity to the internet. This is how I got around the problem.

Here’s how it’s supposed to work: You go to Apple / Software Updates…, it presents a Security Update, to which you select it to download and install. If it affects core pieces of the running operating system, then it may require a reboot. If that’s the case, then you are asked to authenticate the new module when it starts. For instance, a new AirPort driver asks you if you want to let it use your keychain (so you can connect to networks) – this extra line of defense would, for instance, let you know if some malicious program is trying to steal your passwords. Since it came from Apple via an update you explicitly requested, you authenticate, and all is good — everything is back to normal, and you’re more secured.

This didn’t happen when I installed the Apple Security Update 2007-001 for AirPort.

Immediately after the system reboot, I noticed that I wasn’t prompted for my password for the new replacement driver. This doesn’t always happen with minor changes, but you can almost always expect it with a security update.

Additionally, my AirPort icon in the tool bar was gray, suggesting that the AirPort power was off. So, I selected Turn Airport On, which normally starts scarfing the air for networks, joining my default one or letting me choose from a list. However, in this case, nothing happened.

I confirmed I wasn’t connected via the browser. And repeated attempts to turn on the network were futile.

At this point I opened the Network Diagnostics utility using QuickSilver.

If you don’t have that, you can go to your main disk, and go inside the System folder, then the Library folder, then the CoreServices folder, and click the Network Diagnostics application. Or, you can open a Terminal window and enter:

  $ open /System/Library/CoreServices/Network\ Diagnostics.app

Surprisingly, this told me my computer’s internet was working normally, and did I want to continue. I picked Yes. It then wanted to know which network port I wanted, I chose AirPort. My network appeared in the list, and I selected it and clicked Continue. It said I was now connected, and I hit Quit.

Sure enough, Apple / System Preferences / Network showed a green light next to my AirPort, and the text said I was now connected. A quick browser check to the internet confirmed that was, indeed, the case.

Meanwhile, the AirPort icon on the toolbar remains grayed out, convinced I’m not connected, and that there’s nothing that can be done about it.

Obviously the network card is working, as are the new security patches. It looks like something relatively minor got overlooked with the interface. But it’s nice to know there’s a workaround at the moment.

UPDATE 16-Feb-2007: I HAVE A FIX.
Grab a copy of OnyX, go to it’s Automation page, and fill out the form like this:

OnyX Automation Screen

Then press Execute, this will take a while and require a reboot at the end.

Next, grab a copy of AirPortExtremeUpdate2007001.dmg and re-install it, this will require a reboot as well. At this point your Wi-Fi AirPort problem should be fixed.

And while you’re at it, grab a copy of SecUpd2007-002Univ.dmg and install that too, then reboot.

I believe what’s going on, and this is pure speculation, is that there’s some kernel cache files that either prevent the 2007-001 update from being installed or simply override the changes is has. By using OnyX, it’s possible to clear out all the cruft that’s plaguing the operating system, allowing the patches to work as advertised.

And, once you do the above, be sure to go to Apple / Software Update… — if you weren’t getting any updates since installing 2007-001, you’ll notice things like Final Cut Pro, Java for Mac OS X 10.4 Release 5, and Daylight Savings Time Update.

As an aside, here’s a list of Apple Security Updates for OS X.

Restoring Normality to OS X – Right-Click, Expose, Sleep, and Passwords

My MacBook Pro wouldn’t sleep, draining my battery each night. It wouldn’t ask for a password after a screen saver. Here’s why, how I fixed it, and what caused it to happen in the first place.

Ok, let’s start off by stating out right this was my own darn fault…

I’m using a MacBook Pro (Intel) running OS X 10.4.8, and my personal habit is to charge the system way up to full, then use the battery until it’s virtually drained, and repeat. Somehow I’m hoping that this will get me longer battery life, but that’s another story.

OS X is really smart in that while you’re working it pops up a dialog box telling you that you’ve got ten minutes of battery life left, and that you should go get your adapter and plug in the laptop. It’s so smart, in fact, that if you do that, it will close the dialog without you even have to click. Very clever.

But Apple is also treats you with a little respect. If you dismiss the dialog box, it’s not going to remind you any further. You know about the condition of the battery, as you just acknowledged it. To perpetually remind you would not just be insulting, but get in the way of what you were doing. I can’t count the number of times I’ve acknowledged the state, finished an email leisurely, and then gotten my adapter. I like that. I like not being nagged.

With that kind of interface comes responsibility, and I neglected mine. I allowed myself to get distracted by other things and it took me a moment to realize what had happened when the screen went dark and wouldn’t come back with a flick of the touch pad. I had accidentally allowed my battery to completely drain.

Turns out you don’t want to do this. It’s not going to damage your computer, but at the same time it isn’t going to leave things in a very valid state.

First, let’s give some credit to Apple — the moments after I plugged in my power adapter, the disk whirled up, and within a few seconds my screen came back to life, I lost no data, and my internet connections were still functioning. In the laptop’s last dying breath, it had preserved its state to disk, recovering when it had power.

The immediate concern is a disk repair; although the file system is journaled and your data won’t get corrupted, if it was in the middle of doing something where it hadn’t gotten that data to disk yet, that data is lost. This can result in minor file system problems which are easily corrected by booting your original OS X install disc and using the Disk Utility (rather than the install program) to repair the volume structurally, and then repair permissions.

But things doesn’t necessarily stop there. It is possible that your system, because of lack of power, lose some important system settings. The best analogy I can make for PC users is when your CMOS battery dies and your system “forgets” all the settings for the time and drives. While this doesn’t happen on the MacBook Pro, the following things did happen — and here’s how I corrected them.

1. The “Place two fingers on trackpad and click button for secondary click” stopped functioning. Solving this was merely a matter of going to the Keyboard & Mouse preference screen and toggling it off and back on.

2. The function keys, F9 – F12, stopped invoking Expose. Solving this was merely a matter of going to the Dashboard & Expose preference screen and setting the keyboard shortcuts back, they became unassigned.

3. The laptop stopped going into sleep mode when I closed the lid; apparently the power management subsystem had gotten confused. If something like Firefox was running GMail, this was enough to keep the system running (even though the back light went out). I’d awake in the morning to find my battery drained, leading to more problems of this nature. The laptop’s “sleep” led wasn’t “breathing” and pulsating as it does when hibernating. The solution was to reset the power management: Shutdown, Remove Battery, Hold Power Button for 5 Seconds, Insert Battery, and Boot.

4. When the laptop was woken up or coming out of a screen saver, it was not prompting for a password, as I had configured it to do. The solution was to Reboot, Hold Down Option-Command-P-R (that’s four keys at once!), wait for the chime, and release all four keys letting it boot as normal, then, sign on and go to the Security preference screen and toggle “Require password to wake this computer from sleep or screen saver”

I’m happy to report, the Mac is back working perfectly.

Oh, and a tip for people who want to put their Mac to sleep real quick, even with the above problems you can do this, press Option-Command-Eject. You’ll have to close your lid and re-open it to wake.

Internet Explorer 7 — Zoom Bug

Internet Explorer version 7 has a nasty little problem selecting text when the page is zoomed. Try it yourself, then switch to Firefox.

Adding to the list of why IE7 is a nightmare, try this… I was using version 7.0.5730.11.

Bring up your favorite web page and double click a word on the page, not a link, but a word. It highlights that word, yes? Good. It should.

Note that one of the features that CSS is designed for is so that the user can override the appearance. Say for instance, I’m blind as a bat, and I would like the font larger so I can read the web page without strain.

Hold down the Control key and roll your mouse wheel. You can zoom-in and zoom-out. Again, very handy.

Now, double click a word on the page. Surprised?

That’s right the code that handles what you highlighted is misaligned with where the text is rendered. This means if you’ve zoomed in, as I did, in order to copy something, you can’t do so with any degree of precision.

Yet another annoyance from the people who want to take over your desktop.

XP Gripe: Deleting Files

I’m really getting to hate XP for trivial tasks, like deleting a file. Allow me to prove to you why XP fails in terms of usability.

There’s something that two software design experts, Steve Krug and Joel Spolsky, both agree upon in regard to usability: in order to be considered good, an interface should behave in a predictable manner that the user expects, and it should do so consistently.

Windows XP, by that definition, fails even at the simplest task. Allow me to prove my point.

I’m a keyboard user, and when I have a file in explorer selected, I delete it by pressing the Del key. This in turn pops open a dialog box asking me if I’m sure. I am, so I press Enter to accept the default OK, and the file gets moved into the trash bin. What could be simpler, especially since those two keys are near each other on my keyboard?

I’m also a power user. I often have numerous applications up, and when one is busy doing something, I switch focus to another while the one I just left continues to process in the background. At any given point in the day, I may be compiling in one window, copying server files from another, have spiders crawling website contents, have a BitTorrent pulling the latest Linux distro, email polling in the background, version control doing a checkout, all the while burning a DVD backup of our database. This is not unusual at all, but it does mean that my computer is busy, and that can induce a few millisecond lags here and there.

And there’s the problem. XP is temperamental.

As a power user, my muscle memory tells me that to delete a file I simply select it and rock my hand over Del and Enter in an instant, and there will be a quick flash, if I see any at all, where the dialog would have come up and gotten its answer, and gone away. For the majority of the time, this works.

However, if my XP system decides to be busy for a few milliseconds between the Del and Enter, which I have no way of knowing if it will or won’t, then this happens: The Del is seen, but not acted upon, Explorer gets control again, and this time it sees the Enter, which means “open this file.” At that point, the program starts running, which may not be a good thing if the objective was to delete it. Now I’ve got a rogue program starting up, and I want to shut it down quickly, only I can’t, because a new dialog box comes up and steals all control of the machine, telling me I can’t delete the program because it’s already running, and now I need to acknowledge that dialog box. Meanwhile, the evil program is in the background, taunting me, doing all the evil things it wants while I’m trying to navigate through this unexpected path.

In short, if I select a file and press Del Enter, sometimes it deletes my file, and sometimes it runs it.

Sure, I could slow down and wait between keystrokes, however this breaks my train of thought and slows me down to the speed of the computer.

And, yes, I could change the behavior of the recycle bin confirmation, but in some cases I want that prompting, otherwise I would have turned it off already.

In short, I shouldn’t have to reconfigure my environment and change my habits because the software is unpredictable.

New Dell with XP – 65 Updates Needed Out of the Box

After buying a new Dell Dimension 9600, it required a massive 65 Windows Updates before being patched enough to go onto the next step of removing trial ware, loading drivers, and updating obsolete software.

Just purchased a Dell Dimension 9200 for work with Windows XP Pro SP2 on it. No office, just plain vanilla.

Out of the box it required 62 Updates from Microsoft, 96.6MB download, estimated at 44 minutes using a fast ethernet connection.

Sixty two. On a brand new machine. And I haven’t even gotten to removing all the trial-ware cruft, installing drivers, or dealing with software updates.

After the reboot, I needed three more operating system updates, an additional 3.7MB and another reboot.

This doesn’t even count application patches that will be needed.

This movie is so true. I’m used to not having to do this.

As an amusement, I noticed Dell’s new ordering website would allow you to pay for them to remove the trial ware. Yes, you read that right – they’ll put it on for free, but you have to pay for them not to. Go try their site, it’s at the end of the PC design process.

Update: After installing applications, needed another 2 updates. IE 7 came along in the last set of updates. Oh, by the way, IE 7 blows up at least three times a day for us – it is not stable, IE 6 was much better.

Update 03-Nov-2006: For complicated reasons had to rebuild the Dell from scratch using the OEM disks. This time, 74 updates initially. (At lest Dell had done some.)

Walt’s Desktop: SYSINFO Like Detection

Walt gives Belarc Advices a thumbs up, as a sysinfo tool for his desktop of recommended software.

Back in the good old DOS days there were several software packages that would provide system information such as what hardware was in the machine, what drivers were running, what TSRs had crept into memory, and what applications you had. My all time favorite was SYSINFO, it was the magical hardware probing that I was after. I’d create a special boot disk and instantly be able to tell what was in a friend’s machine.

Problem is, as Windows got bigger and “better” that kind of direct hardware probing became forbidden by the operating system. I’ve been searching for its equal ever since for the Windows world.

Sure, there’s a handful of tools that come with Windows or Office, but all seem to be lacking, and nothing that just generates a single pretty report. systeminfo and msinfo just don’t cut it for me.

A friend turn me on to Belarc Advisor. This thing is amazing. It will do everything from tell me what kind of memory is in which slot on my motherboard to exposing the software keys to the software I have installed. It produces a sleek report viewable by any HTML browser, very nice.

Walt gives Belarc Advisor a thumbs up!

If you happen to know of any other favorites that do the same kind of thing, I’d love to hear from you.

Tired of Windows Bubbles in XP?

I hate the annoying pop up bubbles that say “click here to fix me.” Here’s how to get rid of them.

Tired of Windows bubbles that tell you that you have updates waiting, that tell you that your firewall may be wrong, or that your antivirus isn’t up to snuff? You are if you know what you’re doing, and you hate these little pop-ups that appear in the bottom right of your screen.

Here’s how to turn them off.

Start / Programs / Accessories / System Tools / Security Center — then select “Change the way Security Center alerts me” (it’s in the text on the left). Uncheck the boxes you don’t want, and click OK until the dialog boxes are gone.

Note, if you don’t find Security Center there, it sometimes appears under Start / Settings / Control Panel / Security Settings.