Tips

How to scan the SCSI bus with a 2.6 kernel

If you are playing with SCSI devices (like Fibre Channel, SAS, ..) you sometimes need to rescan the SCSI bus to add devices or to tell the kernel a device is gone. Well, this is the way to do it in CentOS with versions that have a 2.6 kernel. This means CentOS 5 and CentOS 4 (starting from update 3).

   1. Find what's the host number for the HBA:

          ls /sys/class/fc_host/

      (You'll have something like host1 or host2, I'll refer to them as host$NUMBER from now on)

   2. Ask the HBA to issue a LIP signal to rescan the FC bus:

          echo 1 >/sys/class/fc_host/host$NUMBER/issue_lip

   3. Wait around 15 seconds for the LIP command to have effect

   4. Ask Linux to rescan the SCSI devices on that HBA:

          echo "- - -"  >/sys/class/scsi_host/host$NUMBER/scan

      The wildcards "- - -" mean to look at every channel, every target, every lun.

To source the .bashrc in gnome

 # cat $HOME/.gnomerc
 source $HOME/.bashrc

To support windows true type font in Linux

  1. Create a directory called TTF in /usr/share/fonts directory
  2. Copy all the windows TTF fonts to /usr/share/fonts/TTF directory
  3. Restart the xfs service

To install TTF fonts in per user basis in Linux

  1. Create .fonts directory in $HOME
  2. copy the .ttf font file to $HOME/.fonts directory

To disable the colors in directory listings

  1. Open /etc/DIR_COLORS.xterm file in vi
  2. Search for 'COLOR tty' line
  3. Change it as 'COLOR none'
  4. Save the file and quit
  5. Logout and Login back

screen in Linux

Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells).

To start a screen

 # screen

To list the current screen sessions

 # screen -ls
 There is a screen on:
         13086.pts-2.ae  (Attached)

To resume detached session 13086.pts-2.ae

  # screen -r 13086.pts-2.ae

To re-attache to session 13086.pts-2.ae and if necessary to detach it first

 # screen -d -r 13086.pts-2.ae

To attache to a already attached screen

 # screen -x 13086.pts-2.ae

To detach a screen

 Ctrl+a then d

also using the following screen command

 # screen -d 13086.pts-2.ae

To autostart a program after logging into gnome
Applications --> Preferences --> More preferences --> Sessions --> Startup Programs --> Add

To start a gnome session from xterm session

 gnome-session start

To start a kde session, from xterm session

 startkde

Resolution problem on Wide screen displays with intel 9xx series display adapters

01. download and install 915resolution rpm package
02. List all the resolution supported using "915resolution -l" command
03. If the required resolution is not listed, override some mode (eg 4b) with the required resolution

    915resolution 4b 1680 1050 24

04. add line "/usr/sbin/915resolution 4b 1680 1050 24" to /etc/rc.net and reboot the system


To make Dell wireles to work

01. Install ndiswrapper

a. Install the dev packages
b. Install the kernel source

    yum install kernel-devel

c. Download and install ndiswrapper

    wget http://internap.dl.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-1.41.tar.gz
    tar -xzvf ndiswrapper-1.41.tar.gz
    make uninstall
    make
    make install

d. Download the dell 1390 WLAN driver

  wget http://ftp.us.dell.com/network/R151517.EXE
  unzip -a R151517.EXE
  cd DRIVERS

e. ndiswrapper -i bcmwl5.inf

  installing bcmwl5 ...

f. [root@dhcp51-52 DRIVER]# ndiswrapper -l

  bcmwl5 : driver installed
  device (14E4:4311) present

g.[root@dhcp51-52 DRIVER]# ndiswrapper -m

 module configuration already contains alias directive

h. [root@dhcp51-52 DRIVER]# modprobe ndiswrapper

i. add the following line to /etc/modprobe.conf

   alias wlan0 ndiswrapper

j. To automatically load the module ndiswrapper, create a file called ndiswrapper.modules with the following line on it. alsto make it executable using chmod 755 /etc/sysconfig/modules/ndiswrapper.modules command

   cat /etc/sysconfig/modules/ndiswrapper.modules  
   modeprobe ndiswrapper

http://www.cse.iitk.ac.in/users/bms/pdfDoc/LINUXConfigureWirelessCard.pdf

 -- Reboot your system now --

Bash Shell help

 http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_01.html

 # updatedb
 # locate
 # makewhatis
 # man -k <keyword>

To install Java Plugin for Firefox

01. Install the Java JRE
02. Create the link the fire fox home directory

    # ln -s /usr/java/latest/lib/amc64/libnpjp2.so libnpjp2.so

or create the link in firefox plugin directory of the user.
Note: The path for libnpjp2.so will change for each version of Java

   # cd $HOME/.mozilla/plugins
   # ln -s <path_to_libnpjp2.so> .