Thursday, July 10, 2008

wireless in ubuntu

I changed to Ubuntu for no reason. Just want to try something different. It turns out to be a happy (and easy) change. The only thing hit on me was the wireless network. It couldn't "easily" (I mean, with a lot of my help, it could) find hidden wireless access point. But University only give me hidden wireless. A little bit search lead me to the following solution:
install wicd. google wicd will show you everything.

It is simple again. I like it.

Oh, one more thing, ubuntu is an OS and only an OS. It has not many software come with it. If you are a researcher, like me, you need to install (it is easy though) all softwares that you need. A short list for me:

gnuplot
vim (the default one is too basic)
xifg
compiz-fusion (for amusing your windows friends, maybe not anymore with vista)
pdftk
. . .

Sunday, June 29, 2008

Difference of "change line mark" between windows and unix

In unix, line ends with a new line charactor, i.e. 0x0a.

In DOS/Windows line ends with a carriage return and new line pair, i.e.
0x0d0a.

In your case, every line ended with a carriage return, i.e. 0x0d, which is
displayed as '^M' in vi.

You need to replace every '^M' to new line in vi with the following command:

:%s/^M/\r/g

Note: ^M is entered as pressing 'v' and 'm' while holding 'Ctrl'.

OR :%s:\r:\r:g

Tuesday, June 17, 2008

save time on startup in Fedora

Turning off network service can save some time in startup process in Fedora especially laptops.

How-to:
1. go to System -> Administration -> Services
2. turn off 'Network' service on all run levels.
3. DONE.

Next time when you boot up, you will notice the system stop checking network devices like eth0, wlan01 . . . This is good for laptops which frequently check network access points.

Monday, May 19, 2008

ATI driver for Fedora

http://forums.fedoraforum.org/showthread.php?t=155503&page=1&pp=10

So far, ati cards are not supported.

Friday, May 9, 2008

Vim Tip: Mutliple windows and vimdiff

Vim Tip: Mutliple windows and vimdiff

Using multiple windows in VIM is a great way to do side-by-side editing, comparison and cut-and-paste (yank-and-put). Unlike other editors, you can do all this with your hands on home row. Learning to use multiple windows will also help you make better use of the built in :help, and also makes it easy to learn a powerful file comparison tool: vimdiff.

To open a file in a new window, use either ":split filename" or ":vsplit filename". vsplit is nice when you can devote an extra-wide window to VIM. If you leave of the filename argument, the split will be performed on the file you are already editing.

Navigating between windows is simple. Every window command starts with a "ctrl-w". Then you can move between windows with h,j,k,l or the arrow keys as you would normally move between lines. Some other useful window commands are:
ctrl-w c - Close this window
ctrl-w o - close all Other windows (mnemonic - Only)
ctrl-w 5+ - increase this window size by 5 lines
ctrl-w 5- - decrease this window size by 5 lines

With these window commands, we're ready to use "vimdiff". Start vimdiff from the command line:
% vimdiff a.txt b.txt
Vim will open the two files in "vsplit" mode, and will highlight differences between the two. I have attached an example of this. There are just a few more commands that are needed to be proficient with vimdiff:
do - (diff-obtain) obtain differences from other window into this one
dp - (diff-put) push differences in current window to the other window
zo - open a block of folded text

Monday, April 28, 2008

ifconfig

In linux, check network hardware information:
/sbin/ifconfig

ifconfig

In linux, check network hardware information:
/sbin/ifconfig

Friday, March 21, 2008

How to change default gnome-term size?

I found this on internet. Just want to paste here for further reference. Hope this link to original post alway works so that people knows to where the credit should be granted.

gnome-terminal is an xterm emulator, and it follows a termcap file for this. I don't know anything about termcaps, but the file can be found in
/usr/share/vte/termcap/xterm
on Fedora (I think). Anyway, there's a lot of stuff in this file you probably don't want to touch, but you can change the line that describes the terminal geometry:

xterm-xfree86|xterm-new|xterm terminal emulator (XFree86):\
:am:km:mi:ms:xn:\
:co#80:it#8:li#24:\

:co#80 specifies 80 columns, and li#24 specifies 24 lines. Change this to 120 and 30 or whatever you want. Now all terminals should open for this default size.

Monday, March 17, 2008

Thursday, February 21, 2008

Install Fedora 8 in Thinkpad T60

The whole process was extremely simple and smooth. You can find a lot information about how-to install Fedora on laptops. The following are some information that I found are quite useful but missed in standard installation instructions.

  1. Install ATI driver and enable compiz-fusion
  2. Install pdftk
  3. Install Mac4lin
  4. Enable full function of Keyboard
  5. Power management 'acpi' configuratio
OK, I am going to start with step 4, since step 1,2 and 3 were already done. I'll add these steps when I have spare time which I rarely have :-(
  1. n/a
  2. n/a
  3. n/a
  4. IBM hotkeys
    First, make sure you have the thinkpad-acpi module loaded (which you
    should):
    lsmod | grep thinkpad (look for thinkpad-acpi in the output)
    By default, FC7 will switch to low power mode when the lid is
    closed. I don't like that. I simply want the screen turned off
    when the lid is closed and back on when it's open. To do this,
    follow these steps:
    a. Go to /etc/acpi/events/
    b. Edit a-lid-aticonfig.conf and comment out the line
    that start with event= (Add a #-symbol at
    the beginning of that line). This will disable the
    default lid behavior
    c. Add the following line at the end of the file:
    action=/etc/acpi/actions/lid
    (This will redirect the event to our own custom script)
    d. Go to /etc/acpi/actions/
    e. Create a file named lid with the following lines:
    #!/bin/bash
    # Check LID state
    export XAUTHORITY=/var/gdm/\:0.Xauth
    if grep -q open /proc/acpi/button/lid/LID/state
    then
    /etc/acpi/actions/screen_on.sh
    else
    /etc/acpi/actions/screen_off.sh
    fi
    f. Create a file screen_on.sh with
    #!/bin/sh
    /usr/bin/xset -display :0 dpms force on
    g. Create a file screen_off.sh with
    #!/bin/sh
    /usr/bin/xset -display :0 dpms force off
    h. Set proper permissions
    chmod 755 lid
    chmod 755 screen_on.sh
    chmod 755 screen_off.sh

    Additionally, I like to be able to switch on and off the screen
    by pressing Fn+F3. To do this we first have to enable the IBM
    hotkeys by doing:
    echo enable > /proc/acpi/ibm/hotkey
    This will signal your laptop to generate acpi events whenever
    Fn+F3 (or any other Fn+FX key combination) is pressed. Include
    the line above in your /etc/rc.d/rc.local so that it is enabled
    at boot time. Now we have to create handlers for the Fn+F3
    hotkey. Go to /etc/acpi/events/ and create the file FnF3.conf
    # ACPI Configuration to execute action when pressing Fn+F3
    event=ibm/hotkey HKEY 00000080 00001003
    action=/etc/acpi/actions/FnF3.sh

    Now go to /etc/acpi/actions/ and create FnF3.sh, as follows
    #!/bin/bash
    export XAUTHORITY=/var/gdm/\:0.Xauth
    # Check if working on single or dual mode
    Mode="single"
    LCDgrep=`aticonfig --query-monitor | grep Connected | grep lvds`
    CRTgrep=`aticonfig --query-monitor | grep Connected | grep crt1`
    if [ "$LCDgrep" != "" ] && [ "$CRTgrep" != "" ]; then
    Mode="dual"
    fi
    if [ $Mode == "single" ]; then
    # Turn off screen
    /etc/acpi/actions/screen_off.sh
    else
    # Cycle screens
    /etc/acpi/actions/FnF3_dual.sh
    fi

    This will check if we're working on the LCD screen alone (single
    mode) or if we have both the screen and an external monitor
    connected (dual mode). If it's single mode, Fn+F3 will simply
    turn off the screen. If it's dual mode, then Fn+F3 will cycle
    between various states when the LCD and the monitor are
    alternatively turned on and off. For this scheme to work, you
    need the following FnF3_dual.sh file in /etc/acpi/actions/:

    #!/bin/bash
    # Cycle turning on/off monitors

    LCD="off"
    CRT="off"
    LCDgrep=`aticonfig --nobackup --query-monitor | grep Enabled | grep lvds`
    if [ "$LCDgrep" != "" ]; then
    LCD="on"
    fi
    CRTgrep=`aticonfig --nobackup --query-monitor | grep Enabled | grep crt1`
    if [ "$CRTgrep" != "" ]; then
    CRT="on"
    fi

    echo "LCD screen is $LCD. External screen is $CRT"

    if [ "$LCD" == "on" ] && [ "$CRT" == "on" ]; then
    # Turn on external monitor and off LCD
    echo "Turning off LCD, keeping external screen on"
    /usr/bin/aticonfig --nobackup --enable-monitor=crt1
    fi

    if [ "$LCD" == "off" ] && [ "$CRT" == "on" ]; then
    # Turn on LCD and off external monitor
    echo "Turning LCD on and external screen off"
    /usr/bin/aticonfig --nobackup --enable-monitor=lvds
    fi

    if [ "$LCD" == "on" ] && [ "$CRT" == "off" ]; then
    # Turn off external monitor and LCD
    echo "Turning off both LCD and external screen"
    /usr/bin/aticonfig --nobackup --enable-monitor=crt1,lvds
    /etc/acpi/actions/screen_off.sh
    fi

    if [ "$LCD" == "off" ] && [ "$CRT" == "off" ]; then
    # Turn on external monitor and LCD
    echo "Turning on both LCD and external screen"
    /usr/bin/aticonfig --nobackup --enable-monitor=crt1,lvds
    fi

    Don't forget to set appropriate permissions for these files:
    chmod 755 FnF3.sh
    chmod 755 FnF3_dual.sh


    Now let's create a suspend event and action script. Go to
    /etc/acpi/events/ and create this FnF4.conf file:
    # ACPI Configuration to execute action when pressing Fn+F4
    event=ibm/hotkey HKEY 00000080 00001004
    action=/etc/acpi/actions/suspend.sh
    Now put this script in /etc/acpi/actions/suspend.sh
    #!/bin/sh

    # remove USB 1.1 driver
    rmmod uhci_hcd

    # sync filesystem and clock
    sync
    /sbin/hwclock --systohc

    # switch to console
    FGCONSOLE=`fgconsole`
    chvt 6
    #/usr/sbin/radeontool light off
    /usr/sbin/vbetool dpms suspend

    # go to sleep
    #sleep 5 && echo -n "mem" > /sys/power/state
    echo -n "mem" > /sys/power/state

    # readjust the clock (it might be off a bit after suspend)
    /sbin/hwclock --adjust
    /sbin/hwclock --hctosys

    And set execute permissions with
    chmod 755 suspend.sh

    WARNING: At the time of writing this there seems to be a bug
    in the current kernel version 2.6.22 that makes my computer freeze
    during suspend. If you do a echo -n "mem" > /sys/power/state it
    freezes after the "Suspending console(s)" message. One can only hope
    that this will get fixed soon and then suspend will work again.Disable horizontal scrolling in the touchpad to act like BACK
    button in Firefox:

    Open Firefox and type about:config in the URL window
    In the filter field, enter mousewheel
    Set
    mousewheel.horizscroll.withnokey.action to 0
    mousewheel.horizscroll.withnokey.sysnumlines to true

Install Fedora 7 on Thinkpad t60

I found this from here. Just paste in my blog for future reference. Actually, I installed Fedora 8 in my Thinkpad T60 without any problems. With compiz-fusion on, this is an amazing computer. I love it.

MAKE YOUR T60p WORK UNDER FEDORA 7 (FC7)
(Document version: 2007-Jul-21)

This tutorial/howto is still under construction. If you have
suggestions to improve it, please e-mail me at navarro*ucar.edu
(replacing the asterisk with the @-symbol)

Important Note: Have SELinux disabled for the procedures below to work!!!
To disable SELinux edit /etc/selinux/config, look for the line
containing SELINUX= and set it to
SELINUX=disabled


It is recommended that you update your BIOS to the most recent version
from the Lenovo website:
http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-63024

Become root

1. Fix your ethernet board driver

This will give you a lot of headaches if you don't fix it right
away. The funny thing is.. the fix is so simple.
If you boot without a network ehternet cable plugged in, the
ethernet driver e1000 will some times fail to initialize
dropping the following error on /var/log/messages: e1000:
0000:02:00.0: e1000_probe: The EEPROM Checksum Is Not Valid. If
you're having this problem, consider upgrading the BIOS of your
laptop with a recently released version at the Lenovo website
above (this didn't work for me, by the way, but apparently it
fixed the problem for some people with other Thinkpads). A
quick-and-dirty workaround is to set the Internal Network Device
to Hidden in the BIOS, reboot, go back to the BIOS and re-enable
the device. Finally, plugging in the ethernet cable and
reloading the e1000 module (modprobe -r e1000 ; modprobe e1000)
or rebooting will also fix the problem.

However, I've found that the best way to get everything working
like a breeze is to disable the Interrupt Throttle Rate option
when loading the e1000 driver. Simply add this line to your
/etc/modprobe.conf file:

options e1000 InterruptThrottleRate=0,0


2. First update everything by running
yum update

(Go get some coffee, this will take a while)

3. Configure yum to use some external repositories (atrpms and livna)

rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms
Add the following lines to /etc/yum.conf
[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/f$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1

wget http://rpm.livna.org/livna-release-7.rpm
rpm -i livna-release-7.rpm
rm livna-release-7.rpm

4. Install yumex, emacs, gv, xfig, sshfs, acroread, xine & mplayer (this step
is optional, but make sure you install at least yumex)

yum install yumex
yum install emacs
yum install xine
yum install gv
yum install xfig
yum install mplayer
yum install fuse-sshfs

NOTE: For fuse to work I had to change the following permissions:
chown root /usr/bin/fusermount
chmod u+s /usr/bin/fusermount

NOTE: mplayer and xine (and perhaps other packages) exhibit
incompatibilities between the livna and the freshrpms
repositories. Use one or the other but make sure you don't mix
them.

Install codecs: Some interesting codecs (in particular the win32
ones) are not installed by default. This is especially important
if, like me, you want to be able to listen to Cadena Ser live.

mkdir /usr/lib/win32
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/all-20061022.tar.bz2
tar xvfj all-20061022.tar.bz2
cp ./all-20061022/* /usr/lib/win32/
chmod 755 /usr/lib/win32/*
rm -rf ./all-20061022


5. Install driver for wifi card

(This assumes kernel version is 2.6.21-1.3194.fc7. You may need adjustments for newer versions)

yumex &
Click repos
Make sure the atrpms repository is checked. If not, check it.
Get the following packages:
ieee80211-1.2.16-18.fc7.i386.rpm
ieee80211-kmdl-2.6.21-1.3194.fc7-1.2.16-18.fc7.i686.rpm
ipw3945-1.2.0-18.3.fc7.i386.rpm
ipw3945d-1.7.22-4.i386.rpm
ipw3945-kmdl-2.6.21-1.3194.fc7-1.2.0-18.3.fc7.i686.rpm
ipw3945-ucode-1.14.2-4.at.noarch.rpm

Remove iwl3945

Reboot computer (not sure if this is necessary)
depmod -a
modprobe ipw3945
dmesg | grep ipw (to check that the driver works)
lsmod | grep ipw3945 (to check its loaded)
/sbin/ipw3945d (to start the daemon)

Add the following line to /etc/rc.local
/sbin/ipw3945d

The wifi card will not always work properly unless you have fixed
the eth0 problem (see section 1 above). You've been warned. Even
so, some times the wifi card gets in a funny state with the led
blinking very rapidly. I think this issue is still related to the
problem with the ethernet card, as plugging a cable will make the
wifi card "snap out of it" immediately. I wrote a little script
to reinitialize both drivers and it seems to take care of this
occasional problem:

/sbin/modprobe -r e1000
/sbin/modprobe e1000
/sbin/modprobe -r ipw3945
/sbin/modprobe ipw3945
/sbin/ipw3945d --kill
/sbin/ipw3945d

Note: The ipw3945 and ieee80211 kernel modules (kmdl) packages
need to match the kernel version that you are using. If they are
not available you may have to wait until they're built for a
recently released kernel or go ahead and prepare a package
yourself. For instructions on how to do this, check:
http://www.fedoraforum.org/forum/showthread.php?t=126183

Optional:
The ipw3945 module in the atrpms repository has the monitor
option disabled. If you want to enable this option, e.g. to use
with kismet or other sniffing programs, it's not
difficult. First, get the source package from atrpms:
yum install ipw3945-1.2.0-18.4.src
Then go to
/usr/src/redhat/SOURCES/ipw-*/
Edit the Makefile and uncomment the line with
CONFIG_IPW3945_MONITOR=y
make
cp ipw3945.ko /lib/modules/2.6.22.9-91.fc7/updates/drivers/net/wireless/
(the kernel version might be different)
When you install kismet, edit the /etc/kismet/kismet.conf and
enter the correct source information:
source=ipw3945,eth0,Intel
(use eth0 or eth1 depending on your configuration)


6. ATI video driver
The VESA driver used by default is extremely slow (check, e.g.
stellarium that you can install with yumex). ATI has proprietary
drivers that can be installed as follows:
With yumex install kmod-fglrx and livna-config-display (you may
need to enable the livna-testing repository). I also had to
install compat-libstdc++-33 to make it work.
Run livna-config-display
Restart your computer
Run stellarium again or glwheels and notice how smooth the scroll
is now

Note: The fglrx kernel module (kmdl) package needs to match the
kernel version that you are using. If it is not available you
may have to wait until it's built for a recently released
kernel or go ahead and prepare a package yourself. For
instructions on how to do this, check:
http://www.fedoraforum.org/forum/showthread.php?t=126183
Here's how I did it for my version:
cd
echo '%_topdir %(echo $HOME)/rpmbuild' > .rpmmacros
mkdir rpmbuild
cd rpmbuild
mkdir /usr/src/redhat
cp -a /usr/src/redhat/* .
yum install fedora-rpmdevtools rpm-build mock
yum install rpmdevtools
yum install kernel-devel-2.6.21-1.3194.fc7
wget http://livna-dl.reloumirrors.net/fedora/7/SRPMS/fglrx-kmod-8.38.7-2.2.6.21_1.3228.fc7.src.rpm
rpm -ihv *.src.rpm
emacs ~/rpmbuild/SPECS/fglrx-kmod.spec
(change the kversion line to 2.6.21-1.3194.fc7)
rpmbuild -ba SPECS/fglrx-kmod.spec --target=i686 --define 'kvariants ""'
yum install livna-config-display xorg-x11-drv-fglrx xorg-x11-drv-fglrx-devel
rpm -i RPMS/i686/kmod-fglrx-8.38.7-2.2.6.21_1.3194.fc7.i686.rpm


7. Sound
Another problem I found is that the audio device can be accessed
only by root and whoever is logged on to the X server. I wanted
to grant all users access to the audio device. To do this, go to
the Gnome menu -> System -> Administration -> Users and Groups,
add a group named audio and then add all relevant users to that
group. Then edit /etc/rc.d/rc.local and add the following lines:
chgrp audio /dev/snd
chgrp audio /dev/snd/*
Restart (or simply run those lines manually as root)

Some applications, such as mplayer, allow you to use esd as the
output device. Make sure that esd is running with
ps -fea | grep esd
If it's not, just launch it as root. Then any user can do
mplayer -ao esd file.mp3

Note: Do not disable (hide) the modem in the bios
setup. Otherwise the sound card gets disabled too.

Make festival use the ALSA driver (so it can be mixed with other
sounds):
*Create a ~/.festivalrc file containing the following lines
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)


8. IBM hotkeys
First, make sure you have the thinkpad-acpi module loaded (which you
should):
lsmod | grep thinkpad (look for thinkpad-acpi in the output)
By default, FC7 will switch to low power mode when the lid is
closed. I don't like that. I simply want the screen turned off
when the lid is closed and back on when it's open. To do this,
follow these steps:
a. Go to /etc/acpi/events/
b. Edit a-lid-aticonfig.conf and comment out the line
that start with event= (Add a #-symbol at
the beginning of that line). This will disable the
default lid behavior
c. Add the following line at the end of the file:
action=/etc/acpi/actions/lid
(This will redirect the event to our own custom script)
d. Go to /etc/acpi/actions/
e. Create a file named lid with the following lines:
#!/bin/bash
# Check LID state
export XAUTHORITY=/var/gdm/\:0.Xauth
if grep -q open /proc/acpi/button/lid/LID/state
then
/etc/acpi/actions/screen_on.sh
else
/etc/acpi/actions/screen_off.sh
fi
f. Create a file screen_on.sh with
#!/bin/sh
/usr/bin/xset -display :0 dpms force on
g. Create a file screen_off.sh with
#!/bin/sh
/usr/bin/xset -display :0 dpms force off
h. Set proper permissions
chmod 755 lid
chmod 755 screen_on.sh
chmod 755 screen_off.sh

Additionally, I like to be able to switch on and off the screen
by pressing Fn+F3. To do this we first have to enable the IBM
hotkeys by doing:
echo enable > /proc/acpi/ibm/hotkey
This will signal your laptop to generate acpi events whenever
Fn+F3 (or any other Fn+FX key combination) is pressed. Include
the line above in your /etc/rc.d/rc.local so that it is enabled
at boot time. Now we have to create handlers for the Fn+F3
hotkey. Go to /etc/acpi/events/ and create the file FnF3.conf
# ACPI Configuration to execute action when pressing Fn+F3
event=ibm/hotkey HKEY 00000080 00001003
action=/etc/acpi/actions/FnF3.sh

Now go to /etc/acpi/actions/ and create FnF3.sh, as follows
#!/bin/bash
export XAUTHORITY=/var/gdm/\:0.Xauth
# Check if working on single or dual mode
Mode="single"
LCDgrep=`aticonfig --query-monitor | grep Connected | grep lvds`
CRTgrep=`aticonfig --query-monitor | grep Connected | grep crt1`
if [ "$LCDgrep" != "" ] && [ "$CRTgrep" != "" ]; then
Mode="dual"
fi
if [ $Mode == "single" ]; then
# Turn off screen
/etc/acpi/actions/screen_off.sh
else
# Cycle screens
/etc/acpi/actions/FnF3_dual.sh
fi

This will check if we're working on the LCD screen alone (single
mode) or if we have both the screen and an external monitor
connected (dual mode). If it's single mode, Fn+F3 will simply
turn off the screen. If it's dual mode, then Fn+F3 will cycle
between various states when the LCD and the monitor are
alternatively turned on and off. For this scheme to work, you
need the following FnF3_dual.sh file in /etc/acpi/actions/:

#!/bin/bash
# Cycle turning on/off monitors

LCD="off"
CRT="off"
LCDgrep=`aticonfig --nobackup --query-monitor | grep Enabled | grep lvds`
if [ "$LCDgrep" != "" ]; then
LCD="on"
fi
CRTgrep=`aticonfig --nobackup --query-monitor | grep Enabled | grep crt1`
if [ "$CRTgrep" != "" ]; then
CRT="on"
fi

echo "LCD screen is $LCD. External screen is $CRT"

if [ "$LCD" == "on" ] && [ "$CRT" == "on" ]; then
# Turn on external monitor and off LCD
echo "Turning off LCD, keeping external screen on"
/usr/bin/aticonfig --nobackup --enable-monitor=crt1
fi

if [ "$LCD" == "off" ] && [ "$CRT" == "on" ]; then
# Turn on LCD and off external monitor
echo "Turning LCD on and external screen off"
/usr/bin/aticonfig --nobackup --enable-monitor=lvds
fi

if [ "$LCD" == "on" ] && [ "$CRT" == "off" ]; then
# Turn off external monitor and LCD
echo "Turning off both LCD and external screen"
/usr/bin/aticonfig --nobackup --enable-monitor=crt1,lvds
/etc/acpi/actions/screen_off.sh
fi

if [ "$LCD" == "off" ] && [ "$CRT" == "off" ]; then
# Turn on external monitor and LCD
echo "Turning on both LCD and external screen"
/usr/bin/aticonfig --nobackup --enable-monitor=crt1,lvds
fi

Don't forget to set appropriate permissions for these files:
chmod 755 FnF3.sh
chmod 755 FnF3_dual.sh


Now let's create a suspend event and action script. Go to
/etc/acpi/events/ and create this FnF4.conf file:
# ACPI Configuration to execute action when pressing Fn+F4
event=ibm/hotkey HKEY 00000080 00001004
action=/etc/acpi/actions/suspend.sh
Now put this script in /etc/acpi/actions/suspend.sh
#!/bin/sh

# remove USB 1.1 driver
rmmod uhci_hcd

# sync filesystem and clock
sync
/sbin/hwclock --systohc

# switch to console
FGCONSOLE=`fgconsole`
chvt 6
#/usr/sbin/radeontool light off
/usr/sbin/vbetool dpms suspend

# go to sleep
#sleep 5 && echo -n "mem" > /sys/power/state
echo -n "mem" > /sys/power/state

# readjust the clock (it might be off a bit after suspend)
/sbin/hwclock --adjust
/sbin/hwclock --hctosys

And set execute permissions with
chmod 755 suspend.sh

WARNING: At the time of writing this there seems to be a bug
in the current kernel version 2.6.22 that makes my computer freeze
during suspend. If you do a echo -n "mem" > /sys/power/state it
freezes after the "Suspending console(s)" message. One can only hope
that this will get fixed soon and then suspend will work again.


9. NetworkManager

I couldn't make NetworkManager work on my system until I realized
that I didn't have a notification area in my Gnome panel. It turns
out that network manager was indeed working but the applet didn't
show up. If you have the same issue, simply right-click on the menu
bar and add a notification area.




Things I don't really care about and haven't implemented yet in Linux

*Fingerprint scanner: I can type my password faster than I scan
my fingerprint
*Bluetooth/IR Port



Things that don't seem to work (meaning, I haven't been able to figure
out)

*Can't seem to write DVD+RW disks. Writing to DVD+R and -R
works, though (tried with xcdroast and using cdrecord from the
command line). Need to test if this is a Linux specific issue
or a hardware problem by trying to burn DVD+RW with
Windows. Also, haven't tried DVD-RW yet.



Some other nice (IMHO) customizations

1. Boot showing details in text mode

Edit /boot/grub/grub.conf and remove the "rhgb" part from the
kernel options

2. Automatically log in a user after a given interval

WARNING: This is a blatant security risk. If your laptop gets
stolen, anyone could potentially gain access to your data. So
doing this is strongly discouraged (on the other hand, if you
aren't using an encrypted filesystem, having your laptop stolen
will get you in trouble anyway)

Go to System -> Administration -> Login screen -> Security
Check the box "Enable Timed Login"
Type in the username and select the time ("Pause before login:")

3. Disable double-tap to click on the TouchPad

Edit /etc/X11/xorg.conf, go to the block
Section "InputDevice"
Identifier "Synaptics"
...

and add the following line in this block:
Option "MaxTapTime" "0"


4. Install MicroSoft True Type Fonts

Download the msttcorefonts rpm from
http://www.mjmwired.net/resources/mjm-fedora-fc5.html#ttf
rpm -ivh msttcorefonts-2.0-1.noarch.rpm
Reboot

5. mplayer/xine
To select the internal DVD/CD combo drive, open the menu and go to
preferences -> misc and set both devices to /dev/hda
(Note: Do the same for xine, under Settings -> Media)

6. Install xv

yum install libpng10
Download xv rpm from http://www.trilon.com/xv/downloads.html
rpm -i xv-3.10a-13.i386.rpm

7. Enable bell sounds through PC speaker

modprobe pcspkr

Install it in /etc/rc.d/rc.local if you wish to have this by
default. Personally, I find this annoying and the only bell I'm
interested in hearing is the system shutdown. So I edited the
/etc/rc.d/init.d/halt script and put the modprobe command at
the beginning of the script and a
echo -e "\a"
line near the end just before the exec $command line.

8. Disable horizontal scrolling in the touchpad to act like BACK
button in Firefox:

Open Firefox and type about:config in the URL window
In the filter field, enter mousewheel
Set
mousewheel.horizscroll.withnokey.action to 0
mousewheel.horizscroll.withnokey.sysnumlines to true

9. Enable flash and java plugins in mozilla

wget http://linuxdownload.adobe.com/adobe-release/adobe-release-1.0-0.noarch.rpm
rpm -i adobe-release-1.0-0.noarch.rpm
yum install flash-plugin
rpm -e adobe-release-1.0-0.noarch.rpm
Test flash at youtube.com

Download the corresponding file from http://java.sun.com/j2se/1.5.0/download.jsp
chmod 755 jre-1_5_0_12-linux-i586-rpm.bin
./jre-1_5_0_12-linux-i586-rpm.bin
ln -s /usr/java/jre1.5.0_12/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
Test it at http://www.java.com/en/download/installed.jsp
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre1.5.0_09/bin/java 1509

10. You can import your old printer(s) definitions by overwriting
the /etc/cups/printers.conf file, the /etc/cups/ppd/ directory and
then restarting cups with /etc/init.d/cups restart

11. Oh, and if you also find that puplet thing as annoying as I do,
simply use yum to uninstall pirut.

12. USB devices can be accessed by root only. I ran into this problem
while trying to import pictures from my camera with gthumb-import.
To solve this annoyance, edit /etc/udev/rules.d/50-udev.rules
Look for the line with
ACTION=="add", SUBSYSTEM=="usb_device", \
and change MODE="0644" to MODE="0666"

13. Install beryl and Xgl
Edit /etc/X11/xorg.conf and add these sections at the end

# For beryl
Section "ServerFlags"
Option "AIGLX" "off"
EndSection

Section "DRI"
Mode 0666
EndSection
# For beryl
Section "ServerFlags"
Option "AIGLX" "off"
EndSection

Section "DRI"
Mode 0666
EndSection
Install XGL, compiz and beryl ( install script by nicofo ) by doing:
wget http://nicofo.tuxfamily.org/scripts/xgl/installXGL_EN
sh installXGL_EN

rpm -e kmod-fglrx xorg-x11-drv-fglrx xorg-x11-drv-fglrx-devel
yum install kmod-fglrx xorg-x11-drv-fglrx xorg-x11-drv-fglrx-devel

Reboot. In the login screen choose GNOME+XGL.
Go to the Gnome menu->System->Preferences->XGL window manager and
select Beryl
Go to Menu->System tools->Beryl manager to dock an applet in the
notifications area. Select emerald as your window decorator
Remember that you can run non-Xgl applications by using:
noXgl command or noXgl -a command (to add a border to it)
In particular, add noXgl to the aticonfig commands above

Beryl tips:
To make IDL windows always opaque go to Window Management->
Click on "Set Window Attr by Various Criteria"->Rules->
Window Opacity and add the following rule:
t:idl ?:100

Some of the information provided here has been blatantly ripped from
various online sources, including:

http://www.linuxquestions.org/questions/showthread.php?t=436357
http://www.fedorafaq.org/
http://michael-prokop.at/blog/2006/07/02/thinkpad-t60-laptop-with-debiangrml-linux/
http://www.thinkwiki.org/wiki/Problem_with_e1000:_EEPROM_Checksum_Is_Not_Valid
http://www.ces.clemson.edu/linux/nm.shtml
http://www.gagme.com/greg/linux/fc6-tips.php
http://www.fedoraforum.org/forum/showthread.php?t=155503&page=1&pp=15