Dual booting causes clocks to go mental!


Although only half a year for a user such as myself.

As I’m happily dual-booting between Ubuntu and Windows at the moment, it becomes clear that in British Summer Time (BST), Windows and Linux disagree on how the computer clock should be interpreted.

What’s really a nuisance is that I keep staying up an hour later than I intended!

Basically, the problem boils down to how Windows and Unix-based systems interpret the computer’s internal clock. There’s more about this here, including some pros and cons of either system.

Windows takes the local computer clock time, and treats it as a ‘local’ time. That is, the clock matches the time that it should be in the region. Mac and Linux systems treat the computer’s clock as GMT, and then makes any adjustemnts inside the Operating System.

The bottom line is, unless you’re living in a GMT timezone – you’re going to get the time constantly changing as you switch between operting systems on the same computer.

The simplest way to get around this is to ask Windows to use UTC time instead of local time:

Copy and paste the following into a new file called time.reg

<code>Windows Registry Editor Version 5.00


Save the file, and double-click on it. Accept the various warnings that appear.

Once Windows has been rebooted, make sure that the clock is set to the correct time. The time should now settle down as you dual-boot between systems.

Now I’ll be able to go to bed at the right time!

Citrix ICA client reports “Proxy connection failed” when connecting

I had some trouble getting the ICA client to connect to a site in Ubuntu today. Actually, it’s been for a few days. I’m not entirely sure if I’ve used Ubuntu for Citrix stuff.

Anyway, whenever clicking on a connection on the Citrix web interface, the webica application would fail with this error: “Proxy connection failed: Internal error during proxy evaluation”

As I don’t use a proxy, this was a little odd.

After searching on the Citrix forums, I found this nugget which resolves the issue:

  • Open up the terminal window
  • cd
  • mkdir .netscape
  • cd .netscape
  • gedit preferences.js
  • In the editor, type:
    user_pref("network.proxy.http_port", 80);
    user_pref("network.proxy.type", 0);
  • Save the file

Now, when you click on the Citrix icon, you should connect with no issue.

If you do happen to use a proxy server, change network.proxy.type to 1, and enter the relevant proxy details in the other lines.

Get Network Manager to stop asking you for the keyring password with pam_keyring

As I’m using network manager to control wireless access on my laptop and a desktop computer in my home, I’ve decided that the keyring manager is a nuisance.

I couldn’t bear for it to constantly ask for a password every time that I needed to log on to a wireless network to retrieve the stored password. This is further compounded by the inevitable question: “Why do I have to enter my password again?”

Over at the Ubuntu forums the same question has been asked. Thankfully, there is a resolve that will also be included in the Feisty release.

The easiest way for Ubuntu user is to download the .deb package of pam_keyring and install on your system.

Once installed, so the following:

  • Open a terminal window
  • Type cd /etc/pam.d
  • Type sudo gedit gdm
  • In the editor, and the following:
    ## Added so that NetworkManager doesn't keep asking for Keyring password.
    ## relies on having same password to keyring as login password.
    auth optional pam_keyring.so try_first_pass
    session optional pam_keyring.so

Save the file, and then try it out.

The catch is that the keyring manager must match your login password. If you have a different password set already, then the only way to make pam_keyring work is to delete your existing keyring and restart:
killall gnome-keyring-daemon
rm ~/.gnome2/keyrings/*

or alternatively change your login password to match your keyring.

Once you have entered the network key of the wireless LAN, you should find that passwords and automatically stored and retrieved.

And this works for any other Gnome applications that use the keyring too.

Recovering a faulty hard disk drive in Linux – PT1

Today, I’ve been working on a server that doesn’t want to mount one of the partitions that has been formatted with reiserfs.

Using the fsck command doesn’t work because there are bad blocks on the drive, resulting in fsck vehemently refusing to cooperate.:

Cannot read the block (41713664): (Input/output error).

To get fsck to play with such a faulty device, you need to build a list of badblocks first, so that fsck can deal with them. If the disk is REALLY bad, then this will do no good at all – just dd_rescue that bad boy!

It’s never bad to backup before doing something like this anyway, so if you can – use dd_rescue to clone onto another disk. The likelihood is that you don’t have another disk and that’s why you’re reading this. If so, read on.

First of all, we need to be able to tell fsck which blocks on the disk are bad. To compile a list of badblocks, you’ll need to use the badblocks tool:

badblocks /dev/hda1 >>badblocks.txt

Obviously, change hda1 for the partition that is causing you trouble.

You may also need to specify a block size for the partition. The default is 4096, which is the standard size of reiserfs, but to be doubly sure, you can run the debugreiserfs command, and the output will show you the blocksize:

Blocksize: 4096

If the blocksize differs, run
badblocks -b 4096 /dev/hda1 >>badblocks.txt
replacing 4096 with your block size.

This may take some time. Grab a book, make a drink, have a snack.

Once the blocks have been read, enter less badblocks.txt to make sure that there is something in the file. You should see a series of numbers output to the screen. If that’s good, press ‘q’ to return to the shell.

Now to run fsck. We will need to account for the bad blocks, so you will need to include that badblocks file that you have just created:

fsck.reiserfs –fix-fixable -B badblocks.txt /dev/hda1. Once again, change the device from hda1 to what you are trying to recover. As long as the driver isn’t completely nerfed, the you might be able to run through the commands and recover the drive table.

If not, then I’ll have another article very soon.

Beryl Cube doesn’t work with the Workspace Switcher

Sometimes I get a little carried away with messing around with the settings in Beryl. I think that through various upgrading to 0.2, downgrading and then upgrading through the SVC repository and playing with options, I’ve probably wasted 5-6 hours of my life.

Anyway, one thing I have noticed is that the desktop switcher sometimes doesn’t rotate the cube, but instead opens a new workspace with a different cube. Not really much use, but I think I’ve found something that resolves this:

  • Open up Beryl Settings Manager, and click Desktop
  • Make sure that you have Desktop Cube and Rotate Cube selected
  • Click on General Options, and then General Options (on the left)
  • Scroll down to the option Horizontal Virtual Size. Make sure it is set to 4 (you can change this after the cube rotate is working again).
  • Set the Vertical Virtual Size to 1
  • Set the Number of Desktops to 1

Now click quit, and try the virtual desktop switcher. If all has gone to plan, then it will work, and you’ll be in a switching dream.

If it doesn’t still work, don’t worry:

  • Reopen Beryl Settings Manager
  • Under General Options, scroll down to Vertical Virtual Size, and change the value to 2. You should see the active windows change size in the workplace switcher.
  • Change the value back to 1, and try to switch the desktop again

If all has gone to plan, you can now use the workplace switcher to rotate the cube again.

For those concerned, I am running Ubuntu Edgy with Beryl 0.2 – your mileage may vary.

Getting Mousey with the Logitech MX5000, MX1000 mouse, Ubuntu, Evdev and some Extra Mouse Buttons

As I get more and more stuck into getting Ubuntu to work nicely for me – I find myself more and more determined to resolve the little issues that nag me.

Today, I decided to finally get the extended mouse support for my Logitech MX5000 desktop working, and thankfully the process wasn’t too fraught with Bad Stuff Happening(TM).

So, after a quick google, I found that Mat Van Stone has very recently tried the same thing, which has made my life a great deal easier. Also a post from the Ubuntu forum assists in the expanding of the functionality.

I haven’t got into Section 2 of the guide yet, but I’ll be trying that out soon. In the meantime, I have used Beryl Settings Manager to configure the task switch button to run the Scale function, which is how I used it in Windows XP with TopDesk (the Expose for Windows prog).

What’s nice is I use ALT+the task switch button to Scale windows on all desktops, and the button alone for the current desktop.

It’s reasons like this I’m liking using Linux more and more.