Posts Tagged Fix

Windows shutdown mindnumbingly slow

It seemed that shutdown in WindowsXP was taking excessively long, with it taking several minutes at the “Saving Your Settings” screen.

Surprisingly(?) I found a tool at Microsoft that provides a solution to get shutdown times back to only a few seconds:
User Profile Hive Cleanup Service

The User Profile Hive Cleanup service helps to ensure user sessions are completely terminated when a user logs off. System processes and applications occasionally maintain connections to registry keys in the user profile after a user logs off. In those cases the user session is prevented from completely ending. This can result in problems when using Roaming User Profiles in a server environment or when using locked profiles as implemented through the Shared Computer Toolkit for Windows XP.

Tags: ,

Firefox’s XML Slowdown

For many months a buglet had been niggling at me. Anytime I opened an XML document in Firefox the entire browser would freeze for several seconds. If I was trying to debug a RSS feed or an XML settings file this would quickly become extremely annoying.

Today I fixed it.

First I tried a few of the obvious things. I already knew that this was not a core Firefox bug because this did not happen on any other PCs – it had to be something related to my PC. I checked the default profile with all addons disabled – still froze. I tried using a profile in another user’s account – still froze.

Then I had an idea how to find the culprit: I fired up regmon. After a few tests I quickly narrowed it that the freeze was happening right after loading the key HKCR\feed\shell\open\command\(Default)

I checked the contents of that key and I saw immediately what the problem was. The key was pointing to a program on a shared folder – so every time Firefox loaded XML it would attempt to mount this shared folder and this was the cause of the freeze.

After deleting the registry key my Firefox is back to being speedier than ever!

Tags: , ,

Default Interface for Multicast on Windows (IPTV)

Third time lucky, as the saying goes.

Having given up trying to get IPTV to work twice before I didn’t hold much hope for a third and final attempt. Again I had no luck on my desktop PC, however I fired up a browser on a different PC and to my surprise it worked immediately.

This confirmed that it was not a problem with my router or the ISP. I quickly realised it could be a problem with the routing of multicast packets (required for IPTV, but rarely used otherwise) and as my main PC had dual NICs there could be a configuration issue.

For IPTV to work the default multicast interface must be the same interface that routes to the internet. For some unknown reason WindowsXP had decided to set the default multicast route to the private LAN, despite the fact that the default route for all other packets was the router.

The quick fix is to update the metrics (priorities) for the multicast routes. Do a route print to see the current table, then update each multicast route such that the Internet gateway IP has the lowest metric:

route add 224.0.0.0 MASK 240.0.0.0 <gateway IP> METRIC 10 -p

This will update the metric to “10″ for the given gateway IP, -p means persistent, so it should remain the same after a reboot.

References

Default Interface for Multicast on Windows
How to change the binding order of network adapters in Windows XP and in Windows 2000

Tags: , ,

Linux open file limit

I discovered some error logs that indicated I was hitting the limit for concurrent open files. Increasing the limit is actually very easy.

Check the current system-wide limit:

$ cat /proc/sys/fs/file-max

To increase this to 65535 we would do (as root):

$ echo "65535" > /proc/sys/fs/file-max

If you want this new value to survive across reboots you can add it to /etc/sysctl.conf:

# Maximum number of open files permited
fs.file-max = 65535

That’s it for system limits, however you should also check user limits:

$ ulimit -n
1024

(use ulimit -a to see all user limits)

To increase this to 65535 for all users (as root), edit /etc/security/limits.conf, and modify or add “nofile” (number of file) entries – note that a userid can be used in place of an asterisk (*)

*                soft    nofile          65535
*                hard    nofile          65535

References

Fix ‘Too many open files’ error on Linux by increasing filehandles
Linux: Increasing the number of open file descriptors
Maximum Number of open files and file descriptors in Linux

Tags: ,

My Documents opens at startup

This was becoming a nuisance, explorer would open a new window every time I logged in (and if I didn’t close them they would continue to compound after each reboot).

A support article suggests a minuscule change in the registry is the cause:

Navigate the Registry to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Win­dows NT\CurrentVersion\Winlogon

Find the value Userinit. This value should read: C:\WINDOWS\system32\userinit.e­xe, including the comma.

Why was the comma missing? Who knows, but at least Windows is somewhat under control now.

Tags: ,

Windows Updates Hate

After “updating” to IE7, shared drives are treated as internet zone – prompting you to confirm every single time you try to copy a file.

This knowledge-base article describes the problem, however the “fix” does not work.

This registry hack appeared to work:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\YOUR_SERVER]
"file"=dword:00000001

Then obviously reboot after update the registry, because Winblows can’t seem to get anything done without a reboot.

Tags: , , ,

Fixing VirtualBox

I have been testing VirtualBox OSE in Ubuntu, but found that every time a kernel upgrade comes out the VirtualBox kernel drivers are left out of the upgrade.

The solution is quite simply to add the “ose-source” modules for VirtualBox:

sudo apt-get install virtualbox-ose-source
sudo module-assistant auto-install virtualbox-ose-source
sudo /etc/init.d/vboxdrv start

Now every subsequent upgrade the “ose-source” will be included and the kernal drivers should be built automatically.

Tags: , ,

Bittorrent can’t load fastresume data

Testing the Bittorrent CLI client I noticed an error “can’t load fastresume data”. This was forcing it to rescan the entire data before resuming the torrent – even if nothing had changed since the previous run.

A bit of searching found this solution:

change file /usr/lib/python2.5/site-packages/BitTorrent/Storage.py
modify line 216

str(os.path.getmtime(filename)) + '\n')

to

str(int(os.path.getmtime(filename))) + '\n')

remove the binaries

rm /usr/lib/python2.5/site-packages/BitTorrent/Storage.pyo
rm /usr/lib/python2.5/site-packages/BitTorrent/Storage.pyc

Tags: , , ,

Problems adding SP3 to WindowsXP

I was unable to upgrade WindowsXP to SP3, given an access denied error. It was not hard to find a relevant kb article from Microsoft:
kb949377
: When you try to install Windows XP Service Pack, you receive the error message “Access is denied” or “Service Pack installation did not complete”

The only given solution that worked was to reset the registry and the file permissions (as given in the kb article):

cd /d "%ProgramFiles%\Windows Resource Kits\Tools"
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f
subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f
secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose

Tags: , ,

Firefox save-as for unknown mime-type

If Firefox 2.0 does not recognise a mime-type it forces you to jump through hoops every time you wish to save a file of that type – never giving you the option to make a default action (eg. save-as) for the type.

Getting tired of this I eventually did some research to find a solution, case in point is the RAR file type (application/x-rar; application/x-rar-compressed).

Option 1: An Addon

Add the Mime-Edit extension that allows you edit any mime-type’s properties and actions, even those not recognised by Firefox.

Option 2: Hack

If you are confident in XML manually edit mimeTypes.rdf in your profile folder:

<RDF:Description RDF:about="urn:mimetype:application/x-rar-compressed"
NC:fileExtensions="rar"
NC:description=""
NC:value="application/x-rar-compressed"
NC:editable="true">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-rar-compressed"/>
</RDF:Description>

<RDF:Description RDF:about="urn:mimetype:handler:application/x-rar-compressed"
NC:alwaysAsk="false"
NC:useSystemDefault="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-rar-compressed"/>
</RDF:Description>

And in the section <RDF:Seq RDF:about=”urn:mimetypes:root”> add in this new row:

<RDF:li RDF:resource="urn:mimetype:application/x-rar-compressed"/>

Tags: , ,