Main

Miscellaneous

CentOS 4.2/4.3/4.4 on ThinkPad T43

After everything I've gone through with the "breeding-edge" Fedora on my old ThinkPad T40 (read here and here), I decided to go with something a little more "stable" for a new laptp, ThinkPad T43. (No offense to Fedora - I still love it in many ways.)
What I chose was CentOS. CentOS 4, one of the popular "Red Hat clone" distributions, is basically a free recompilation of Red Hat Enterprise Linux (RHEL) 4. The structure of the distribution is more or less similar to Fedora Core 3, as RHEL 4 was being developed in parallel with FC3. (Therefore, there is a good chance that an RPM package for FC3 is compatible with CentOS, which comes handy.)

Below is my setup memo. I hope this to be useful for others, but I make no guarantee of any kind whatsoever. Please do everything at your own risk.

Unlike the previous models of ThinkPad in the past few years, T43's partition for the system recovery doesn't seem to be "hidden". I have no idea what happened, but apparently they (I mean, IBM or Levono) went back to the method they were originally using in older machines; the system recovery partition appears to be a FAT partition at the end of the disk. If you want to do dual-boot, I recommend to be careful not to delete it until you first make a backup to DVD or CD media.

TODO list

  • Suspend/Hibernation
  • On-screen display
  • Modem
  • Bluetooth
  • Fingerprint detection

Work done

BIOS

I did nothing special in the BIOS setting specifically for Linux, except I disabled screen expansion in an attempt to use an external display for doing a presentation, but it didn't seem to mean much anyway (see here.)

Installation

Instal disk image for CentOS 4.2 consists of four CDs or one DVD. I ended up burning three CDs, as I didn't need to install anything in the fourth CD initially. You need a BitTorrent client to download a DVD image.

Installation was very easy. I did custom installation with graphical mode, manually created partitions, and selected packages to install. I chose to disable SELinux. I chose "general LCD 1400x1050." After reboot, I successfully got a graphical login screen. Most devices (including trackpoint/UltraNav, USB, ethernet, audio, and volume buttons) worked out of the box. The only mystery was that my IDE disk (Toshiba MK1032GA) was recognized as a scsi drive (/dev/sda).

The first thing I did after installation was to run "yum update" as root to install the update modules. You could also use 'up2date' or 'apt-get' for this purpose. It is also easy to add third-party repositories so that you can install the packages not included in the official CentOS repository through these tools. For example, you can add a file named /etc/yum.repos.d/*.repo to make yum access a third-party repository. (You may also have to do 'rpm --import' to import a GPG key.)

KDE

The default desktop environment of CentOS 4.2 is GNOME. I changed it to KDE by rewriting /etc/sysconfig/desktop to DESKTOP="KDE". This is just a matter of preference.

Wireless LAN

My T43 comes with the Intel PRO/Wireless 2200BG adapter. Although the CentOS kernel is built with ipw2200 and ieee80211 driver modules, wireless doesn't work after initial installation. You need to install the "firmware" provided by Intel. The easiest way is to download and install the firmware RPM available here (choose the latest package for Red Hat Enterprise Linux 4 i386). Alternatively, you can download the files from the SourceForge site and put them in /lib/firmware (The syslog in /var/log/messages indicates that CentOS 4 kernel needs ipw-2.2-boot.fw ipw-2.4-boot.fw. Newer kernels seem to need the version 2.4 of the firmware). After that, either reboot or run the following commands.
# /sbin/rmmod ipw2200
# /sbin/modprobe ipw2200

Note: kernel-2.6.9-42.0.2.EL had a problem with ipw2200 driver. I'm forced to stay with kernel-2.6.9-34.0.2.EL until this is resolved. It also prevents me from upgrading to CentOS 4.4:( If you're interested in this problem, you might want to watch this bug in the Red Hat Bugzilla.) 10/08/06: The issue has been fixed in kernel-2.6.9-42.0.3.EL.

You can check syslog to see if the driver is loaded correctly. Once this is done, you should be able to setup the wireless connection manually, with standard tools like /sbin/iwconfig etc., or a graphical configuration tool (/usr/sbin/system-config-network).

More detailed and useful setup information can be found the project page. For example, the document says you may need to do:


# echo 100 > /sys/class/firmware/timeout

to load the firmware correctly (In my case, I didn't have to do this). It also provides newer versions of driver/firmware than what CentOS 4.2 kernel contains. If you have some problem, you may want to delete existing modules and install newer ones. As far as I believe, the "firmware" has nothing to do with what's written into the hardware EPROM, so testing a newer firmware doesn't affect anything when you are running a different kernel or a different OS.

Trackpoint scroll

While the trackpoint/touchpad works right after installation, there are several features missing. One of them is the "scrolling using the trackpoint", which allows the trackpoint to be used like a scroll wheel when the center button pressed. Since I heavily depend on this functionality, it was important to make it work.

As far as I know, there are three possible approaches. The first one, which is simplest, is just changing the "InputDevice" section in /etc/X11/xorg.conf as follows.


Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "yes"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "EmulateWheelInertia" "50"
EndSection

After restarting X (logout and login again, or just reboot), the trackpoint scroll should work. Unfortunately, this isn't the perfect solution. It does make the scrolling using the center button work, but the center button no longer works for clicking. (That's why "Emulate3Buttons" is necessary - you need to press left and right buttons simultaneously to paste on X.)

The second approach is to use tp-scroll (see here for the detail of how to set it up.). I have used it for Fedora for a while, but I haven't tried it on CentOS either. Basically it uses a FIFO created as a dummy mouse device, and the tp-scroll program, which works as a proxy to the real mouse device, tranforms mouse "signals" to realize trackpoint scrolling. It's a great program.

The third approach, which I chose to take, is to use this patch, and recompile X.org from the source code. Then the following setting in /etc/X11/xorg.conf works (notice the new option "EmulateWheelClickToo").


Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "no"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "EmulateWheelInertia" "50"
Option "EmulateWheelClickToo" "true"
EndSection

Here's how to recompile the X.org RPMs from the SRPM package and the patch. Since I didn't want to "contaminate" the system directories for this task, I did it as a non-root user.

  1. Download the following files: xorg-x11 SRPM, patch for trackpoint scrolling, and patch to the spec file. (I have adjusted the original patch so that it fits the source code of the CentOS.)
    • Update for CentOS 4.3: the latest xorg-x11 SRPM for CentOS 4.3 is here. The patch for trackpoing scrolling and the pacth for the spec file still work, but since there has been slight changes in the line number in the latter, I put the new patch for the spec file here.
  2. Set up the RPM build environment. I assume you build everything in the ~/rpmbuild directory as a non-root user. (The technique to use rpmbuild as a non-root user was borrowed from here.)

    $ cd ~
    $ cp -a /usr/src/redhat/ rpmbuild
    $ echo '%_topdir %(echo $HOME)/rpmbuild' >> .rpmmacros
    $ echo '%debug_package %{nil}' >> .rpmmacros
  3. Install the SRPM file into ~/rpmbuild, and copy the patch file to the source/spec directory


  4. $ rpm -ivh xorg-x11-6.8.2-1.EL.13.20.src.rpm
    $ cp xorg-x11-6.8.2-emulate-wheel-click-too.patch ~/rpmbuild/SOURCES/
    $ cp xorg-x11.spec.patch ~/rpmbuild/SPECS/
  5. Patch the spec file and build the RPM

    $ cd ~/rpmbuild/SPECS/
    $ patch < xorg-x11*.spec.patch
    $ rpmbuild -bb xorg-x11.spec
  6. If everything goes well, the RPM files are created in the ~/rpmbuild/RPMS/i386 directory. Install them as root.

    $ su
    # rpm -Uvh --force *.rpm
  7. After restarting X, you should be able to use both clicking and trackpoint scrolling with the "EmulateWheelClickToo" option. Delete the build file and directory (you could save the RPM files for later if you want, but you can always rebuild them.)

    $ cd ~/
    $ rm -R rpmbuild
    $ rm .rpmmacros

Emacs

For certain reasons, I'm using the latest version of emacs on the CVS. Due to the exec-shield of recent Linux kernels, you need to use 'setarch' to avoid crashing during make.
$ export CVS_RSH="ssh"
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co emacs
$ cd emacs
$ setarch i386 ./configure
$ setarch i386 make bootstrap
$ su
# setarch i386 make install

OpenOffice.org 2

CentOS 4.2 comes with OpenOffice.org 1.1.2. Unfortunately, OpenOffice.org 1.1.x has many limitations, and it's almost unusable for me. (The biggest problem is its inability to open a large spreadsheet.) I have used OpenOffice.org 2 and knew it's much better, but with the nature of CentOS (i.e., that of RHEL), it is unlikely that major update release is provided. Therefore, I obtained the RPM package from the OpenOffice.org project page and installed it. Since their package is for general linux environment, I had to take the following steps to fit it to CentOS. The version I installed is 2.0.1.
  1. Uninstall OpenOffice.org 1.1.x. (It turns out that version 1.1.x and 2.0.1 can co-exist, as they are installed in completely different places. However, you may have to configure which application is invoked in the desktop setting. I just decided to uninstalled the old version completely, as I knew I never use it.) The following command:
    $ rpm -qa | grep openoffice
    
    will display the currently installed rpm packages for OpenOffice. You may want to take a memo so that you can remember which packages were installed in case you really need to reinstall them. As a root, run:
    # rpm -ev openoffice.org openoffice.org-i18n ...
    
    where "..." are the all relevant packages names. (The list depends on your environment.) In my case, it was
    # rpm -ev openoffice.org openoffice.org-i18n openoffice.org-kde openoffice.org-libs openoffice.org-pyuno
    
    If you have used OpenOffice.org 1.1.x, you may also want to delete the files in your home directory, such as ~/.openoffice-install-log, ~/.openoffice-lock, etc. manually. If you don't have to keep the setting of the old version, you can also delete the ~/.rhopenoffice1.1 directory. Otherwise, you may wait to delete this directory until you transfer the setting (see below). Logout and re-login so that the desktop icones for the old version disappears.
  2. Go to http://www.openoffice.org/ and download the latest version of the package file (in my case, OOo_2.0.1_LinuxIntel_install.tar.gz). Extract the files, and install the RPM files as follows.
    $ tar zxvf /opt/build/openoffice/OOo_2.0.1_LinuxIntel_install.tar.gz
    $ cd OOA680_m1_native_packed-1_en-US.8990/RPMS/
    $ su
    # rpm -ivh *.rpm desktop-integration/openoffice.org-redhat-menus-2.0.1-1.noarch.rpm
    
    You may want to select the RPM files to install if you don't need all functions. (I don't know enough about the dependency among those RPM files.)
  3. Logout and login again to enable the updated desktop application information. (The 'kde-config' command may be useful if you have a problem with it.) In my case, I further had to manually change the KDE desktop settings: (1) Set the icon shown in Konqueror. Open the Control Center and go to "KDE Components" -> "File Associations". From the list, choose "application" and click "msword", "msexcel", and "mspowerpoint". Click the icon button and choose something like "openofficeorg-20-*". (2) Add the application launch buttons by right-clicking on the task Panel. (I'm not sure if you need similar settings in Gnome too).
  4. Start the application from the menu. Alternatively, if you haven't configured the desktop, the OpenOffice.org 2.0.1 is installed under the /opt/openoffice.org2.0 directory, so run:
    $ /opt/openoffice.org2.0/program/soffice
    
    If the installations is successful, the setup window is displayed. If you accept the license agreement, you'll be asked whether you want to import the settings from the old version, and whether you want to register. Now you should be able to use OpenOffice.
  5. If some Microsoft Office documents are displayed uglily, the cause is most likely a font problem. Since TrueType fonts such as Arial, Times New Roman, etc. do not exist in CentOS, the documents using these fonts can be shown with incompatible fonts. You can go to "Tool" -> "Options" -> "OpenOffice.org" -> "Fonts" to manually define font replacement table, but unless you have appropriate fonts it's not very helpful. (I remember the CentOS version of OpenOffice.org 1.1.x was showing these fonts with better look, but I wasn't able to look into why anymore as I had uninstalled it already.) A solution is to install "alternative fonts". There are many freely available fonts you can find on the internet (see here for example). Put the extracted font files in /usr/share/fonts (you can create any sub-directories), restart the font server and re-login (or just reboot the system).

IBM ThinkPad ACPI Extras Driver

I have installed the ibm-acpi driver for ThinkPad ACPI. The ibm-acpi driver is now part of kernel 2.6.10 and later, but as of today, the version of CentOS kernel (i.e., RHEL 4 kernel) is still 2.6.9-x. Among other things, I needed to install this driver to be able to disable screen expansion when doing a presentation (see here). I expect It will be useful to setup suspend/hibernation, although I haven't tried it yet.

Since the RPMs found in several sites were either too old or seemed incompatible with Red Hat-based distributions, I just downloaded the source code from the project page and compiled it according to the README document. (This must be repeated when you update the kernel.)

$ tar xzvf ibm-acpi-x.y.tar.gz; cd ibm-acpi-x.y
$ make
$ su
# export PATH=$PATH:/sbin
# make install

Then run '/sbin/modprobe ibm-acpi' and you will be able to access the driver via /proc/acpi/ibm. The final step is to load the driver module automatically. I added the following line at the end of /etc/rc.d/rc.local.


/sbin/modprobe ibm-acpi

Of course you could run modprobe by hand every time you boot the OS, or if you want to do something more sophisticated, it would be easy to write an init.d script to make modprobe/rmmod easier.

The version of KDE (3.3.x) included in CentOS has the "IBM Thinkpad Laptop" menu in the Control Center, but unfortunately it doesn't seem to work with this ibm-acpi driver.

Doing a presentation

Sometimes I do a presentation with an external projector. The LCD of my T43 is SXGA+ (1400x1050 pixels), but no projector that I can use supports such a high resolution. An ideal situation would be to show low-resolution image (like XGA, 1024x768) while keeping SXGA+ display on the LCD, but I have had no clue how to do it. The more practical way is to switch to a low LCD resolution when doing a presentation. KDE can change the display resolution in a "Window-ish" way (right-clicking on the desktop and choosing the "Configure desktop" menu), and this is acceptable for me.

However, there's still a problem. Even if I reduce the LCD resolution to XGA, the external RGB output is still corrupted if the LCD screen expansion is enabled. Worse yet, even if I disabled the screen expansion on BIOS (and the config tool on Windows XP), the screen expansion is still enabled on CentOS. I haven't figured out how to turn of on X (or KDE, I don't know). The only solution I've had so far is to rely on the ibm-acpi interface, and manually disable the screen expansion when necessary. (I don't know how to obtain the current screen expansion mode.)


$ echo expand_toggle > /proc/acpi/ibm/video

I hope to automate this (or a cleaner solution) and make it work through the Fn+F7 key in the future.

Software Mixing

Traditionally, Linux applications directly access the sound device (/dev/dsp), which means only one application can play the sound at one time. While this may be good for high-fidelity playbacks, I really wanted to play some music, listen to the sounds from Flash on Firefox, and hear the notification from KDE all at the same time. To do this, we have to use a mechanism for software mixing, and make applications go through a "sound server" instead of accessing the bare sound device. There are several ways to achieve this. Some sound servers are closely coupled with desktop environments like KDE or GNOME, while others are independent of them. If you are interested, try googling arts, esd, jack, sdl, etc.

The approach I chose to take was dmix, which is a native plugin for ALSA (Advanced Linux Sound Architecture), because it was easy to use, and it seemed to cause fewest side effects. This page contains the overview of the necessary settings, and here's what I have actually done. It's mostly based on this page (written in japanese).

  • Save this file as /etc/asound.conf. This file is read by /etc/alsa/alsa.conf. If you want to limit the configuration to one user, it is possible to put this file as ~/.asoundrc instead of /etc/asound.conf.
  • Install alsa-oss to use the aoss command. Aoss is a wrapper script to allow non-supported applications to force using ALSA. You can go to here, download the latest release and install it. Instead, I downloaded the SRPM package from here and compiled it.

    $ cd ~
    $ cp -a /usr/src/redhat/ rpmbuild
    $ echo '%_topdir %(echo $HOME)/rpmbuild' >> .rpmmacros
    $ echo '%debug_package %{nil}' >> .rpmmacros
    $ rpm -ivh alsa-oss-1.0.10-1.src.rpm
    $ cd rpmbuild/SPECS
    $ rpmbuild -bb alsa-oss.spec
    $ cd ~/rpmbuild/RPMS/i386
    $ su
    # install -ivh alsa-oss-1.0.10-1.i386.rpm
    
    If you can find a alsa-oss RPM package for RHEL4 or Fedora3 somewhere else, it will probably work too.
  • Change application configurations to use ALSA.
    • KDE: In the Control Center, go to "Sound & Multimedia"->"Sound System"->"Hardware" and select "Advanced Linux Sound Architecture".
    • MPlayer: create a file ~/.mplayer/config and add 'ao=alsa'.
    • XMMS: open the preferences window and choose ALSA as Output Plugin.
    • Firefox: create a wrapper script.
      #!
      aoss /usr/bin/firefox "$@"
      
      Then make it executable and put it in a location listed in the execution path. For example, you can put it in the ~/bin directory and add this directory to the $PATH environment variable. (Another approach is to create an alias like "alias firefox='aoss /usr/bin/firefox'".)
    • Play: add "alias play='aplay'".

Other minor issues

  • The default paper size of dvips is A4. US users may want to change it letter (see here).
  • To use tpb for onscreen display, you need to install xosd RPM. Old version of xosd had an issue when it is used together with VMWare (tpb randomly freezed when VMWare or VMPlayer was running). xosd-2.2.14 or later works fine. (You may have to create a device file /etc/udev/devices/nvram manually if your RPM file doesn't include it. The RPM package for RHEL4 does contain the device file. try 'rpm -qf tpb' and see what files are included.) Finally, to run tpb as a normal user, you need to edit /etc/udev/permissions.d/50-udev.permissions and edit the line for nvram to something like 'nvram:root:root:0666'. You could directly changing the permission of /dev/nvram, but then that's only effective until you reboot the system.

Upgrading from CentOS 4.2 to 4.3

With the release of the Red Hat Enterprise Linux 4 Update 3, the CentOS 4.3 has been made available. On my system, the yum command automatically attempted to connect a new repository. (To prevent this from happening, you can modify /etc/yum.conf and the files in /etc/yum.repos.d so that yum can access to the version 4.2 tree instead of the latest version 4 tree.)

It is often unadvised to jump to a new release if the stability has the highest priority. However, I took a risk and just ran 'yum upgrade'. After a reboot, the system seems to work fine as before. (Since the X packages are updated, you need to rebuild the X packages to re-enable the center-button click if you are using the same approach as I do.)

Upgrading from CentOS 4.3 to 4.4

Unless you configure not to, the "yum update" command makes the system upgraded to 4.4. I recommend to use "yum upgrade" to check obsolete packages. After upgrading is complete, you have an option to run "yum clean all" to free up the disk space for the downloaded packages.

Using IMAP on Mew

If you are using the department Web IMAP, you'll possibly want to leave mails on your mail spool. In this situation, you may want to use IMAP on Mew too. Here, I'll explain how to setup Mew to use IMAP over SSL. For the general information on how to setup Mew, please read another page too.


Stunnel


To use IMAL over SSL, you need to use stunnel (http://www.stunnel.org/). Mew supports both Stunnel-3.x and Stunnel 4.x. Stunnel is already installed on junkfood machine, so you can just add /usr/imports/stunnel/sbin to your $PATH environment variable to use it.

Import certificate


To use SSL properly, you need to install a department certificate. This page explains general information on the department SSL certificate, and what you need to do is to get the cert file and put it at the proper location with the proper name as follows.

  1. Open this page with your browser. (You may see the warning if you haven't set up your browser.)

  2. Save the file cacert.cer linked from this page.
  3. Run the following command:

    $ openssl x509 -hash -noout -in cacert.cer

    This outputs a string like "a0208049". The cert file should be renamed to this string + ".0" and be stored in ~/.certs.

    $ mkdir ~/.certs
    $ mv cacert.cer ~/.certs/`openssl x509 -hash -noout -in cacert.cer`.0


You can confirm stunnel is working by the following command (where "nnnnn" is an arbitrary unused port number.)

$ stunnel -c -f -d localhost:nnnnn -a ~/.certs -v 1 -D debug -P none -r ringding.cs.umd.edu:993

then on the second console,

$ telnet localhost nnnnn

you will see a verification error on the first console if a cert is not installed properly. Otherwise you will see an IMAP prompt on the second console.

If necessary, more information on setting up a CA certificate is found here.

(Optional) Installing Stunnel


Just in case you need to install stunnel by yourself, below is a summary of commands for installing Stunnel-3.26. (I have written this because I didn't find stunnel on junkfood machine first:) After it is completed, you need to add stunnel to your PATH environment variable. In the case above, stunnel would have be installed in $HOME/local/sbin. (You can change the directory name as you wish, of course.)

$ cd (somewhere)
$ wget http://www.stunnel.org/download/stunnel/src/stunnel-3.26.tar.gz
$ gzip -d < stunnel-3.26.tar.gz | tar xf -
$ cd stunnel-3.26
$ ./configure --prefix=$HOME/local
$ make (You will be asked to enter your DN during compiling. Just come up with something and enter it.)
$ make install

IMAP folder setup

The current department IMAP server makes an entire home directory visible to a client. Under this setting, Mew tries to scan the whole files in ~/ when creating the folder index by default, which is time-consuming and useless. One way to avoid this is to make Mew use an "MH directory" setting instead. To allow the IMAP server to use this mode, you need to create a file ~/.mh_profile and write just one line in it:
Path: Mail
(The file .mh_profile is originally a user configuration file for mh. Here I omit all backgrounds for why this is necessary for IMAP.)

Mew configuration - pop3-like usage

To use IMAP, the content of the file ~/.mew.el should be changed. For a certain reason, the setting in this section is not a common configuration for using imap. (I'll describe an alternative setting in the next section. Take a look at it too, and choose the one you prefer.) The configuration in this section makes Mew use imap in a "pop3-like" manner.
(setq mew-imap-prefix-list '("#mh/" "#mhinbox"))
(setq mew-use-cached-passwd t)
;; Uncomment the following line if you don't want to get mail when startup
;(setq mew-auto-get nil)
(setq mew-config-alist
      '(
	("default"
	 ("name"        . "Your Name")
	 ("mail-domain" . "cs.umd.edu")
	 ("proto" . "+")
	 ("mailbox-type" . imap)
	 ("imap-server" . "ringding.cs.umd.edu")
	 ("imap-ssl" . t)
	 ("imap-ssl-port" . "993")
	 ("imap-size" . 0)
	 ("imap-delete" . t))
	("local"
	 ("mailbox-type"     . mbox)
	 ("mbox-command"     . "incm")
	 ("mbox-command-arg" . "-c -d /var/mail/username"))))
(setq mew-nntp-server "news.umd.edu")

Once it's done, restart emacs and Mew. You will have to press "3Z" ("3", then Shift+"z"), then press enter to update folder list cache when you use IMAP for the first time. You'll be asked a password because now Mew is connecting to the IMAP server instead of reading from the local spool.

When you start Mew or enter "i" in the summary mode, you will be asked a password because now Mew is retrieving mails from the imap server instead of local spool. Except that, everything is the same. Outgoing mails are sent to local host. Read the later section about the password management. Note that the mails will be deleted on the server when you retrieve mail. If you want the server to keep the retrieved mails, set mew-imap-delete to t.

	 ("imap-delete" . nil)

Mew configuration - general imap

IMAP provides much more powerful remote mail management than POP3. To utilize it (really use IMAP), a differnt setting is necessary. Please keep several things in mind, though. First, you should be aware about "remote folder" versus "local folder". This will change the way you use Mew a little bit. Second, the current imap system on the junkfood system does not support such an advanced functions. Until the system is updated, you can't do much better than the previous setting. Take a look at it too, and choose what you prefer.

The ~/.mew.el should look like:


(setq mew-imap-prefix-list '("#mh/" "#mhinbox"))
(setq mew-use-cached-passwd t)
;; Uncomment the following line if you don't want to get mail when startup
;(setq mew-auto-get nil)
(setq mew-config-alist
'(
("default"
("name" . "Your Name")
("mail-domain" . "cs.umd.edu")
("proto" . "%")
("imap-server" . "ringding.cs.umd.edu")
("imap-ssl" . t)
("imap-ssl-port" . "993")
("imap-size" . 0)
("imap-delete" . nil))
("local"
("proto" . "+")
("mailbox-type" . mbox)
("mbox-command" . "incm")
("mbox-command-arg" . "-c -d /var/mail/username"))))
(setq mew-nntp-server "news.umd.edu")

Once it's done, restart emacs and Mew. You'll be asked to press "3Z" ("3", then Shift+"z"), as you did in the first method.

After Mew is started, you can retrieve mails from the server by entering "s", then enter. You don't use "i" in the IMAP directory. The retrieved mails are stored in the directory such as ~/Mail/.imap/username\@ringding.cs.umd.edu%imap/. As this name implies, the files in this directory is no longer considered as "real entity". They are just caches of actual mails on the IMAP server.

Copy/move mails to local

Sometimes you may want to copy or move your mail on the spool to your local directory. (Here, "local" means the ~/Mail/inbox directory, for example. Unlike directories under ~/Mail/.imap, a mail in this directory is not a cache.)

The quickest way to move mails to local is to enable the local access to the spool and use "i" command. This can be done by the following step. (Caution: after this operation, all mails in the spool are moved to local, so the spool will become empty!)


  1. In the summary mode, enter "C"
  2. In the mini-buffer, enter "local" and press the enter key.
  3. Press "i" to retrieve mails from the spool to the local directory
  4. In the summary mode, enter "C"
  5. In the mini-buffer, enter "default" and press the enter key. Now "i" key is disabled.
  6. To go back to the imap folder, press "g" in the summary mode, and enter "%inbox" then enter. To go to the local inbox, press "g" and enter "+inbox" then enter. (This is part of Mew's folder mechanism. You will understand more if you read the manual about how to refiling messages into folders. here I explained the very minimum stuffs. You can copy or move individual mails too, of course.)

SMTP

A general instruction on authenticated SMTP is found here. In short, what you need to do is a TLS tunnel on either port 25 or 587. (Port 587 is prepared for the access from providers blocking outbound port 25.) Below is the setting you need for the port 25, together with the general imap settings. (Of course, smtp over TLS can be used with POP3-like imap too.) Note that I have added the line "imap-user" in case your junkfood account name is different from the one you use on your pc.
(setq mew-imap-prefix-list '("#mh/" "#mhinbox"))
(setq mew-use-cached-passwd t)
;; Uncomment the following line if you don't want to get mail on startup
(setq mew-auto-get nil)
(setq mew-config-alist
      '(
	("default"
	 ("name"        . "Your Name")
	 ("mail-domain" . "cs.umd.edu")
	 ("proto" . "%")
	 ("smtp-auth-list" . ("PLAIN"))
	 ("smtp-server" . "smtp.cs.umd.edu")
	 ("smtp-port" . "25")
	 ("smtp-ssl"    . t)
	 ("smtp-ssl-port" . "25")
	 ("smtp-user"   . "username")
	 ("imap-server" . "ringding.cs.umd.edu")
	 ("imap-ssl" . t)
	 ("imap-ssl-port" . "993")
	 ("imap-user"   . "username")
	 ("imap-size" . 0)
	 ("imap-delete" . nil))
	; The settings for local access may not be necessary for your pc, but
	; I just leave it here.
	("local"
	 ("proto" . "+")
	 ("smtp-auth-list" . ("CRAM-MD5" "PLAIN" "LOGIN"))
	 ("smtp-server" . "localhost")
	 ("smtp-ssl"    . nil)
	 ("mailbox-type"     . mbox)
	 ("mbox-command"     . "incm")
	 ("mbox-command-arg" . "-c -u -d /var/mail/username"))))
(setq mew-nntp-server "news.umd.edu")

About password

Mew remembers on the memory the password you entered for a short period of time - about 20 minutes. After you didn't use the password during this time period, the password is cancelled and you have to reenter the password. This design is a result of tradeoff between usability and security. There are ways to customize this behavior.
  • If you don't want Mew to remember the password, set mew-use-cached-passwd to nil:
    (setq mew-use-cached-passwd nil)
    
  • If you want Mew to remember the password for longer time period, you can add something like the following to .mew.el. (This example makes Mew remember the password practically long enough.)
    (setq mew-passwd-timer-unit 999)
    (setq mew-passwd-lifetime 999)
    
  • If you really want to, you can write the password in your .mew.el. I don't recommend it for security reason. Entering password one time when you start Mew is not really frustrating at all. If you wrote password in your .mew.el, however, make sure that file permission is set correctly so that the password is not easily readable from others. (chmod 600 ~/.mew.el*)
    (setq mew-passwd-alist '(("username@ringding.cs.umd.edu:imap" "password" 0)))
    

Using Fedora Core 3 on ThinkPad T40

(I no longer possess T40, thus this page will no longer be updated.)

I have been using Fedora Core 2 on IBM ThinkPad T40 (2373-75J) for several months (see here for information on installation and configuration of FC2), and recently I have (bravely) upgraded it to Fedora Core 3. Below is my memo on the problem I encountered during the process. What I did was an upgrade, so some may not apply to a clean install.

TODO list

  • Modem (I haven't used a dialup connection for years. I'll set it up someday...:)

Work done

Using VMWare 4.5.2 on kernel 2.6.11

Although VMWare Workstation 4.5 doesn't officially support Fedora, it has been running fine on my FC3. Starting from the kernel version 2.6.11, however, it doesn't work any more (vmware-config.pl fails with an error) since some kernel functions have been deleted. (I hear the newer version of VMWare works fine, but I cannot afford it yer.) After upgrading to a 2.6.11 kernel, I have downloaded vmware-any-any-update90.tar.gz, extracted at some directory, and ran ./runme.pl as root. It made the necesasry modifications to VMWare and ran vmware-config.pl. Then it worked again. I do not know where this patch came from or what it actually does, so do it on your own risk.

As far as I know, there are two solutions other than upgrading to VMWare 5. First is to patch and recompile the Linux kernel following this post. The second, which I took, is to use an unofficial patch to VMWare called "any-any patch", which you can get from here.

Clock problem with APM suspend/hibernation in kernel 2.6.10

A bug was introduced a bug in kernel 2.6.10 which screws the clock after APM suspend/hibernation (as well as ACPI?) You can read the posts to the linux-kernel mailing list in here, here, and here. This bug is also filed in the Fedora bugzilla here.

I'm using APM (read here) and had the same problem. As far as I read the thread in the mailing list, the problem is solved in kernel 2.6.11-rc1. As a Fedora user, the only solution so far is to revert the change made in arch/i386/kernel/time.c and recompile the kernel by yourself. Another option is to keep using a 2.6.9 kernel package, but it has a security vulnerability... 04/17/05: The problem has finally been fixed in the kernel 2.6.11-1.14_FC3.

Adobe Reader 7

For a long time the development of Acrobat Reader for Linux appeared to have stopped at 5.x, but now the newest version, Adobe Reader 7 is available here. RPM version seems to work without a problem on FC3.

Default paper size in dvips

If you use dvips to convert a dvi file to a postscript file, you may find the file doesn't have an appropriate top margin. The reason is that the default paper size in dvips in Fedora is set to a4paper, not lettersize. This seems to be a policy of RedHat distributions (see here for discussion), but since other tetex tools (e.g., latex) uses lettersize as default, this could be a problem. The solution is either to use the '-t letter' option of dvips every time, or run the 'texconfig' program as root to change the default. In texconfig, enter 'dvips', select the global settings, change the paper size to letter, then exit.

Formatting problem in urw-fonts

If you are using a tool like enscript and a2ps, you'll find the output contains too big fonts. The bug seems to be in recent version of urw-fonts, and here is a bugzilla entry. A simple workaround until the bug is fixed is to use the old urw-fonts-2.1-7 package for FC2, which you can find here. The following command will overwrite the latest version of urw-fonts with this old package:
# rpm -Uvh --force urw-fonts-2.1-7.noarch.rpm


You may want to save this rpm package, because each time you run automatic update tools such as up2date, yum and apt-get, they try to re-upgrade the urw-fonts package to the latest version. Of course you can configure these tools to inhibit the update of urw-fonts, but then other packages that depend on urw-fonts will fail upgrades due to the dependency check. Such packages include ghostscript, xpdf, etc. You can query which packages in your system depend on urw-fonts by the following command.


$ rpm -q --whatrequires urw-fonts

Therefore, one option is you just want to let the upgrading of urw-fonts when necessary, and repeat the downgrading process above. The bugzilla entry says the bug is supposed to be fixed in urw-fonts-2.2-8 when it comes out, but I haven't had a luck to test it yet.

4/20/05: An update package, urw-fonts-2.3-0.FC3.1 has solved this problem. You can use up2date, yum or apt-get to download and upgrade to the latest package.

Sound problem with kernel 2.6.10

Audio has worked fine out of box for a long time, but with kernel update released in Janurary 2005, it seems to stop working. The module is loaded and no error is displayed, but you just don't hear any sound. A bug report is found here. The report is about ALSA driver, but snd-intel8x0, which my T40 is using, has a same problem (see here). I have confirmed that the problem occurs in kernel-2.6.10-1.737_FC3 and kernel-2.6.10-1.741_FC3.

Although this may be just a temporary problem, you can't wait to upgrade to 2.6.10 kernels because they contain security fixes. Fortunately, someone posted a workaround that enables audio here. I did the following and got the audio working again. (you don't have to be the root.)

  • Open a terminal window and run /usr/bin/alsamixer
  • Use a right arrow key to move focus to "Headphone Jack Sense".
  • Press 'M' to mute it.
  • Do the same and mute "Line Jack Sense" too.
  • Press the Esc key to exit alsamixer.

I haven't seen any side effect of these settings. The headphone jack and the line jack still work.

Upgrading from FC2 to FC3 using yum

Since I didn't want to repeat everything I did in FC2, I chose to upgrade instead of clean install. There are several ways of doing it (the most standard way will be to downlad iso images of FC3 and install from them), but I just used yum. I have followed the instruction in this page. In summary, I did the following.
# wget http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/fedora-release-3-8.i386.rpm
# wget http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/yum-2.1.11-3.noarch.rpm
# rpm -Uvh --force fedora-release-3-8.i386.rpm yum-2.1.11-3.noarch.rpm
# yum upgrade
Then answer 'y' to when the question is displayed. Yum automatially downloaded necessary packages, installed them and removed old packages. It took several hours for download more than 3,000 packages. I had to press ctrl+C and repeat 'yum upgrade' to resume from a network congestion problem.

If there was no problem, yum successfully upgrades the system to FC3, preserving existing system settings. So next time you boot from the new kernel (it is not set as a default in GRUB menu) you're system should be running FC3. However, I couldn't boot the new kernel first. The reason is I was using tp-scroll for the scrolling function with the center button. tp-scroll requires a FIFO named /dev/imouse, but under the new udev system this file is recognized as a regular file. This seems to make the kernel freeze at boot (at runlevel 5, at least). It turned out the following commands solve the problem.


# rm -f /dev/imouse
# mkfifo /dev/imouse
# cp -p /dev/imouse /etc/udev/devices/

For the same reason, if you are using tpb for on-screen display, you need /dev/nvram to be copied under /etc/udev/devices. (If you are using VMWare, you will need to do the same thing for /dev/vmmon and /dev/vmnet*.)

Except above, upgrade was mostly successful. You may want to run 'yum update' to check if there are more update available. Here are some minor problems/cautions I found after the update.

  • The entry for emacs is missing from the menu.
  • KDE anti-aliasing option was turned off. I re-enabed it at the Control Center.
  • In the clean install of FC3, SELinux should be enabled by default with the targeted policy which protects selected daemons (See here for more information). However, in my system which was upgraded from FC2, SELinux is disabled by default. (You can check this in /etc/selinux/config.) If you want to turn on SELinux, you will have to relabel the file system. (And I don't know what happens if you boot the old FC2 kernel after that.)
  • FC3 comes with OpenSSH 3.9, and in recent version of SSH, trusted X11 forwarding is disabled by default. You may need to use '-Y' to use some X11 applications (such as emacs). (See here for the detail.)
  • An unnecessary package, policy-strict-sources seems to have left in the upgrading process. This prevents apt-get, another package management tool, from working properly after upgrade. I ran the following command to solve this problem.


  • # rpm -ev policy-strict-sources-1.11.3-3

  • I heard that the xorg-x11-deprecated-libs package is necessary for running Firefox. In my case this package was automatically installed.

Services

FC3 installs a lot of services and daemons, but very often most of them are not used at all. Running processes you never use is a waste of system resources, and also a potential security risk. So you should change the configuration using '/sbin/chkconfig' or you prefer GUI, you can use the 'system-config-services' command instead.

Unfortunetely I have already changed the configuration a lot, I'm not sure which services are on by default. Below is just a list of services I recently found running and unnecessary.

  • I found that this page states that lm_sensors 2.6.5 or later should not be installed on IBM Thinkpads. I'm not sure it it has actually caused a problem in my own machine, but for safety (and since it says it is useless on ThinkPad anyway), I changed the service configuration as follows.

    /sbin/chkconfig --level 2345 lm_sensors off

    You may also want to remove the lm_sensors package using 'rpm -e' command.
  • mDNSResponder and nifd seem to be for iTune, which I don't have.

Mew: An Excellent Mail/News Reader for Emacs

Mew (http://www.mew.org/) is a very powerful mail/news reader that runs on emacs developed by Kazu Yamamoto. It supports pop3/imap/smtp/nntp, and it can nicely work together with pgp/ssl/ssh, etc. Mew began as a variant of mh ten years ago, but now it has evolved into a completely independent, far more powerful and flexible program. I've been using it for about 8 years. Several things I like about Mew are:

  • It produces mails strictly conforming RFCs. It fully supports MIME.

  • It has very well-designed user interfaces for those who like emacs.

  • It is still actively being developed, and cutting-edge features are added day by day.

  • It is safe. I am using Mew on Linux, as well as Windows with Meadow (http://www.meadowy.org/meadow/), an emacs for Windows. I have to worry few less about viruses or other threats related to e-mails compared to other MUAs. (Of course it depends on how you use it, though:)

Here I explain how to setup and use Mew in the junkfood unix environment. Since Mew is not installed on the junkfood machines, you need to install it by yourself. The method should work on any other machines running common *nix OS.

Installation
First you need to download Mew from the link on the official site, http://www.mew.org/. The current stable release is 4.2, and I explain the installation process based on this version.

  1. Download the mew-4.2.tar.gz to your favorite directory (you can use a browser, of course,) and extract it.
    $ wget http://www.mew.org/Release/mew-4.2.tar.gz
    $ gzip -d < mew-4.2.tar.gz | tar xf -
    $ cd mew-4.2
    
  2. Beginning from version 4.2, Mew comes with a standard "configure" script. So those who have an experience of compiling other free software shouldn't have much problem. Since you probably don't have a root previlege, you need to add a --prefix option to configure. Here I assume you put everything under $HOME/local, i.e., the directory named "local" under your home directory. You can change it to whatever you like.
    $ ./configure --prefix=$HOME/local
    
  3. You may need to create some directories where you install Mew. (I'm not sure about this. I know this was necessary in order version without the configure script, but now those directory may be automatically created if they are missing.)
    $ mkdir $HOME/local
    $ mkdir $HOME/local/bin
    $ mkdir $HOME/local/info
    $ mkdir $HOME/local/lib
    $ mkdir $HOME/local/man
    $ mkdir $HOME/local/share
    
  4. Run make
    $ make
    $ make info
    $ make install
    
    
  5. If everything above is successful, you can delete the directory you used for compiling Mew.
  6. Add Mew to the path. If you are using bash, add the following to your .bashrc:
    export PATH=$PATH:$HOME/local/bin
    export MANPATH=$MANPATH:$HOME/local/man
    
    If you are using csh, add the following to your .cshrc:
    setenv PATH $PATH:$HOME/local/bin
    setenv MANPATH $MANPATH:$HOME/local/man
    
  7. Edit ~/.emacs (or ~/.emacs.el). Add the following:
    (setq load-path
          (append
           (list
           (expand-file-name "~/local/share/emacs/site-lisp/mew")
           )
           load-path))
    (require 'info)
    (setq Info-directory-list
          (cons (expand-file-name "~/local/info")
    	    Info-directory-list))
    (autoload 'mew "mew" nil t)
    (autoload 'mew-send "mew" nil t)
    (setq mew-icon-directory "~/local/lib/emacs/etc/Mew")
    ;; Optional setup (Read Mail menu for Emacs 21):
    (if (boundp 'read-mail-command)
        (setq read-mail-command 'mew))
    ;; Optional setup (e.g. C-xm for sending a message):
    (autoload 'mew-user-agent-compose "mew" nil t)
    (if (boundp 'mail-user-agent)
        (setq mail-user-agent 'mew-user-agent))
    (if (fboundp 'define-mail-user-agent)
        (define-mail-user-agent
          'mew-user-agent
          'mew-user-agent-compose
          'mew-draft-send-message
          'mew-draft-kill
          'mew-send-hook))
    
  8. Create a new file named ~/.mew.el. Write the following in this file. ("username" below should be your account name.)
    (setq mew-config-alist
          '(("default"
    	 ("name"             . "Your Name")
    	 ("mailbox-type"     . mbox)
    	 ("mbox-command"     . "incm")
    	 ("mbox-command-arg" . "-c -u -d /var/spool/mail/username")
    	 ("mail-domain"      . "cs.umd.edu"))))
    (setq mew-nntp-server "news.umd.edu")
    
    
  9. Now start emacs, and type M-x mew (Meta-x-mew, or Esc-x-mew). If everything went well, you'll see an opening message, then the "+inbox" buffer will appear. Congratulations! You have succeeded in installing Mew.

I think I need to make several notes here.


  • (Important) All mails you have received is stored in ~/Mail/inbox by default. Each mail is stored in a separate file, and by default, Mew deletes the retrieved mails from the spool, like any other traditional mail reader. Mew can be configured to leave mails in the spool by adding the "-b" option to "mbox-command-arg", but unfortunately it doesn't work as expected with the department mail server. (This is because the department mail system uses a traditional the mbox style as opposed to the maildir. With "-b" option for mbox, Mew just receives the same mails again and again.) Therefore, if you want to leave mails in the spool, I recommend you use IMAP settings instead. I'll explain how to setup Mew with IMAP setting here.
  • The file ~/.mew.el is the configuration file. The setting written above is the very minimum you'll need, and you can customize Mew by adding stuffs here.
  • mew-config-alist determines the basic behavior of Mew for receiving/sending mails; For example, if you want Mew to use IMAP or POP3, you must change the definition of this variable. You can even prepare several patterns and switch between them.
  • There are a lot of other options you'll find interesting once you start using it. For the full list, type 'M-x info' in emacs, find "* Mew", and push the space key on it. Here are some options I'm using. you can add them in ~/.mew.el if you like.

    (setq mew-use-header-veil nil) ;; do not truncate long header
    (setq mew-auto-get nil) ;; do not get mail when startup (offline mode)
    (setq mew-end-of-message-string nil) ;; do not show 'end-of-message' string
    (setq mew-end-of-part-string nil) ;; do not show 'end-of-part' string

  • incm is an external program of Mew, which retrieves mails from the local mail spool. It should have been installed in $(HOME)/local/bin if you have followed the example shown above. "-c" option is necessary for Solaris platform.

How to read/write a mail with Mew
Here I just list several commands you need to know to read and write a
mail. This is a very minimum list; If you look at the manual, you'll
see how various commands are designed and organized. You can also look
at the HTML version of manual here.

Basic commands
The following commands should be entered on the buffer where the list of mail is displayed. (It is called a summary mode.)


  • 'i': retrieve a mail from the spool:
  • space: display a mail. As you push space multiple times, you can proceed to the next mail.
  • '.': display a mail you want

  • 'w': write a new mail: enter in the summary buffer, and a draft buffer will appear.
  • 'a' or 'A': reply (answer). 'a' will open the draft without citation, while 'A' (shift+a) will open the draft with citation.
  • 'f': forward. Note that Mew creates the multi-part mail - the mail forward as an attachment. Although this behavior is strictly conforming to RFC 822, I often use 'A' (reply with citation) instead.
  • 'y': save an attachment, multi-part, or the whole mail.
  • 'tt': display threads. You can enter and leave the virtual mode by 'tt'. (Read the manual if you want what this precicely means.)

The following commands are used in the draft mode; i.e., in the buffer you are writing a mail.


  • 'C-c C-c': (ctrl+c twice) send the mail to the server.
  • 'C-c C-m': (ctrl+c ctrl+m) send the mail to the queue (~/Mail/queue directory). The mails in the queue will be automatically sent when you enter 'i' (retrieved the mail) next time. This is useful when you're using Mew in offline environment or you want to confirm the mail content later.
  • 'C-c C-q': (ctrl+c ctrl+q) discard the draft.
  • 'C-x C-s': Save the draft for later (this is actually not a Mew comman, but an ordinary emacs command to save a file.) The file will be stored in ~/Mail/draft directory.
  • 'C-c tab' (ctrl+c TAB): If you have the file ~/.signature, you can insert it by this command.
  • 'C-c C-a': Create a multipart (see below)

MIME (attachments)
To add/edit an attachment to a mail, you first need to enter 'C-c C-a' in the draft buffer. This will create a multi-part structure in your draft. Move to the second part (the line marked '2'), and press c, then choose the file to attach. Content type is automatically determined according to the file you are attaching. If you need to change the content type, enter 'T' (shift+t). To delete the attachment, enter 'D'.

Although this may seem complicated, it's actually a very flexible and powerful mechanism. This works as if you're building a tree sructure of MIME step by step. You can precicely control what will be sent in your mail.

Spam filtering
Mew 4 has a set of functions to cooperate with spam-filtering software such as spamassassin, bogofilter, etc. to handle spam mails. You can do several things; you can make them learn spam/ham on Mew, and you can have spam mails stored to a separate directory.

Here I describe how to use Mew with the department mailscanner system. Here I assume you're not using procmail, so spam-tagged mails are stored in your spool. If you're running procmail or your own local instance of spamassassin, you can add rules for a standard tag like "X-Spam-Status: yes". Write the following in .emacs


(setq mew-spam: "X-CSD-MailScanner-SpamCheck:")

and write the following in .mew.el
(defun mew-spam-assassin (val)
  (let ((case-fold-search t))
    (if (string-match "^spam" val) ?D)))
(setq mew-inbox-action-alist
      '(("X-CSD-MailScanner-SpamCheck:" mew-spam-assassin)
       ))
This will make spam-tagged mails marked 'D' (delete) in the +inbox. If you enter 'x', they are all sent to +trash. (You can modify the setting above to make spam-tagged mails stored to a special folder like +spam in the first place. I just prefer to get everything +inbox once.)

How to read/write news with Mew
First, you may want to retrieve the list of newsgroups on the server. You can do that by entering '2Z' (2, then Shift+z) in the summary buffer. You need to do this only once.

At the summary buffer, enter 'g', then enter '-' at the minibuffer. New "+" gets replaced with "-". Now you can enter the group name, or enter space to display the list of groups on the server. Then you'll get the articles on that group. The interface is as same as that for a mail, so you'll know how to use it easily. In case you want to know, the articles are stored under the ~/Mail/.nntp/ directory.

Using Fedora Core 2 on ThinkPad T40

(Note: I have upgraded my system to Fedora Core 3, so I will no longer update FC2 specific information. See here for upgrading from FC2 to FC3, and the system setting of FC3.)

I happen to have an IBM ThinkPad T40 (2373-75J). Recently I decided to start using Fedora Core 2 as my primary desktop environment. (I had my reasons for this choice. I'm not to explain why Linux, why Fedora, etc. here.)

I chose not to use dual-boot, because in my experience rebooting in the middle of work was too annoying. I just bought a new hard disk and replaced it with the original one, so I didn't have to care much about how to preserve the hidden disk-to-disk partition in the original disk. In the case I really need to run applications on MS Windows, I would use VMware Workstation. The current latest version of VMware doesn't officially support FC2, but Workstation v4.5.2 seems to work without a problem with the latest FC2 kernel. It costs $189.00 if you buy it at the VMWare site, $110-$120 if you buy an academic version, or there is a 30-day free trial. (Well, this is not a page about VMWare:)

Below is my memo of setting up various stuffs. I hope some of the information is useful to those who visited this page, but please do everything at your own risk.

Useful links

First of all, there are a lot of people who have already put great efforts in using Linux on T40 or other ThinkPad series.

TODO list

  • Modem

Work done

BIOS

I'm using the latest version of BIOS and the embedded controller. According to people's recommendation found here and here, I changed several BIOS settings from defaults: disabling the touch pad and legacy floppy, changing IRQ allocation, disabling BIOS power management, etc. The reason I needed those changes - it was all about stability. At the time I installed FC2 first, I suffered from consistent system freeze. Changing BIOS setting helped increasing stability. (See here for the freezing problem.)

Installation

Installation was pretty easy. I burned four CDs, booted from the first one, selected the custom install, and just chose "everything." I didn't create a partition for /boot. I didn't have to do anything to get Ethernet adapter, sound, X, and TouchPad work. They just worked out of box.

KDE

The default desktop environment of FC2 is GNOME. I decided to change it to KDE, by rewriting /etc/sysconfig/desktop to DESKTOP="KDE". This is just a matter of preference. One note about GNOME: for some options of X, GNOME has a separate configuration. For example, I prefer swapping the position of the left control key and the caps lock key on X. Usually this can be done by adding the following to etc/X11/xorg.conf.
       Option  "XkbOptions"    "ctrl:swapcaps"
However, in GNOME this doesn't work. Writing per-user key mapping in ~/.Xmodmap is another standard way to do this, but it is ignored too, unless you explicitly run "xmodmap ~/.Xmodmap" after GNOME is up. In GNOME, you need to launch the "keyboard switcher" applet and define the key mapping. (I don't know well what's happening inside.)

KDE KLaptop (battery monitor) recognized the battery status without any configuration (either with ACPI and APM.)

I disabled klipper (KDE clipboard tool), after it died several times with no reason.

Firefox

The default FC2 desktop (either GNOME or KDE) shows an Mozilla icon as a default browser. I prefer Firefox for daily use, so I just installed it. There isn't much to say about installation - get the binary package from mozilla.org and install it somewhere. You can get an RPM package somewhere, or you can even create one using the stuff here.

After a while, I noticed that the browser often gets stuck during the DNS lookup, even if there is no problem in the network. It turned out that this is a known problem in Mozilla and Firefox. (You may want to read this or this.) In short, the cause of the problem is in the way they handle dns lookup when ipv6 is enabled. This problem will be solved in the future version, but if you are using Mozilla or Firefox and don't need IPv6, you may want to solve the problem by disabling ipv6. One easy way to do this without recompiling the kernel is to add the following line to the /etc/modprobe.conf.


alias net-pf-10 off
alias ipv6 off

Some people say the only first line is needed. In my case I had the second line to eliminate the problem.

Trackpoint scroll

Both the trackpoint and the touchpad worked without configuration, except the scrolling using the center button. I definitely need this for web browsing.

An IBM page mentions tp-scroll, a small program that solves this problem. I got the source tar.gz file and compiled it. It seems to work pretty well. Here are some notes, though.

  • As FC2 uses X.org instead of XFree86, /etc/X11/xorg.conf should be modified instead of XF86Config.


  • Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "ExplorerPS/2"
    Option "Device" "/dev/imouse"
    Option "ZAxisMapping" "4 5"
    Option "Emulate3Buttons" "off"
    EndSection

  • The IBM page says "You either need to disable the built-in touch pad in the BIOS, or obtain the synaptics driver for X11." I didn't have to do this for making tp-scroll. (But later I disabled touch-pad for another reason (stability).
  • You need to add the following to /etc/rc.d/rc.local:

    /usr/local/bin/tp-scroll /dev/input/mice /dev/imouse &

    that is, (1) the device file should be /dev/input/mice, and (2) you need "&" at the end of the line. (/etc/rc.d/rc.local and /etc/rc.local seem to be two separate files in FC2. I'm not sure how these two are used, but I would recommend to use /etc/rc.d/rc.local.)

Jason Merrill's page provides some other software for UltraNav touchpad/trackpoint, although I haven't had a chance to try them.

Emacs

For some reasons, I wanted to compile emacs myself. Both CVS head (21.3.50) and the latest release (21.3) crashed during 'make', I searched for a reason and found that this is a known issue with recent Linux kernels. You may want to read this. In short, the following commands solve this.
$ setarch i386 ./configure
$ setarch i386 make bootstrap

Wireless LAN

My T40 model comes with Cisco Aironet 350. There are several options for using this hardware on Linux.
  • The FC2 kernel comes with a working driver, airo.c, out of box, which I ended up using. (The driver used to have a problem when FC2 first came out, and that's why I surveyed other options. The latest kernel should work great.) More information on this driver is available at Fabrice Bellet's page.
  • There is another driver airo-linux, which was originally developed to support several several Cisco cards on Linux 2.4.
  • Fabrice Bellet made his version of airo-linux, airo_mpi, which fix bugs and add missing functionalities in the original. You can get it at his page. I didn't tried it myself, but I believe at least some part of his work has been merged to both airo-linux and the latest airo.c.
  • Cisco has recently released a new Linux driver here.
  • LinuxAnt DriverLoader is an attractive option when your wireless card has poor Linux support. It works as a wrapper for Windows NDIS drivers, so with an Windows device driver and DriverLoader, you can use may unsupported wireless hardware. I have once tried it with another wireless card (Netgear MA521), which worked pretty well. It is $19.95, or there is a free trial version.
  • NdisWrapper is very similar to LinuxAnt DriverLoader, except this is a GPL-licensed software. I haven't tried it.

Old information from several sites recommended to downgrade the wireless card firmware to 5.00.03, because the Linux drivers used to support only the old firmware. The latest drivers supports the newer firmware version 5.30.17, so there's no need of downgrading if you are using this version. If you need to install this version of firmware (because your Windows driver has silently upgraded the firmware, for example), you can download the necessary package here. Caution: A safe way to upgrade/downgrade the firmware is to go back to Windows for a moment, install ACU, and then load the firmware image using it. There is an ACU utility for Linux available, but many people say you shouldn't use it.

"/sbin/iwconfig" should display eth1 and wifi0 ("the airo driver creates a new network interface wifi0 to deal with raw 802.11 frames" according to Fabrice Bellet's page). I usually use ESSID with WEP 128-bit key. "/sbin/iwconfig eth1 essid 'your_essid' key 'your_hex_key'" should work. (your_essid and your_hex_key should be written to the values you're using, of course.) Then "/sbin/ip link set dev eth1 up" will start the device, and "/sbin/ifconfig eth1 ..." will set an IP address and other settings.

For DHCP, you can add the following to /etc/sysconfig/network-scripts/ifcfg-eth1.


BOOTPROTO=dhcp
ONBOOT=yes
MODE=managed
ESSID=your_essid
KEY="restricted your_hex_key"

Then '/sbin/ifup eth1' will do everything.

If you need to dynamically configure these values depending on the network you're connecting, '/sbin/iwlist eth1 scanning' command may be useful to obtain the current network status. You can write your own small script and make it called from ifcfg-eth1 to determine an appropriate settings. (I read documents which recommend to modify /etc/pcmcia/wireless.opts for this purpose, but that doesn't work in this case, because /etc/pcmcia/wireless is never called. /sbin/ifup just calls /etc/sysconfig/network-scripts/ifup-wireless, which in turn calls iwconfig using the values defined in ifcfg-eth1.)

The Cisco driver package include a couple of tools which is installed at /opt/cisco. Although I'm not using this driver, I could use these tools once the connection is established. For example, /opt/cisco/bin/acu displays a connection status somewhat graphically. This tool even has a firmware update functionality, although many people warn it's extremely dangerous to use due to its fundamental flaw.

On-screen display

I want to have an on-screen display feature when I pressed volume control buttons, or when I switch to the external display mode to do presentation. tpb is a program which enables ThinkPad special keys. xosd is required to use tpb. (You can get the source code from these websites and install them, or there are RPMs compiled for FC2 available too.) You may want to edit /usr/local/etc/tpbrc (or relevant configuration file) to change fonts, color, etc. (The default font used seems a little too small, so I recommend you set the OSDFONT value.) Once it is done, you can run it by just "/usr/local/bin/tpb &". (There are a number of command-line options too.)

MPlayer

If you want to use mplayer on Fedora, you might want to know a known problem of MPlayer on Fedora described here.

Suspend/hibernation

Suspend and hibernation are very important functions for a laptop PC. Although I could get them work, the approach I took was rather an old-fashioned one: using APM and BIOS. As a FC2 user, I hope to use modern power management features of kernel 2.6, but I haven't had luck so far. Anyway, my T40 successfully enter suspend mode on Fn+F4, and enter hibernation on Fn+F12 from KDE desktop environment. Devices such as wireless LAN and sound seem to recover correctly without special settings.

Suspend

Suspend/resume works out of box with the APM-enabled kernel. The default FC2 kernel seems to be compiled with an APM support, but ACPI overtakes it during the boot process. Therefore, you can re-enable APM by just disabling ACPI. The simplest way to do this is to add the "acpi=off" option to the end of the "kernel" line in /boot/grub/grub.conf.
   kernel /boot/vmlinuz-2.6.xxx ro root=LABEL=/ rhgb quiet acpi=off
Then reboot the system. You can check if APM is working by checking dmesg output.

Now the system should enter the suspend mode when you press Fn+F4. If you don't want the system to suspend when you closed the LCD, you need to change the option in the BIOS.

Hibernation

Hibernation was more difficult. Note that the method I used may be too risky to recommend to others.
  • Hibernation support by ThinkPad BIOS needs either a hibernation file on a (hidden) FAT partition, or a special hibernation partition. I ended up using the hibernation partition, because although I tried the hibernation file first, based on the information in Jason Merrill's page, the BIOS didn't seem to recognize my hibernation file. His page has links to the hibernation file tool as (1) utility diskette, (2) Windows program, and (3) Linux program. For a non-dualboot system without a floppy drive, (3) was my only choice. If your environment can use (1) or (2), it might work. Then you don't have to try the method I used.
  • Since I didn't have a floppy drive, I got a ISO image for creating a hibernation partition here. (Note: this image was created by someone outside of IBM. I just decided to trust the kind person who made this image available:) Burning this image to a blank CD-R makes a bootable hibernation utility.
  • There are several very important things you may want to know. (1) This tool seems to blow away MBR information very often, which is why I think this is risky. I didn't lose any data on existing partitions, but you should backup important data, and at least prepare to reinstall GRUB right after you created a hibernation partition as explained later. (2) The tool tries to create a hibernation partition as /dev/hda4, allocating the earliest available spaces in /dev/hda. Therefore, for preserving consistent partition table, you may want to create three partitions (1 - 3), leaving a disk space at the end of the disk before running this tool. This means that you can't use extended partitions. (3) The hibernation partition created by the tool has an ID 'a0'. The tool seems to have a function to detect an existing hibernation partition and reformat it. If this function works, the limitation of (2) should be eliminated by manually creating a hibernation partition with an appropriate size and ID (using fdisk etc.), then just reformatting it with the tool. Unfortunately, as far as I tried, the partition created with this approach was not recognized as a valid hibernation partition.
  • Below is the actual steps I took to make a successful hibernation partition.
    1. Boot from the partition utility CD. If should say that no existing hibernation partition is found.
    2. Choose "create a partition" from the menu. The tool displays the minimum size needed for the partition (which should be approximately the main memory size+ video memory size + alpha.) You must have enough free disk space.
    3. The tool creates the partition, format it, and write the necessary information. When it's done, you can remove the utility CD and reboot.
    4. In my experience, the MBR is likely to be broken, and the "missing operating system" message will appear! You need to recover MBR.
    5. Boot from the first Fedora Core 2 install CD. (You can burn it from the FC2 ISO image. Only the first CD is necessary. Or you can use other CD-bootable Linux such as Knoppix instead.) When you saw the prompt, enter "linux rescue" to enter the rescue mode. You should be able to see the root partition of your system mounted at /mnt/sysimage.
    6. The following commands should reinstall GRUB in MBR and reboot. (You can eject the FC2 install CD.)
      # chroot /mnt/sysimage
      # /sbin/grub-install /dev/hda
      # exit
      # exit
      
    7. Now the system should boot normally as it did before. You can enter the hibernation mode by pressing Fn+F12. It works great, except it's extremely slow.

Random freezing issue

After the initial installation, I suffered from an annoying freezing problem. It seemed to occurs just randomly - mostly once or twice per day. When it occurs, the system really freezes: the keyboard stops responding (except the power button for forced shutdown), mouse also freezes, and network was down (It didn't respond to ping or remote connection anymore.) It seems to occur more frequently when the pc is in idle, but it also seems to occur when using a browser (Firefox or Konquor).

Having system freeze so often is too painful - I was rather surprised this was happening on Linux. I really wanted to stop it before I ruin the harddisk after too many sudden system crashes.

After a few months, I seem to have conquered this problem. (I haven't experienced the freezing problem for a long time.) However, I don't know what exactly was causing the freeze. I suspect that multiple factors were involved: relative instability of 2.6 kernel, possible bugs in BIOS, X, device drivers, or even a hardware problem. After all, maybe the biggest factor is a lot of updates - including the kernel and X - contributed enhancing the stability most. Below is the summary of what I did other than upgrading packages. I leave this information here, but it is likely that some of them are no longer necessary. I haven't had a chance to revisit them and see if the system start freezing again.

Disabling power management

Several people seem to have similar freezing problems too. Their suggestion was to turn off power management functionalities.

I began this by disabling screen blank. The current Fedora desktop is very complex, and there are several separate mechanisms related. I just disabled everything I found related.

  • ThinkPad BIOS has power management settings. I turned off all functionalities following Fabrice Bellet's instructions.
  • Virtual console have screen blank timer enabled on by default. To disable this, I added the following to /etc/rc.d/rc.local.

    setterm -blank 0 -powersave off

    I also added 'setterm -blank 0' to ~/.bashrc just for safety.
  • X supports a DPMS power-saving functions.

    $ xset -dpms'

    disables this. Adding this line to ~/.xsession would work. Instead, I disabled dpms by editing /etc/X11/xorg.conf. Also in the "Monitor" section, I comment out the line Option "dpms".
  • If you are using KDE, display power control can be turned off from the "Control Center" utility. This may be the same as the dpms setting above, but I'm not sure yet.
  • Also in the KDE Control Center, "laptop battery" section has a power control tab. ACPI is not recognized active here, so I could set anything here.
  • An X built-in screensaver can be turned off by 'xset s off'.
  • A screensaver application such as xscreensaver should not be running. You can look at the process list by 'ps auxww' and kill it if necessary.
  • KDE screensaver can be turned off at the Control Center. I'm not sure how this is related to the two above.

I further changed the following settings related to power management.

  • I turned off ACPI, by adding "acpi=off" to the kernel line in /boot/grub/grub.conf. With the default FC2 kernel, APM is enabled instead. (As a side effect, suspend seems to work well with APM.) I stopped both acpid and apmd using chkconfig.
  • I disabled the cpuspeed daemon. As a result, CPU frequency is not controlled automatically anymore. (You can see this by 'cat /proc/cpuinfo'.) I'll come back to this issue once I get a system stable enough.
  • I disabled gpm. I heard vmware may act strangely without gpm, but I haven't experienced such problem so far.

DRI

I installed DRI software at here, just hoping it has positive effect on stability. The video card on my T40 is ATI Radeon Mobility 7500. General information on Linux support by ATI can be found here. DRI seems to work well now, although I'm not sure if it had nothing to do with the freezing issue. I just put this information for completeness.

Using Printers from Firefox/Mozilla on Department Unix Environment

Recent versions of Firefox and Mozilla support printing via the Xprint service. When I try to print from these browsers on my department junkfood unix environment, it fails with the following message. "There was a problem printing. No Xprint server(s) could be found. Check whether the XPSERVERLIST environment variable contains any valid Xprint servers. For further information see http://xprint.mozdev.org/ or http://www.mozilla.org/projects/xprint/". If you are having the same problem, here is how to solve it.

It turns out that the solution is found not in the links above, but this page in Sun's website. In short, you need to execute the following commands on the console.


$ /usr/openwin/bin/Xprt :nnn &
$ export XPSERVERLIST=localhost:nnn

where nnn is an arbitrary free display number. (The second line should be "setenv XPSERVERLIST localhost:nnn" if you are using csh/tcsh.) After that, launch a browser from that console, and the printing will work just fine.

Accessing Windows Directory from Remote

The department has a network drive (smb) available at \\asteria.cs.umd.edu. Windows home directories are accessible from the UNIX systems (via /fs/windows), but sometimes it would be useful if you can access your files with Explorer. Again this is what you can't do from outside without VPN.

The basic approach is to create a SSH connection which forwards an access to localhost:139 (netbios-ssn) to asteria.cs.umd.edu:139. However, this doesn't work well for the following reasons.

1. Port 139 is bound to Windows NetBIOS client by default, so SSH can't use this port unless you disable NetBIOS.
2. Even if you do so, you still can't access a network drive using Explorer because it also uses port 445. There is no way to make Windows release this port, so SSH can't use it. (smbclient only needs port 139, but the purpose here to use Explorer.)

Here I describe a method to avoid these problems. (This method was originally explained in this page written in Japanese.) It uses two additional components: Microsoft Loopback Adapter and stone (http://www.gcd.org/sengoku/stone/.) Microsoft Loopback Adapter is a virtual neetwork adapter included in standard Windows 2k/XP CD. Stone is an application-level TCP/IP repeater developed by H. Sengoku.

1. From control panel, choose "add hardware" and select Microsoft Loopback Adapter. ("Add new device"->"Choose from list"->"Network adapter"->"Microsoft"->"Microsoft Loopback Adapter")
2. Open the property of the Loopback Adapter in the local-area network. Remove all checks except TCP/IP. In the property of TCP/IP, Enter an IP address that is *different* from your actual LAN address. (Here I assume you have chosen 192.168.2.250 as the IP address and 255.255.255.0 as the netmask. This means your LAN must not be 192.168.2.0/24.) In the advanced setting, disable NetBIOS over TCP/IP.
3. Download the binary package of stone from here and extract it to your preferred location. In the command prompt window, run the following command.
> stone localhost:8139 192.168.2.250:139
Here I further assumed that you use port 8139 for port-forwarding. You can change it to any number. (Large number is recommended in general.) Leave this program open while you access network drives.
4. Begin port forwarding using the following command (more about SSH: here)
$ ssh -L 8139:asteria.cs.umd.edu.edu:139 (your username)@(dept unix hostname)
5. Now open Explorer, and enter "\\192.168.2.250" in the address bar. You'll be asked a username (use "umd-csd-nt\...") and a password, then you can access your Windows directory!

Using Netgear MA521 in Linux

Netgear MA521 802.11b Wireless PC Card is one of what you can buy at most inexpensive price. It works with no problem as long as you stay with Windows. However, once you install Linux on your PC and try to setup wireless, this card is not easy to get along with.

I collected some information on how to tackle this problem. First of all, if you haven't bought this card and are thinking about using Linux, you should buy something else. Below is for those who already has it.
Linuxant DriverLoader

Linuxant DriverLoader(http://www.linuxant.com/driverloader/) is excellent software which provides a very good solution. By using DriverLoader with the device driver for Windows, you can easily use MA521 card on Linux x86 platforms.

Unfortunately, DriverLoader is not free. You can try a trial version for free, but after 30 days you need to pay $19.95 to continue using it. The price may be reasonable, but you could buy a LAN card that is fully supported by Linux if you had additional $20 in the first place.

I installed a trial version on RedHat 9, and it worked perfectly. I could setup a SSID and a WEP key with iwconfig command.

Using a 8180L driver

Realtek (http://www.realtek.com.tw/) provides a Linux driver for the 8180L chip, which MA521 is using. You can download it from here. The following pages has good tips on how to setup Linux using this driver.

* http://www.coryonline.com/cgi-bin/more.cgi?20031230133142.WiFi.Cory
* http://www.alumni.caltech.edu/~rbell/Realtek8180.html

As explained in the sites above, this doesn't work as well as DriverLoader. The interface is not compativle with the latest architecture, so you can't use iwconfig. Instead you need to directly manipulate the driver using iwpriv. And still I couldn't get it work.

Printing via Remote Access

The instructions on the department website provide a good documentation of the current department printing system. As for printing from unsupported machines (which is of interest here), http://www.cs.umd.edu/faq/cups.html describes three possible approaches. Here I focus on using the following method as a basis.

Add Printer under the Printers folder in the Control Panels. Select Network Printer and then select "Connect to a printer on the Internet or on your Intranet" where you can put in: http://printer.cs.umd.edu/printers/(printer)

Of course this method only works with VPN when connecting from outside or from wireless network, and this is where SSH comes in. Actually this is very easy. All you have to do is to create a SSH connection which forwards an access to printer.cs.umd.edu:80 via a department unix host.

1. Begin port forwarding using the following command (more about SSH: here)


$ ssh -L xxxx:printer.cs.umd.edu.edu:80 (your username)@(dept unix hostname)

where xxxx is an arbitrary port number used for forwarding. Large random number (such as 20080, 31294, etc) is recommended. Keep this SSH session during the installation process.
2. Add Printer under the Printers folder in the Control Panels. Select Network Printer and then select "Connect to a printer on the Internet or on your Intranet". This time you put in:
http://127.0.0.1:xxxx/printers/(printer)
(xxxx must be the same port number you used in the previous step.)
3. Then follow the rest of the installation process. In my case, I could add ps4a and ps4b, but I couldn't add ps4 because of "driver not found" error.
4. Once the installation is completed, you can close the current SSH connection if necessary. When you print to a department printer, you need to connect using the same command you used in step 1 before sending a job to the printer.

Last Updated $Date: 2004/02/13 05:39:07 $ GMT

Remote Access to Department Computer Resources

When you are connecting to the department network from home, or accessing via wireless connection, you have a limited access to their resources. The department recommends the use of the VPN service, but it's not a very good solution for me, as the other VPN software I need to use for other purpose seems to conflict with the university VPN client.

Below is a brief description of how to access a number of department resources without using the department VPN client. All content is for Windows environmentso far, although some techniques are also useful in other platforms. Note that all methods are based on the use of SSH port-forwarding. Although this is a very powerful approach, it doesn't completely replace what the VPN software does. In particular, it doesn't automatically encrypt all the communications for the university network.


SSH Port-forwarding

SSH has a function to forward arbitrary TCP/IP ports over the secure secure channel. There are thousands of documents on how it works. (eg. an easy tutorial in ssh.com is found here)

Here I focus on how to use it on PC. All you need is a SSH client which supports port forwarding. OpenSSH is a free version of SSH implementation, primarily for BSD and other Unix-style platforms. Cygwin, a collection of Linux-like tools for Windows, provides the OpenSSH binary that works on Windows, so I assume the use of OpenSSH.

OpenSSH is a nice old-fashioned text-based program. There are a lot of GUI ssh clients for Windows: ttssh, putty, etc. I believe many of they them support port forwarding, although I don't know much about them.

Using OpenSSH, you can do remote login with the following command.


$ ssh (your username)@(remote hostname)

Then you are usually asked a password (or a passphrase).

On the other hand, when you use port-forwarding, you need to add -L option.


$ ssh -L xxxx:(third hostname):yyyy (your username)@(remote hostname)

Here, xxxx and yyyy are digits to describe port numbers. As a result, the following happens.

- If a program on your PC accesses localhost:xxxx, ssh forwards it to (third hostname):yyyy. By default, only a local program can connect to localhost:xxxx.
- When the program on the (third host) accepts the access, it recognizes that this connection came from the remote host, not your PC.

Note that the communication between the (remote host) and the (third host) is not secure.