2008-12-29

Setting the default profile in Firefox and Thundebird

Firefox and Thunderbird (fine browser and email client products from Mozilla) allow you to have different profiles, such that Firefox or Thunderbird may be started up with different settings, different email account settings, different bookmarks, etc...

You'll normally have one profile only, and unless you renamed it, it is called "default".
In order to create additional profiles, run the software from the command line:

firefox.exe -P
or
thunderbird.exe -P
A window pops up to create new profiles, or you can choose which profile to start the application with:
Once several profiles exist, simply running "firefox.exe" or "thunderbird.exe" will make use of the default profile (whichever that is; this is the problem). It is possible to start with a specific profile, by running one of the following:
firefox.exe -P "UserA"
firefox.exe -P "UserB"
where UserA and UserB are the names of your profiles in Firefox (it's the same for Thunderbird).

I ran into a problem which I did not find documentation for, and this is why I write this. Which of those is the default profile? The profile selection dialog window shown above does not make it possible to set the default profile among the list of available ones.

While it is possible to use the profile selection window to choose a profile every time you run Firefox/Thunderbird, there are some problems if the default profile is not the one you expect. For example, in Windows XP/Vista, a context menu item named "Sent to mail recipient" will open a Thunderbird window to write an e-mail, but it will use the default Thunderbird profile. Clicking on "mailto:" links on webpages will also prompt Windows Vista/XP to execute Thunderbird, using its default profile. For these reasons, you may want to choose which is your default Thunderbird profile.

Setting the default profile
It turns out it is very easy:
  1. Make sure all Thunderbird windows are closed
  2. Locate the profiles.ini file for your user (in Vista this is normally "C:\Users\UserName\AppData\Roaming\Thunderbird", and in XP "C:\Documents and Settings\UserName\Application Data\Thunderbird", or similar. More info on this: http://kb.mozillazine.org/Profile_folder_-_Thunderbird
  3. Edit the file profiles.ini, and add the line "Default=1" only to the profile you want to make your default.
Here's an example profiles.ini file indicating the default profile:
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=Profiles/6y2nagku.default

[Profile1]
Name=John
IsRelative=1
Path=Profiles/8dje3h37.John
Default=1

References:
http://kb.mozillazine.org/Profile_folder_-_Thunderbird
https://developer.mozilla.org/En/Command_Line_Options

2008-12-27

Move the "Users" folder (user profiles) to a different location in Vista

In Windows Vista you've got the possibility to specify, right from the Vista interface, the location of each folder in a user profile. For example, it's easy to indicate that you want to have "Downloads" in a different drive (for detailed instructions on how to do this you can follow the official MS advice).

However, if what you want to do is move the entire C:\Users folder structure and have the OS recognize that change without going nuts, there's an elegant solution that we found after googling for a while. While you can read about it in the original articles (here and here), it all boils down to this (but please, do have a look at the original articles since the explanations of what is going on are really helpful) (and please, please, please: if you want to be sure that you don't loose anything... backup first!):

  1. Create the new "Users" folder wherever you want it to be (e.g., E:\Users)
  2. Boot off the Vista install DVD and choose to Repair from the introductory window. Choose the target Vista installation and then bring up a command prompt (note: in some computers you don't need the Vista DVD, there's an option to boot the computer into some System Recovery options and from there you have access to a console).
  3. Once you are in a command prompt, copy all the data from your original C:\Users to the target E:\Users. To do this, you must use a command that copies all the data, links, folders, etc. I have used Robocopy and it works very well. The command that I used is:
    robocopy C:\Users E:\Users /E /COPYALL /XJ
  4. Now that you have all your data copied... delete the original C:\Users folder! Yes! Have no fear! But please, make sure first that your data is now safely copied in E:\Users. Please note that after deleting C:\Users you can still go back by copying the data to C:\Users from E:\Users... but that's not what you want to do, is it? In any case, use the following command to delete C:\Users:
    rmdir /S /Q C:\Users

  5. After deleting C:\Users, delete also C:\Documents and Settings (it's just a link to C:\Users):
    rmdir "C:\Documents and Settings"
  6. Now we have to create the link that will tell Vista that when it looks for C:\Users, it has to go to E:\Users. Use this command:
    mklink /J C:\Users E:\Users
  7. We recreate as well the link from Documents and Settings:
    mklink /J "C:\Documents and Settings" E:\Users
  8. Restart! Everything should be in place, we should be able to log on with our user accounts, etc.
I have followed this procedure already twice and have had no problems at all. Everything's working fine, Vista puts all the data in E:\Users and all is well. Note that if you go in Windows Explorer to C:\Users, you will see it there, and you can navigate its contents, but remember that the data is physically stored in the E:\ partition, not in C:\Users.

I recommend you reading the articles that I found originally, since there is some discussion in them that might be helpful to you.

You can use this same procedure to modify the location of C:\Program Files, for example. I have not tried to do this, but I guess it should be problem-free. Still, as with changing the Users folder, proceed at your own risk!

Have a nice day!
Marcelo

2008-09-07

Default tcsh behaviour in XUbuntu

I'm a newcomer to Ubuntu (Xubuntu, really). For the past few years my Linux distro of choice was Redhat and then Fedora. I became used to how things work on Fedora, like the behaviour or my favourite shell, tcsh.

The default filename completion behaviour of tcsh in Fedora (and in Ultrix and Digital Unix, as far as I can remember from my university days) is the following: the first press of [TAB] completes the filename up to the last common character in a set of files. The second press of [TAB] provides a list of possible choices, and reprints the command line to continue typing.

In Xubuntu, however, the default tcsh behaviour is that the first press of [TAB] provides already the list of possible choices. I wanted to change this, and I found the solution in the tcsh man page. At the tcsh prompt, type the following:

  • "unset autolist" to do without listing of filenames
  • "set autolist = ambiguous" to use the first [TAB] to complete filenames up to the common set of characters, and a second press of [TAB] to obtain a list of suggestions
  • "set autolist" to get the default behaviour in Xubuntu: The first [TAB] gives you the list of suggestions.

2008-08-17

Nice non-antialiased fonts in Linux

Ever since Linux distributions decided to go with antialiased fonts in qt and gtk based applications, I have been looking for a way to go back to the way it used to be (I am talking 1998...). Merely disabling the "antialiased" setting on moden distros produced ugly fonts, unlike the simple, nice Helvetica fonts that 1998-era Linux systems used to have.

However, today I found a site that offers exactly what I wanted: http://www.sharpfonts.com
It describes very easily how to use non-antialiased truetype fonts on a modern Linux distributions.

I ran the described process on a Xubuntu 8.04.1 system. After going through the process described in that site, simply select the Tahoma 8 font with "slight" hinting (for instance) for the desktop font. Works perfectly.

2008-08-02

Nokia 5310 and Linux

In trying to connect a Nokia 5310 to my Linux system (Fedora 9), I encountered some problems which turned out to be non-issues after all. Here's a short report in case it helps anyone:

I don't know if things simply work right "out of the box" when you use Gnome or KDE. I don't use those desktop environments. I work with IceWM for a simple windowing interface, and I like to work from the command line. The following instructions detail what I had to do to access the phone's memory card from the Linux command line.

When I plugged in the Nokia 5310 through its USB port to the computer, the Linux kernel reported the following messages in /var/log/messsages:

kernel: usb 4-2: new full speed USB device using uhci_hcd and address 17
kernel: usb 4-2: configuration #1 chosen from 1 choice
kernel: drivers/usb/class/cdc-acm.c: Ignoring extra header, type -3, length 4
kernel: cdc_acm 4-2:1.1: ttyACM0: USB ACM device
kernel: usb 4-2: bad CDC descriptors
kernel: usb 4-2: bad CDC descriptors
kernel: usb 4-2: New USB device found, idVendor=0421, idProduct=006b
kernel: usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
kernel: usb 4-2: Product: Nokia 5310 XpressMusic
kernel: usb 4-2: Manufacturer: Nokia
kernel: usb 4-2: USB disconnect, address 17
kernel: hub 1-0:1.0: unable to enumerate USB device on port 6
kernel: usb 4-2: new full speed USB device using uhci_hcd and address 18
kernel: usb 4-2: configuration #1 chosen from 1 choice
kernel: scsi8 : SCSI emulation for USB Mass Storage devices
kernel: usb 4-2: New USB device found, idVendor=0421, idProduct=006a
kernel: usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: usb 4-2: Product: Nokia 5310 XpressMusic
kernel: usb 4-2: Manufacturer: Nokia
kernel: usb 4-2: SerialNumber: xxxxxxxxxxxxxxx
kernel: scsi 8:0:0:0: Direct-Access Nokia Nokia 5310 Xpres 0000 PQ: 0 ANSI: 4
kernel: sd 8:0:0:0: [sdc] 3932161 512-byte hardware sectors (2013 MB)
kernel: sd 8:0:0:0: [sdc] Write Protect is off
kernel: sd 8:0:0:0: [sdc] Assuming drive cache: write through
kernel: sd 8:0:0:0: [sdc] 3932161 512-byte hardware sectors (2013 MB)
kernel: sd 8:0:0:0: [sdc] Write Protect is off
kernel: sd 8:0:0:0: [sdc] Assuming drive cache: write through
kernel: sdc:
kernel: sd 8:0:0:0: [sdc] Attached SCSI removable disk
kernel: sd 8:0:0:0: Attached scsi generic sg3 type 0
kernel: sd 8:0:0:0: [sdc] Sense Key : No Sense [current]
kernel: sd 8:0:0:0: [sdc] Add. Sense: No additional sense information
kernel: sd 8:0:0:0: [sdc] Sense Key : No Sense [current]
kernel: sd 8:0:0:0: [sdc] Add. Sense: No additional sense information
kernel: sd 8:0:0:0: [sdc] Sense Key : No Sense [current]
kernel: sd 8:0:0:0: [sdc] Add. Sense: No additional sense information
kernel: sd 8:0:0:0: [sdc] Sense Key : No Sense [current]
kernel: sd 8:0:0:0: [sdc] Add. Sense: No additional sense information

I was expecting to see an "sdc1" partition, but no partitions were reported either with "fdisk -l /dev/sdc". I thought there was a problem with my set-up, but there isn't any.
It turns out that the /dev/sdc itself contains the filesystem on the Nokia 5310 internal SD flash card.

Therefore, a simple "mount -t vfat /dev/sdc /mnt/disk" will make the Nokia 5310's memory card contents available on /mnt/disk.

To make things easier, I created an entry in autofs' auto.misc config file. My /etc/auto.master file relates the directory /misc with the /etc/auto.misc file. This is the content of my /etc/auto.misc file:

# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
dvd -fstype=iso9660,ro,nosuid,nodev :/dev/dvd
pen -fstype=vfat,rw,user,umask=000 :/dev/sdc1
nokia -fstype=vfat,rw,user,umask=000 :/dev/sdc

Now all I need to do is plug the Nokia into the USB port, and then, from the command line and as a regular user (not root), you can simply:

1) cd /misc
2) cd nokia
3) ls -la

...and you get a list of the files and folders in the phone's memory card.

After copying files from the phone to the PC and viceversa, remember to issue the command "umount /misc/nokia" to make sure all files get actually transferred before you unplug the USB cable.

2008-06-05

Meaningful name for network printers in Windows XP

Corporate environments often name network printers with labels that don't help much to identify the printer's location (names like IMPLOC134). Its properties may indicate the location, but this may involve looking through more submenus.

When Windows XP connects to such printers, the local name of the printer stays as IMPLOC134, and cannot be renamed. This can be a problem if your machine is configured with more than one printer, and you'd like to choose a printer from the list by simply looking at its name.

There's a workaround for installing the printer with a personalized name. When adding a printer, don't connect to a network printer. Instead, create a local one:

  1. Add printer
  2. Type "Local"
  3. Create new port, type "Local Port"
  4. The port name must be "\\printservloc\IMPLOC134" which is the network address of that printer
  5. Then select the driver for the printer (most likely you can find it on the manufacturer's website)
  6. Then assign a meaningful name for the printer, like "3rdFloorPrinter"



This will create a local printer that in reality connects to the network printer, but the local name will have a personalized label recognizable just by looking at the list of printers, without the need to look at the properties and details of the printer.

2008-06-03

DRIVER_IRQL_NOT_LESS_OR_EQUAL blue screen of death...

Over the past few weeks, my windows machine gave me this blue surprise four or five times:


STOP: 0x000000D1 (DRIVER_IRQL_NOT_LESS_OR_EQUAL) is the error that greeted me, in relation to tcpip.sys, and it happened apparently randomly (I could not assign blame on particular actions or events)

It’s strange that this would happen alter two years using the machine without any such problems. After some research on the net, I found that some people relate this problem to network card drivers, others blame a bad memory chip, while others point to newly installed buggy software.

This is a 2.5 year old Dell Latitude D410, and while hardware failures are always a possibility, I think this machine is not that old to start showing hardware problems.

I upgraded the network drivers and removed some new software I had installed, but the blue screen of death came up again twice after that.

So then I searched a little further and found a Microsoft fix for the problem. They claim in their KB article 906882 that this problem is related to a program tries to connect to a loopback adaptor other than 127.0.0.1. I don’t know if this was the source of the problem in my machine, since I cannot think why would my machine be attempting connections on 127.0.0.2 or other loopback addresses (I guess it could be a virus… but I am fairly certain to have a virus-free system).

Despite this, I went ahead and installed hotfix http://support.microsoft.com/kb/906882. It’s been some 7 days already since then, and the BSOD has not appeared again. It seems this hotfix worked. If the problem comes back, I will report it here.

2008-06-01

wqy font problem on Fedora 9 and Nvidia card

Today I upgraded my system from Fedora 8 to the new Fedora 9. The process went fine... but I ran into a small problem with the bitmap font I use in Gnome.

One of the things I dislike about current Linux desktops (in comparison to 1998-2001 linux) is the use of anti-aliased fonts. If you try to disable antialiasing, fonts look dead ugly. Long lost are the simple looking helvetica or arial fonts on Linux. (if anyone knows how to get them back, please do let me know).

The only bitmap font I've found on Fedora distributions is "wqy-bitmap-fonts", which is actually a Chinese font, but which works fine for latin characterset as well.

However, after upgrading to Fedora 9, this font began to display funny (artifacts showing on top of the text, making it unreadable). I thought it to be a problem with Fedora 9... but after posting the issue on redhat's bugzilla, I found out it is an issue with the video driver I am using.

My system has a nVidia Corporation NV44A [GeForce 6200] rev a1. On Fedora 9 I installed driver version NVIDIA-Linux-x86-173.14.05, and this causes a problem. If I use the "nv" driver that comes with Fedora, the problem goes away.

Here's a picture showing the font problem I had:



So one solution is to use the "nv" driver instead of the "nvidia" one on X11.
In the mean time I will continue to use "nvidia", however... and then I will try new nVidia drivers when they come out.

Here's the bugzilla page covering this issue.

So this concludes the first post of this blog... (I hope it helps others who run into the same problem).