Fixing Windows Update errors

The ultimate .bat-file for completely resetting and fixing all sorts of stupid Windows Update errors.

Stuff the following into a .bat-file and run it

regsvr32 /u softpub.dll /s
regsvr32 /u wintrust.dll /s
regsvr32 /u initpki.dll /s
regsvr32 /u dssenh.dll /s
regsvr32 /u rsaenh.dll /s
regsvr32 /u gpkcsp.dll /s
regsvr32 /u sccbase.dll /s
regsvr32 /u slbcsp.dll /s
regsvr32 /u mssip32.dll /s
regsvr32 /u cryptdlg.dll /s
regsvr32 SOFTPUB.DLL /s
regsvr32 INITPKI.DLL /s
regsvr32 MSSIP32.DLL /s
regsvr32 wintrust.dll /s
regsvr32 regwizc.dll /s
regsvr32 licdll.dll /s

net stop cryptsvc 
cd %systemroot%\system32 
ren catroot2 catroot2old 
net start cryptsvc

net stop wuauserv 
cd %systemroot% 
ren SoftwareDistribution SoftwareDistributionOld
net start wuauserv

Reboot and retry the updates. If everything works, go into C:\Windows and delete SoftwareDistributionOld, then go into system32 and delete catroot2old. Otherwise, rename them back to their original names. No harm done.

VMware Server and Windows Firewall

VMware server uses port 902/TCP for remote connections. It is easy enough to allow outside connections to this port through the Windows Firewall interface in the Control Panel.

However, if you want to do it the “Windows Way (TM)” the trick is to add “vmware-authd.exe“, found in the VMware Server folder in your installation directory, to the list of allowed programs. Then, even if you change which port number VMware should use, the Windows Firewall will allow it.

How to kill a process that uses too much CPU

Cleaning up my ‘dump’ directory, I found this aging script I got from somewhere, which will check the current CPU usage of a program and kill it if it uses too much. This is useful if you are for some reason forced to run buggy, closed source software which get stuck in endless loops when things go wrong. I’ve been there, it wasn’t fun, but this thing solved it. Thank you, french christmas…

 (more…)

Fun with “beep”

At the end of my huge list of stuff I always install on a Debian box, I put a “beep” to let me know when it’s done, because I will no doubt be doing something else, most likely on a different screen, when it’s done.

Now, suppose you run a lot of processes you want to know when are done, it’s nice to have separate, easily distinguishable sounds for each event. Of course you could do this by playing a short mp3 or something with mpg321 or mplayer if you have a sound card set up on that particular box, but even if you do, playing short tunes on the PC speaker is so much more geeky, and thus cool, since you’ve already proven yourself to be a geek by working on the linux box in the first place.

Beep has the ability to play a sound at any frequency your PC speaker can do, and with configurable length… do I hear music? (more…)

Disable .bash_history logging in bash, Debian

I hate the .bash_history file. It never contains what I want, screws up when using multiple sessions and generally contains junk. I like to disable the .bash_history file, while still keeping the ability to push the “up”-key to scroll through earlier commands in the same session.

The way to do this is to set $HISTFILE to /dev/null. Bash will now log all its history to a nice, black hole.

This can be done at the beginning of ~/.bashrc

...
HISTFILE=/dev/null
...

There. Now I wont forget.

Encrypted swap in Debian

So, you got your home directory encrypted, but you’re not sure what sensitive material could end up in swap? After a long day of running a whole lot of applications and processes, many interesting things could potentially wind up there. So here’s how to make sure that data is completely garbled after a reboot. (more…)

Vista file transfer estimates: WTF?

In Windows XP, it seemed like the estimated transfer time of files in a folder, when copying that folder from one place to another, was estimated purely based on the sum of the file sizes and the current transfer speed. It also seemed to have a preference for transferring the larger files first. (more…)