Everything listed here was confirmed on RedHat Linux. For otherLinux, mileage may vary. Index
Where can I get HOW-TO's on Linux?Whenever you have questions, try visiting Linux Documentation Project (http://en.tldp.org) first. This page isfor English, but you can find other language versions (Spanish, French, Italian, Korean, etc). For japanese, go to Linux JF(Japanese FAQ)Project (http://www.linux.or.jp/JF/index.html). Another site is www.linuxfromscratch.org. This site had the answer to thechar-major-10-135 problem I had with Red Hat 9 rebuilding with ACPI. How can I get the RedHat/SuSE release version running on this system?The RedHat release version is kept in a file: $ cat /etc/redhat-release Red Hat Linux release 9 (Shrike) This text file has been used at least from RedHat 7.1 through 9.SuSE has the similar file: /etc/SuSE-release. In order to get the Linux kernel version, you would do: $ uname -r 2.4.20-20.9 where the last number tells the RedHat major release number. How can I get the system info (cpu, memory, ...)?The simplest way is to use uname command. uname -s : Linux kernel name -n : udon machine name -r : 2.4.20-20.9 kernel release -v : #1 Mon Aug 18 11:45:58 EDT 2003 kernel version -m : i686 hardware name -p : i686 processor type -i : i386 hardware platform -o : GNU/Linux OS More detailed info can be obtained by looking at various "files" in /proc. For example, /proc/cpuinfo has the following: $ cat /proc/cpuinfoprocessor : 0 vendor_id : GenuineIntelcpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 6 cpu MHz : 1005.036 cache size : 256 KB fdiv_bug : no hlt_bug : nof00 f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 2005.40 /proc/pci contains all pci devices known to the OS. For example, Bus 2, device 11, function 0: Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 7). IRQ 9. Master Capable. Latency=32. Min Gnt=2.Max Lat=20. I/O at 0xd800 [0xd81f]. Bus 2, device 11, function 1: Input device controller: Creative Labs SB Live! MIDI/Game Port (rev 7). Master Capable. Latency=32. I/O at 0xd400 [0xd407]. Bus 2, device 12, function 0: Communication controller: Conexant HCF 56k Data/Fax Modem (rev 8). IRQ 3. Master Capable. Latency=32. Non-prefetchable 32 bit memory at 0xec000000 [0xec00ffff]. I/O at 0xd000 [0xd007]. Bus 2, device 13, function 0: Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 16). IRQ 5. Master Capable. Latency=32. Min Gnt=32.Max Lat=64. I/O at 0xb800 [0xb8ff]. Non-prefetchable 32 bit memory at 0xeb800000 [0xeb8000ff]. /proc/meminfo contains all the information about the memory on this system. What is the meaning of runlevel number?runlevel 0 halt 1 single user 2 multiuser text mode 3 multiuser text mode with network 4 not used 5 multiuser X11 mode 6 reboot How can I change the runlevel ?Login as root and modify the number in a line of /etc/inittab file (0 and 6 should not be used). id:5:initdefault: When you have X window problem and forget to change the inittab above, here is what to do at GRUB boot loader.
Now you are in textmode. You can now use redhat-config-xfree86to edit video configuration to select VESA as a video adapter. Now you can boot into X11 with VESA driver. How can I start vnc with kde desktop?You have the initialization file in your home directory: .vnc.Edit the file xstartup and change the startup to have /usr/bin/startkde & By the way, you can specify the display to be used for vnc by startingthe vncserver with an argument. For example, if you want to use display:1, then do vncserver :1 How can I swap keys (Ctrl<->Caps Lock)?If you are emacs user, you really need to swap Ctrl with Caps Lock. What I do is to use .Xmodmap, using .xinitrc. Here is .Xmodmap. remove Lock = Caps_Lock remove Control = Control_L keysym Control_L = Caps_Lock keysym Caps_Lock = Control_L add Lock = Caps_Lock add Control = Control_L I have the following line in .xinitrc. xmodmap .Xmodmap Update: It turned out that KDE3 makes .xinitrc incompatible with KDE and thusKDE cannot start. Just do "xmodmap .Xmodmap" after KDE starts. If you run Gnome Desktop which is the default of CentOS, then you use Applications > Preferences > Keyboard. Click on Layout Option.Click Available options > Control Key Position. Select Swap Control and Caps Lock. Then click Add. How can I switch console and X11 mode back and force?CTRL-ALT-F2 from X11 to consoleALT-F7 from console to X11 again. How can I run an application with new shared libs without being root ?First, find out which shared libraries are unresolve by running ldd app where "app" is the name of the application you want to run. Get thosenot found shared libraries into your directory. Then, do for tcsh: setenv LD_LIBRARY_PATH for bash: export LD_LIBRARY_PATH= Now try "ldd app" again. The shared libraries should be found and you canrun the application now. Of course, an official way is to become root.put those shared libraries into wherever appropriate, edit /etc/ld.so.conf file and run /sbin/ldconfig -v. Resetting the environmental variable is for tcsh: unsetenv LD_LIBRARY_PATH for bash: unset LD_LIBRARY_PATH How can I turn on/off services without using GUI ?First check whether services you want to deal with is among the files in /etc/init.d (dhcpd, networ, nfs, routed, wine etc.) If so, thenyou are lucky. These are the scripts which allow you to stop and startthe service you are interested in. For example, if you want to restartnetwork, you do become root /etc/init.d/network restart If you want to turn on/off the service at the boot time, then you do become root /sbin/chkconfig (servicename) on /sbin/chkconfig (servicename) off that is, /sbin/chkconfig nfs on You can actually create your own script and put it in /etc/init.d by imitating one of the scripts. How can I turn on firewire at boot time?Update: RedHat 9 recognizes the firewire port and installs the driverautomatically, except the libraw. Therefore, you remove ieee1394 andohci1394 lines in /etc/init.d/firewire script before updating to RedHat 9. My DELL laptop has the firewire port. Unfortunately, the Linux 1394 site does not have a section on how to turn on firewire at boot time. Here is the corollary of the previous one cent. Add the following fileinto /etc/init.d. Note that "# chkconfig 2345 90 12" line means the following:2345 means that this script will run under runlevel 2, 3, 4, 5. The nextnumber is the startup priority. What they mean by priority is that "chkconfig firewire on" creates rc0.d...rc6.d directory and adds a file,in this case, S90firewire which is a softlink to /etc/init.d/firewire. The order of execution of files in e.g. rc5.d is decided by the alphabetical order.Therefore, if you put 90 (in this case), it is executed later than thosewith smaller number. Thus, if your script depends on other services,make sure to have the startup priority number is bigger than thoseof the services required. The third number is the stop priority. This number decides the stopping order. Most likely your service's number should be less than those of the system services, since the order is decided by the alphabetical order. #!/bin/bash## chkconfig: 2345 90 12# description: Firewire start/stop utility ## Author Yasunari Tosa # Created March 27 2003 # Source function library. start() { echo -n $"Starting $prog: " /sbin/insmod ieee1394 /sbin/insmod ohci1394 /sbin/insmod raw1394} stop() { /sbin/rmmod raw1394 /sbin/rmmod ohci1394 /sbin/rmmod ieee1394} status() { dmesg | grep 1394}case "$1" in start) start ;; stop) stop ;; status) status ;; restart|reload) stop start ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1esac exit 0 Then do the following as root. /sbin/chkconfig firewire on Please go to Linux1394 site about how to install three drivers listed in the script above and other useful information about firewire/1394 devices. How can I use a brand-new disk drive?If Kudzu did not recognize the disk as in the case of firewire drives, thenyou have to do it manually. For example, the firewire drive isrecognized as a SCSI device (/dev/sda, /dev/sdb,... not /dev/hda, /dev/hdb, ...) on Linux. In my case, I attached a new Maxtor firewire drive to the laptop.Here is what I did. This may be too criptic to some people. Create a partition: # /bin/fdisk /dev/sda n (add new partition) p (pick primary) l (list partition) w (write table to disk and exit) Now create ext3 system on the partition I created (/dev/sda1): # /sbin/mkfs -t ext3 /dev/sda1 Mount it as /mnt/fw: # mkdir /mnt/fw # mount /dev/sda1 /mnt/fw The file system created has a journal. How can I make an exact copy of a disk?After the crash of the harddisk of my laptop, I realized that I should makea backup of what I have. There are options, but I decided to make an exactcopy of my PC's harddrive, since a harddisk is cheap enough to make itpossible. Thus I bought a same size hard disk with a mobile rack. I had the Partition Magic V.7, but when I tried to copy a WinXP partition, it issued Error 510: The version of the file system is not supported! Not only WinXP partition, but it also issued the same error for Win2K partition! I guess that this is the price you pay for using Microsoft Windows. It does not support Ext3 either. I had to find the alternative in Linux. It turend out that the standard Linux utitlity dd can do the job fine. After attaching the brand new disk as the slave and booted knoppix v3.3 from CD, the following command copies the entire drive bit by bit. dd if=/dev/hda of=/dev/hdb bs=128k The number 128k comes from the explanation from the answer on the freebsdquestions. I was initially suspicious of the claim, but it did the job fine.You don't need to partition the second drive (/dev/hdb), since the partitiontable is also copied. The only negative point is that it copies "entire" sectors, including those which have no data. On my 1 GHz PIII PC, it took 1 hour and 10 minutesto copy 160 Gbytes. If you don't use bs=128k, then you may end up considerably longer time (I was using bs=2048k and took 10 hours to copy just 80 Gbytes originally!). Another way is to use rsync command. This copies only the files presentand thus faster than dd command. cd / rsync -aDrRx --force --delete --exclude lost+found . /mnt/tmp where options are -a archive, -D preserve device, -r recursive, -R use relative path, -x don't cross file system, --delete delete files that don't exist on src, --exclude $things exclude where I mounted the extra drive into /mnt/tmp. Watch out the syntax of the src and the dst. A trailing / on a source name means "copy the contents of this directory". Without a trailing slash it means "copy the directory". Copying to a remote machine using ssh is done as follows: rsync -e ssh (options) src tosa@192.168.0.1:/tmp How can I burn a CD?First step is to create an iso image of files to burn a CD. mkisofs -r -o /var/tmp/mine.iso /home/tosa If the space is not enough in /var/tmp, then you must pick some placewith more than 700 Mbytes available. Note that one CDRW can hold 700 Mbytes.Next find out which device number your CDwriter is using. The option -r makes not only having Rock Ridge extension toISO9660 but also uid and gid set 0. Without this option, filenameshave only 8.3 format. become root by $ su $ Password: # cdrecord -scanbus Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jorg Schilling Linux sg driver version: 3.1.24 Using libscg version 'schily-0.5' scsibus0: 0,0,0 0) 'HL-DT-ST' 'RW/DVD GCC-4240N' 'D110' Removable CD-ROM 0,1,0 1) * ... This output tells us that the CDBurner is "dev=0,0,0" (scsi bus 0, id = 0, LUN=0). # cdrecord -v speed=8 dev=0,0,0 -data /var/tmp/mine.iso Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jrg Schilling TOC Type: 1 = CD-ROM scsidev: '0,0,0' scsibus: 0 target: 0 lun: 0 Linux sg driver version: 3.1.24 Using libscg version 'schily-0.5' atapi: 1 Device type : Removable CD-ROM Version : 0 Response Format: 2 Capabilities : Vendor_info : 'HL-DT-ST' ... It takes a while to get the prompt back. It takes a quite long time aftergetting to "Fixating ...." You must be patient. How can I use ssh-agent so that I won't have to type password every timeYou usually use ssh to log in to other UNIX-like machines.I was tired of typing passwd every time. When I use CVS from emacs,emacs vc-commands (version control commands) are not usable, when CVS_ROOT is another machine through ssh. (M-x vc-annotate did popup a password dialog. That is the only one worked. I had the motivation.The co-worker pointed me to http://math.everybody.org/docs/ssh/ and I found another sitehttp://www.deadman.org/ssh-tut.html Both sites are useful. Unfortunately, not all the steps are written. So you have my way alsofor your reference. First generate dsa key pair, using ssh-keygen. Note that passphrase it is asking could be anything. On UNIX password isusually limited to 8 characters. Howerver passphrase can be longer. /home/tosa>ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/tosa/.ssh/id_dsa): /home/tosa/.ssh/id_dsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/tosa/.ssh/id_dsa. Your public key has been saved in /home/tosa/.ssh/id_dsa.pub. The key fingerprint is:1f:1f:5a:f1:08:f6:64:4b:dc:88:a4:9b:00:c4:76:04 tosa@tosa-nb copy the public key to the host you want to login. Please read carefully. /home/tosa>ssh tosa@....edu 'cat >> ~/.ssh/authorized_keys' < ~/.ssh/id_dsa.pub tosa@....edu's password: Now test to see whether login now uses passphrase, not password. /home/tosa>ssh tosa@....edu Enter passphrase for key '/home/tosa/.ssh/id_dsa': Now prepare your Linux PC to start using ssh-agent.Edit .xsession to have the following line ssh-agent startkde (or gnome-session) I use tcsh shell. You add the following to .login and .logout. This is verbatim from http://math.everybody.org/docs/ssh. For bash shell, go to the site to look it up. .login ====== set sshAgent=/usr/bin/ssh-agent set sshAgentArgs="-c" set tmpFile=exportAgentEnv if ( -x "$sshAgent" ) then if ( ! $?SSH_AUTH_SOCK ) then $sshAgent $sshAgentArgs | head -2 > $tmpFile source $tmpFile rm $tmpFile echo "ssh agent started [${SSH2_AGENT_PID}]" ssh-add endif endif .logout ======= if ( $?SSH2_AGENT_PID ) then echo "killing ssh agent [${SSH2_AGENT_PID}]" ssh-add -D kill $SSH2_AGENT_PID unset SSH2_AGENT_PID unset SSH2_AUTH_SOCK endif Now logout and login to your PC. The last step in usingssh-agent. /home/tosa>ssh-add ~/.ssh/id_dsa Enter passphrase for /home/tosa/.ssh/id_dsa: Identity added: /home/tosa/.ssh/id_dsa (/home/tosa/.ssh/id_dsa) Done! Try login to another UNIX machine where you putyour id_dsa. No more password. CVS commands work from emacs now. How can I use ssh and sftp on MS Windows?Microsoft does not provide "sftp" nor "ssh" as usual (only "ftp" and "telnet") without paying. Thanks to Simon Tatham, "PuTTY" and "PSFTP" are available for free on the web PuTTY page. Both works fine for me for connecting to RedHat8 Linux. PuTTY can do telnet, rlogin, ssh. Please check the web site for more details. There is an OpenSSH website http://lexa.mckenna.edu/sshwindows/. or http://www.networksimplicity.com/openssh/. The MSWindows version uses Cygwin libraries to port Unix version ofssh commands. An interesting development is that Microsoft now offers Services for UNIX 3.5, which can be downloaded free at this time. The download filename is SFU355EL_EN.exe (220 Mbytes!) and its_official name is Microsoft Windows Services for UNIX 3.5 Product ID: 55875-270-4331881-00652. Most of the unix commands are provided by this package (diff3.exe is missing in /comon). It also contains gcc3.3 as a compiler and the X11R5 and R6 libraries. How can I mount NTFS partition?You can only read NTFS partition of WinNT or WinXP. Download RPM forRedHat from http://linux-ntfs.sourceforge.net. How can I setup "ppp" ?I used "kppp" for setting up. What I did not know was the type of authentication.AT&T worldnet uses "CHAP". When you cannot connect, become su and check the file /etc/ppp/chap-secrets for username and passwd. How can I set up WOL (Wake-up On LAN) for my PC?The Magic Packet technology is used to remotely wake up a sleeping or powered off PC on a network. This is accomplished by sending a specific packet of information, called a Magic Packet frame, to a node on the network AMD site for more information. Both hardware and software are needed to make your PC WOL.For hardware side, you have to have a motherboard and a network card which have this feature. Usually a motherboard has a power connector port for this purpose (marked WOL) and a network card uses a 3-pin cable which connects to this port. For software side, you need a software to send a special Magic Packet over ethernet.You can search Google for WOL. The afore-mentioned AMD site has a Windows version of thisprogram. I found a Java program to do this www.diana.dti.ne.jp/~itaru-o/program.html. This is a Japanese site, but you can see Magic PacketSender for JAVA in English. You need to know the network broadcast address and the MAC address ofa network card. It is easy on Linux: /sbin/ifconfig lists both. On my PC, I get eth0 Link encap:Ethernet HWaddr 00:05:5D:51:FE:30 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255. where the MAC addresss is 00:05:5D:51:FE:30 and the broadcast address is 192.168.0.255. In my case, it worked for the first time without any effort. Well, I have to add CLASSPATH. How can I switch between CUPS and LPRng ?Starting from RedHat 7.3, RedHat implemented a scheme called alternatives so that you can switch between similar programs (read man page for alternatives).You can use alternatives to switch between CUPS and LPRng. Under RedHat 7.3, you must use the command line to switch. Here is what I did. # /usr/sbin/alternatives --config print There are 2 programs which provide 'print'. Selection Command----------------------------------------------- 1 /usr/bin/lpr.cups* + 2 /usr/bin/lpr.LPRng Enter to keep the default[*], or type selection number: 1 After picking 1, "+" is moved to 1. # /usr/sbin/alternatives --config print There are 2 programs which provide 'print'. Selection Command----------------------------------------------- +1 /usr/bin/lpr.cups* 2 /usr/bin/lpr.LPRng What alternatives is doing is to maintain the symbolic link set up in /etc/alternatives. Here is the change caused by the process above. lrwxrwxrwx 1 root root 17 Aug 26 09:49 print-lp ->/usr/bin/lp.LPRng* lrwxrwxrwx 1 root root 19 Aug 26 09:49 print-lpc ->/usr/sbin/lpc.LPRng* lrwxrwxrwx 1 root root 34 Aug 26 09:49 print-lpcman ->/usr/share/man/man8/lpc-LPRng.8.gz changed to rwxrwxrwx 1 root root 17 Sep 12 09:59 print ->/usr/bin/lpr.cups* lrwxrwxrwx 1 root root 20 Sep 12 09:59 print-cancel ->/usr/bin/cancel.cups* lrwxrwxrwx 1 root root 36 Sep 12 09:59 print-cancelman-> /usr/share/man/man1/cancel-cups.1.gz Under RedHat 9, it is easy to switch. System->Other System Settings->Printer System Switcher. This will pop up a dialog to switch. Thus no need touse the command line. Once you selected CUPS, you have to set up the printer. Make sure that System->Service Configuration to check cups checked andstarted. Using the web administration is to go to http://localhost:631/admin. It is very easy for setting up a local parallel printer. For remote printer on the network, it is tricky, since the CUPS documentationis vague about the samples. For printer on the network, DEVICE URI is lpd://deca.tosafamily.com where the networked printer name is "deca". If the network printer is attached to a PC running CUPS, then make sure that you look at the cups configuration at the printer host /etc/cups/cupsd.conf. Note that the ipp printer device is described at the XML tag <Location /printers/epson> (in my case).If you use the command line, then adding the printer command at a client PC is: /usr/sbin/lpadmin -p Epson -E -v ipp://192.168.0.1/printers/epson On the web admin, you put ipp://192.168.0.1/printers/epson asDEVICE URI. Note that my local server IP address is 192.168.0.1. Make sure that you allow the client to use printerin by adding its client IP address "Allow From 192.168.0.8" in /etc/cupsd.conf. What are UHCI and OHCI for USB?I was getting an ohci error at the boot time on my DELL laptop (Intel 845). After reading http://www.linux-usb.org, I finally understood. There are three kinds of USB "Host Controller" hardware (2 for USB 1.1 and 1 for USB 2).They are determined by the interface they implement. Thereby, the names areUHCI for Universal Host Controller Interface, OHCI for OpenHost Controller Interface, and EHCI for Enhanced (USB2) Host Controller Interface. Now /etc/modules.conf loads the driver for USB. This was the lines onthe DELL laptop: alias usb-controller usb-uhci alias usb-controller usb-ohci If your PC does not have both interface supported, trying to load both is an error.Therefore you remove one of the lines to eliminate error. How can you tell which one is in your PC? Do dmesg | grep -i USB and I got(I have a SII USB2 card in the PCI slot on my desktop PC) usb.c: registered new driver usbdevfsusb.c: registered new driver hubusb-ohci.c: USB OHCI at membase 0xe0872000, IRQ 5 <---- OHCIusb-ohci.c: usb-02:09.0, NEC Corporation USBusb.c: new USB bus registered, assigned bus number 1hub.c: USB hub foundusb-ohci.c: USB OHCI at membase 0xe0874000, IRQ 9 <---- OHCIusb-ohci.c: usb-02:09.1, NEC Corporation USB (#2) usb.c: new USB bus registered, assigned bus number 2 hub.c: USB hub foundehci-hcd 02:09.2: NEC Corporation USB 2.0 usb.c: new USB bus registered, assigned bus number 3 ehci-hcd 02:09.2: USB 2.0 enabled, EHCI 0.95, driver 2003-Jan-22 <-- EHCIhub.c: USB hub foundusb.c: registered new driver hiddevusb.c: registered new driver hidhid-core.c: USB HID support drivers Meanwhile my Dell Laptop has only UHCI and thus I have to removeOHCI line from /etc/modules.conf. Interestingly, you don't add usb-ehci for USB 2 card. I have the SII USB2 card(which uses NEC chip) in the slot which lead to alias usb-controller usb-ohci alias usb-controller1 ehci-hcd alias usb-controller2 usb-ohci alias usb-controller3 usb-ohci where HCD stands for Host Controller Driver.. How can I set up an Apache webserver?This is for RedHat 9. First make sure that you have necessary rpm installed. $ rpm -qa | grep httpd httpd-manual-2.0.40-21.5 httpd-devel-2.0.40-21.5 redhat-config-httpd-1.0.1-18 httpd-2.0.40-21.5 Startup Menu → System Settings → Server Settings → HTTP Server.You get Apache Configuration dialog. Set Server Name in the tab "Main". This is the same thing as editing /etc/httpd/conf/httpd.conf. When I did/etc/init.d/httpd restart, it failed to use port 80. I set System Settings → Server Settings → Services and check httpd. Then I rebooted.I saw "httpd [OK]" at the boot message. Note that /etc/httpd/conf/httpd.conf makes server running uid apache and gidapache. If you don't have these uid and gid, you get the server startup error.If you get the startup error, edit /etc/passwd and /etc/group to add /etc/passwd apache:x:48:48:Apache:/var/www:/bin/false /etc/group apache:x:48: Testing is done by using Mozilla and opening http://localhost/. You should seeTest Page. If you put index.html in /var/www/html, then you will see that page. PostgreSQL NotesThe admin rights of PostgreSQL on RedHat is not "su", but "postgres". In orderto be that user, you do $ su # su postgres createuser name dropuser createtable nameStart the pgsql daemon with outside connection: $ pg-ctl start -O '-i' -D /usr/local/pgsql/dataStop the pgsql $ pg-ctl stop -D /usr/local/pgsql/data How can I fix "DCOPServer could not be started" for KDE?I got this error when I used vnc to connect to RedHat 7.3. It turned out that this isa rather common problem under RedHat 7.3. Here is the web page discussion. It seems
that you need one of the two things to fix. How can I fix "Can't locate module sound-slot-1" for KDE?According to Suse Linux page,the default KDE2.0 tests the system for two sound cards. If you have only one (sound-slot-0), itis saying that the 2nd sound card is not found. KDE 2.0 control-center->Sound->Mixer and thenchange "Maximu number of probed mixers" to 1 and "Maximum number of probed devices per mixer" to 1. How can I change the URL browser in Evolution?Evolution uses galeon as the default URL browser. If you want to changethe default URL browser, then the following step will do the job. This is from guenther guenther@rudersport.de on Evolution forum. $ gconftool-2 -R /desktop/gnome/url-handlers/unknown command = mozilla %s need-terminal = false enabled = true Now, this should enter all those values (at least, they work for me): $ gconftool-2 --set --type=string /desktop/gnome/url-handlers/unknown/command 'mozilla %s' $ gconftool-2 --set --type=bool /desktop/gnome/url-handlers/unknown/need-terminal false $ gconftool-2 --set --type=bool /desktop/gnome/url-handlers/unknown/enabled true Why my mails are stuck in Ximian Evolution?I'm getting error from Evolution (up to 1.2.4) saying the address is wrong. After that, no mailis going out. How can I fix? It turned out that if Evolution cannot send a mail,all outgoing mails are stuck. In order to solve this, pick Outbox and remove theoffending stuck mail. Configure a Linux box as a routerNever use the Secuity Level in the System Setting. It will erase /etc/sysconfig/iptables. This is how to make your Linux box modem work as a gateway to other clients (19.2.168.0.x) on your private network. Step 1./etc/sysconfig/networkNETWORKING=yesHOSTNAME=udonGATEWAYDEV=ppp0 Step 2./etc/sysctl.conf# Controls IP packet forwardingnet.ipv4.ip_forward = 1 Step 3.Do the following at /etc/sysconfig: [root@udon sysconfig]# /sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE [root@udon sysconfig]# /sbin/iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT [root@udon sysconfig]# /sbin/iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT [root@udon sysconfig]# /sbin/iptables -A FORWARD -s ! 192.168.0.0/24 -j DROP [root@udon sysconfig]# /sbin/iptables-save > ./iptables Step 4. /etc/init.d/network restart How can I find out the IP addresses used in a private network?Once you set up the private network and use DHCP, then the IP address used byPCs hanging are dynamically assigned. The problem is how I can tell which IP addresseach one is using. If you are already logged on to the PC, then it is easy. Linux: $ /sbin/ifconfig eth0 Link encap:Ethernet HWaddr 00:B0:D0:0F:F7:C4 inet addr:192.168.100.100 Bcast:192.168.100.255 Mask:255.255.255.0 ... Windows: $ ipconfigIf you are not logged on to a particular PC, then what can I do? Thanks to Paul Raines, I now knows the answer for the Linux side. You have to log in to the DHCP server anduse /sbin/arp. $ /sbin/arp Address HWtype HWaddress Flags Mask Iface dalsa-132183139190-1321 ether 00:0D:56:74:84:53 C eth0 192.168.100.100 ether 00:B0:D0:0F:F7:C4 C eth1 rtp001785rts.mgh.harvar ether 00:00:0C:07:AC:00 C eth0 martinos02.nmr.mgh.harv ether 00:02:B3:4B:8F:83 C eth0 192.168.100.113 ether 00:07:E9:0C:EF:6B C eth1Here you see that two private addresses, 192.168.100.100 and 192.168.100.113 are used with the eth1 interface. Another file can tell you about the IP addresses, /var/lib/dhcp/dhcpd.leases. How many files can be opened at once?You have to use bash shell to get the number. bash$ ulimit -n Other information will be available under -a option. On Linux 2.4.18-27, I get the following: bash$ ulimit -acore file size (blocks, -c) 100 data seg size (kbytes, -d) unlimitedfile size (blocks, -f) unlimitedmax locked memory (kbytes, -l) unlimitedmax memory size (kbytes, -m) unlimitedopen files (-n) 1024 pipe size (512 bytes, -p) 8 stack size (kbytes, -s) 8192cpu time (seconds, -t) unlimitedmax user processes (-u) 7168 virtual memory (kbytes, -v) unlimited How can I see the temperature of CPU and the fan speed?The temperature sensor and the fan speed detection depend on the hardware andthe BIOS on the motherboard. For those who owns the Dell Inspiron or Lattitude benefits from the i8k project (www.debian.org/~dz/i8k. The latest RedHat 9.0 kernel comes with i8k.o already built (/lib/modules/2.4.20-31.9/kernel/drivers/char/i8k.o). The only thing you have to do is to load the driver and get the i8kutils rpm. i8kutils-1.21-1.i386.rpm. The easiest way to load the driver is to use the following file put in/etc/init.d as i8k. Then, do /sbin/chkconfig i8k on.Next time you boot your laptop, i8k driver gets loaded. The "file" /proc/i8k contains the information on the temperature and the fanspeeds (Lattitude C840 has two fans). #!/bin/bash## chkconfig: 2345 90 12 # description: Dell laptop temperature monitor at /proc/i8k ## Author Yasunari Tosa # Created May 24th 2004 # Source function library.start() { echo -n $"Starting $prog: " /sbin/insmod i8k}stop() { /sbin/rmmod i8k}status() { cat /proc/i8k}case "$1" in start) start ;; stop) stop ;; status) status ;; restart|reload) stop start ;; *) echo $"Usage: $0 {start|stop|status}" exit 1esacexit 0 The util package contains i8kmon, i8kfan, i8kctl, i8kbuttons. In order to usei8kmon, you create a configuration file called ~/.i8kmon whose contentis as follows: set config(0) {{0 0} -1 60 -1 65} set config(1) {{1 0} 50 70 55 75} set config(2) {{1 1} 60 80 65 85} set config(3) {{2 2} 70 128 75 128} which describe the fan speeds depending on the temperature range. How can I create a boot floppy?Use mkbootdisk as follows. The last argument is the current kernel name.(you can do "uname -r" to find out). $ /sbin/mkbootdisk --verbose --device /dev/fd0 2.4.20-31.9 Insert a disk in /dev/fd0. Any information on the disk will be lost. Press to continue or ^C to abort: Formatting /tmp/mkbootdisk.UM1jur... done. Copying /boot/vmlinuz-2.4.20-31.9... done. Copying /boot/initrd-2.4.20-31.9.img... done. Configuring bootloader... done. 20+0 records in 20+0 records out How can I get the browser open when I click the link in the email?This solution is from http://forums.mozillazine.org/viewtopic.php?t=72353. Step 1: create openlink.sh in thunderbird directory (in my case /home/tosa/thunderbird). ---------------------------------------------------------------- #!/bin/sh ############### # http://forums.mozillazine.org/viewtopic.php?t=72353 ## html link to use firefoxexport MOZILLA_FIVE_HOME="/home/tosa/firefox"url="$1" if [ "x$url" = "x" ]; then url="about:blank" fi if $MOZILLA_FIVE_HOME/mozilla-xremote-client openURL\("$url, new-tab"\);then exit 0 fi exec $MOZILLA_FIVE_HOME/firefox "$url" ---------------------------------------------------------------------- Make it executable by chmod +x openlink.sh. Test it by $ openlink.sh $(somesite) The browser (firefox in this case) should open up at $(somesite). Step 2: Create user.js in ~/.thunderbird/default/xxxx.slt directory. Note that xxxx.js is a scranbled name. ------------------------------- // use the browser specified in openlink.sh user_pref("network.protocol-handler.app.http","/home/tosa/thunderbird/openlink.sh"); user_pref("network.protocol-handler.app.https","/home/tosa/thunderbird/openlink.sh"); user_pref("network.protocol-handler.app.ftp","/home/tosa/thunderbird/openlink.sh"); --------------------------------- How can I install NVidia driver without rebooting?In order to install NVida driver, you have to stop X11. Here is how.First become root (or sudo all the commands). Next, verify that you have the kernel source for the version you haveby checking "uname -r" and /usr/src/linux-2.x.... Make sure that the version reported by uname and the numbers in /usr/src/ agrees. If it does not, download the kernel source: kernel-source-2.x ....i386.rpm. # /sbin/init 3 # sh NVidia-Linux-x86-1.0-6111-pkg1.run # .... # /sbin/init 5 How can I make both PS2 and USB mouses work under X11?Modify /etc/X11/XF86Config in the following way. Section "ServerLayout" Identifier "XFree86 Configured" Screen 0 "Screen0" 0 0 InputDevice "Mouse0" "CorePointer" <--- PS/2 mouse InputDevice "Keyboard0" "CoreKeyboard" InputDevice "DevInputMice" "AlwaysCore" <--- USB mouseEndSection where the last InputDevice is used for USB mouse and thus you have to addthe following also to the same file. The first section is for PS/2 mouse and the second section is for USB mouse. Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Protocol" "PS/2" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "yes" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" Identifier "DevInputMice" Driver "mouse" Option "Device" "/dev/input/mice" Option "Protocol" "IMPS/2" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection How can I get the update to RedHat 7.3 and 9? RedHat does not supply them anymore.Go to htpp://www.fedoralegacy.org/download/. How can I play DVD movies?I installd ogle for playing DVD movies.In order to install ogle, you must have four libraries installed. Make sure that you configure for shared libraries. Add the installed directory to /etc/ld.so.conf and then do /sbin/ldconf -v to make sure thatthe new shared libraries are registered. Ogle home page is here http://www.dtek.chalmers.se/groups/dvd/ It is really crazy but I could not find .oglerc sample anywhere on the web.Here it is. <audio> <device> <driver>oss</driver> <path>/dev/dsp</path> <alsa> <name>via82xx</name> </alsa> </device> ... where via82xx is the alsa sound driver for Pavillion ZT1230 and others Update: I found another package called Xine is easier. You download a xine-lib package (currently xine-lib-1-rc7.tar.gz) and a xine-ui package (currently xine-ui-0.99.2.tar.gz). I was able toconfigure, compile, install, and run without problems on RedHat9. How can I fix the 'Argument list too long' error from shell?The information comes from Linux Journalarticle. This happens because the shell cannot handle all arguments passed due to the fixed sizebuffer. Therefore, you can eliminate the error by making list of arguments smaller.However, the ultimate fix is to change the buffer size. Unfortunately, the buffer sizeis fixed in Linux kernel. The header file /usr/src/linux-2.x/include/linux/binfmts.h(where x depends on your kernel version) defines the size: /** MAX_ARG_PAGES defines the number of pages allocated for arguments * and envelope for the new program. 32 should suffice, this gives * a maximum env+arg of 128kB w/4KB pages! */ #define MAX_ARG_PAGES 32 Thus, if you can recompile Linux kernel after changing this value to something bigger,then you may alleviate the problem. How can I get a LCD monitor to use the DVI connector?I just got the Samsung 204B 20inch LCD monitor. When I hook it to theDVI port, I could not see the X windows of CentOS 4.4 (ASUS A8N-VM CSM (which has one DVI port and one analog port) even thoughthe initial boot screen could be seen on the monitor. The monitor indicated that the signal is not coming out from the DVI portof the mother board. When I boot Knoppix, it had no problem runningon the DVI port. Thus, I thought that it must be the NVidia driver doing this and went to the Nvidia site to get information. It turned out that there is an option to specifywhich port to use under NVidia Linux driver. The NVidia driver is supposed to autodetect but it did not. Note that the following solution worksfor NVidia display device only. 1. When grub boot, edit the boot line to have a number 3 at the end of the boot line so that it boots in a command line mode. Then you see the command line interface come up on the monitor. Another way is to boot using Knoppix and to mount the root to edit /etc/inittab to have 3 instead of 5 (this is described in this page. Option A: 2. Edit /etc/X11/xorg.conf (CentOS 4.4 or RedHat4) to have the following in Section "Screen" after DefaultDepth. Option "UseDisplayDevice" "DFP" where DFP means Display Flat Panel (i.e.DVI monitor). When you connect to the analog port (whether a LCD monitor or a CRT monitor does not matter), you must set "CRT". Option B: 2. Install a new NVidia display driver by (after becoming root): # sh NVIDIA....pkg?.run (... part depends on the version) Make sure that you have the kernel source installed. Then do # nvidia-xconfig which should create xorg.conf described in Option A. If not, then add it. 3. In order to test the setting, you do # init 5 which boots the X window on the monitor now.Home updated on Sept. 24th, 2006 |
OSes‎ > ‎