piyo's computer tips
2003/09/24
Unix: setting a trap in bash

To define a trap that will kill arbitrary processes. For example, you create a "cat" process that runs in the background and when you press Control-C (SIGINT), you want that cat process to be killed.

Place the following at the top of the script.

trap 'cleanup' EXIT
cleanup () {
killall cat
echo killall cat
}

 
2003/09/23
Linux: upgrading to Redhat Linux 9 from RL 7.3 or 8 using apt-get

...To update via apt-get, first change "8.0" to "9" in /etc/apt/sources.list. Next, make sure you are not logged in via the GUI, but rather logged out and using just the command-line login. ... Then, continue with these commands as root:

# apt-get update
# apt-get install rpm apt openssl096b openssl rpm-python

If it asks you to type "Yes, do as I say!" please enter in that phrase. Continue with:

# apt-get install coreutils
# apt-get upgrade
# apt-get install kernel-pcmcia-cs#1:3.1.31-13 kernel#2.4.20-18.9 sulinux-aptconfig
# apt-get dist-upgrade
(consider rebooting/testing with new kernel here)
# apt-get remove kernel#2.4.18-27.8.0

src: http://sulinux.stanford.edu/install-9.html
 
Linux: Grub and serial console

Stuff in /boot/grub/menu.lst:
serial --unit=0 --speed=9600
terminal --timeout=10 serial console
console=tty0 console=ttyS0,9600

Stuff in /etc/inittab
s0:2345:respawn:/sbin/agetty ttyS0 115200,9600 linux

src: http://www.znark.com/tech/serialconsole.html
 
How I keep remembering new ways of using computers. My (computer-centric) new-optimization learning blog.

Name:
Location: Kobe, Hyogo, Japan
September 2003 / October 2003 / December 2003 / March 2004 / April 2004 / May 2004 / June 2004 / July 2004 / August 2004 / September 2004 / February 2005 / March 2005 / April 2005 / May 2005 / June 2005 / July 2005 / August 2005 / September 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 /


Powered by Blogger