27 November 2007

Nautilus opens a new window every time I click a folder. How can I change it back to the old behavior?

The new Nautilus uses a spatial mode, where each folder that is clicked on opens a new folder. Many people believe that this is an improvement in usability while others do not like the way that the new Nautilus works.
It is easy to revert Nautilus back to its old "Browser mode" by issuing the command below as the current user:

gconftool-2 --type bool --set /apps/nautilus/preferences/always_use_browser true 

You may have to log out, then back in again for the changes to take effect.
To change this back to its original behavior issue the command:
 
gconftool-2 --type bool --set /apps/nautilus/preferences/always_use_browser false
Nautilus can be further customized by using the "Configuration Editor" in the System Tools menu.

22 November 2007

How to setup cronjobs

cron is a utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix/Linux.

Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times.

Following points sum up the crontab functionality :

1. Crontab Restrictions
2. Crontab Commands
3. Crontab file - syntax
4. Crontab Example
5. Crontab Environment
6. Disable Email
7. Generate log file for crontab activity

1. Crontab Restrictions

* You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file /usr/lib/cron/cron.deny.

* If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab.
The allow/deny files consist of one user name per line.

2. Crontab Commands

export EDITOR=vi ;to specify a editor to open crontab file.

crontab -e Edit your crontab file, or create one if it doesn't already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.)

3. Crontab file

Crontab syntax :-

A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.

* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)


* in the value field above means all legal values as in braces for that column.
The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).

Note: The specification of days can be made in two fields: month day and weekday. If both are specified in an entry, they are cumulative meaning both of the entries will get executed .

4. Crontab Example

A line in crontab file like below removes the tmp files from /home/someuser/tmp each day at 6:30 PM.

30 18 * * * rm /home/someuser/tmp/*

Changing the parameter values as below will cause this command to run at different time schedule below :

min hour day/month month day/week Execution time

30 0 1 1,6,12 * -- 00:30 Hrs on 1st of Jan, June & Dec.


0 20 * 10 1-5 -- 8.00 PM every weekday (Mon-Fri) only in Oct.


0 0 1,10,15 * * -- midnight on 1st ,10th & 15th of month

5,10 0 10 * 1 -- At 12.05,12.10 every Monday & on 10th of every month


Note: If you inadvertently enter the crontab command with no argument(s), do not attempt to get out with Control-d. This removes all entries in your crontab file. Instead, exit with Control-c.

5. Crontab Environment

cron invokes the command from the user's HOME directory with the shell, (/usr/bin/sh).cron supplies a default environment for every shell, defining:

HOME=user's-home-directory
LOGNAME=user's-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh

Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry.

6. Disable Email

By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line .

/>/dev/null 2>&1

7. Generate log file

To collect the cron execution execution log in a file :

30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log

Linux: Process Accounting (PA) tool


* To find out exactly what programs you use and for how long.
* Linux kernel has a built-in process accounting(PA) facility.
* It allows system administrators to collect detailed information in a log file each time a program is executed on a Linux
system.

Uses of PA

* To calculate the CPU time absorbed by users.
* Data collected from the PA facilities to monitor which programs are most accessed by users, and then optimize the system configuration for these types of programs.
Ex: Part of the data collected by the PA facilities includes the number of bytes that are input and output by the program and the CPU usage. A system that runs a high percentage of I/O-intensive applications may need to be optimized in ways that a system running a high percentage of CPU-bound applications not.

To query the login status,the last command parses the binary log file /var/log/wtmp.

A special user is created for this log file named reboot.So running last reboot prints the history of system reboot recorded to /var/log/wtmp

SETUP AND MAINTAINING PA

rpm file: psacct-6.3.2-41.1.i386.rpm

1.To turn process accounting on

$accton /var/account/pacct

Without arguments to psacct will turn PA off
2. ac reads /var/log/wtmp and prints users' connect times.

$ac -p : displays individual totals for each user
$ac -d : displays totals for each day
$ac --complain : lists ttys that do not have records

3.lastcomm examines /var/account/pacct for information on all previously entered commands.Information about the command's I/O operation times and CPU times

3.sa summarizes information in /var/account/pacct.The information is normally displayed to standard output,but with the -s option,summary information is written to:

* /var/account/savacct summarizes accounting information on previously executed commands
* /var/account/usracct summarizes accounting information by user

21 November 2007

'df' command says partition is full, while 'du' reports free space

The standard cause for this is some user process keeping a deleted file open.

When this happens, the space is not visible via 'du', since the file is no longer visible in the directory tree. However, the space is still used by the file until it is deallocated, and that can only happen once the last process which has the file open either closes its file descriptor to the file, or the process exits.

You can use the lsof program to try to find which process is keeping an open file. Usually it's some log file, or some large data base file which gets rotated out, but some older process are still keeping the log file open.

File format of /etc/fstab in Linux

fstab is a configuration file that contains information of all the partitions and storage devices in your computer.

*File system specifier: For disk-based file systems,either a device file,or a device label specification
*Mount point : Except swap partitions,this field specifies the mount point to be used when the file system is mounted
*File system type : Type of file system present on the specified device
*Mount Options : A comma-separated list of options that can be used to control mount's behaviour
*Dump frequency : If the dump backup utility is used,the number in this field will control dump's handling of the  specified file system
*File system check order: Controls the order in which the file system checker fsck checks the integrity of the file systems.

Mount options common to all filesystems are:
auto/noautoWith the auto option, the device will be mounted automatically (at bootup, or when we issue the mount -a command). auto is the default option. If you don't want the device to be mounted automatically, use the noauto option in /etc/fstab. With noauto, the device can be mounted only explicitly.
dev/nodev
Interpret/do not interpret block special devices on the filesystem.
exec/noexec
exec lets you execute binaries that are on that partition, whereas noexec doesn't let you do that. noexec might be useful for a partition that contains binaries you don't want to execute on your system, or that can't even be executed on your system. This might be the case of a Windows partition.
ro
Mount read-only.
rw
Mount the filesystem read-write.

sync/async
How the input and output to the filesystem should be done. sync means it's done synchronously. If you look at the example fstab, you'll notice that this is the option used with the floppy.,this means that copy a file to the floppy, the changes are physically written to the floppy at the same time you issue the copy command.

suid/nosuid
Permit/Block the operation of suid, and sgid bits.

user/nouser
Permit any user to mount the filesystem. This automatically implies noexec, nosuid,nodev unless overridden. If nouser is specified, only root can mount the filesystem.

defaults
Use default settings. Equivalent to rw,suid,dev,exec,auto,nouser,async.

Linux: Useful Keystrokes in X

*Killing X : [ctrl+alt+backspace]
*Changing windows: [Alt+tab]
*Changing workspaces: [ctrl+alt+arrow key]
*Popping up the Red Hat Menu: [Alt+F1]

20 November 2007

How to configure the Virtual console login to display a pre-login message with Virtual Console Name?

Virtual console login prompts for a login name and invokes the /bin/login command to process the user login.mingetty handles all of these as well as opening the tty port and setting the needed modes.

tty is a kernel layer used by all Linux users to type commands at a prompt or at a serial port connection.

In order to differentiate the 6 virtual console login from each other to avoid confusion and quickly identify the current tty when having multiple users logging in locally,its possible to edit the pre-login message in the /etc/issue file.

Configure /etc/issue as below
Red Hat Enterprise Linux Server release 5.1 Beta (Tikanga)
Kernel \r on an \m
You are currently On Virtual Console \l

mingetty supports the below escape sequences to display various information:
  • \d - current day (localtime)
  • \l - current tty
  • \m - machine architecture (uname -m)
  • \n - hostname (uname -n)
  • \o - domain name (domainname)
  • \r - operating system release (uname -r)
  • \t - current time (localtime)
  • \s - operating system name
  • \u - number of users currently logged in
  • \v - operating system version (uname -v)
The tty command displays the current tty file used once the user is successfully logged in.

$tty
/dev/tty2

Output:

Red Hat Enterprise Linux Server release 5.1 Beta (Tikanga)
Kernel 2.6.18-37.el5xen on an i686
You are currently On Virtual Console tty3
client1 login:



HP-UX: Intro Guardian Service Processor(GSP) & Management Processor(MP)

All of HP's current PA-RISC and Integrity servers include a GSP/MP card which has a LAN console port.

This console port is usually called as GSP/MP port which depends on which card(GSP/MP) is installed in the physical machine.But mostly these days MP card is installed on HP-UX Servers by default.

Features:

* Enables remote server management over the web regardless of the system state.
* In the unlikely event that the operating system in not running,the GSP/MP port can be accessed to power cycle the server,view event logs and status logs,enable console re-direction,and more.
* Always-on capability: GSP/MP is alive if the power cord is plugged in.
* User/Password access control: Supports operator and administrator users
* Multiple access methods to GSP/MP:
Local port
Remote/modem port
LAN

*Mirrored console:System console output stream is reflected to all of the connected console users
*Display and/or logging of:

The system console,system event logs (chassis codes),Virtual Front Panel (VFP),and system power and configuration status.
*GSP/MP provides power control,system reset,and Transfer Of Control (TOC) capabilities.

Note: This GSP/MP is similar to Oracle Sun™ Advanced Lights Out Manager (ALOM)

Filesystems that cannot be configured in Linux


The /bin,/dev,/etc,/lib and /sbin directories may not be on separate filesystems they must be a part of / filesystem otherwise system will not boot properly

19 November 2007

How to manage interactive programs that run for long periods of time

Problem Statement:

A user wants to run a program 'a' that takes seven hours to complete.He wants to start the program while leaving his office in the evening.But he feels that power will be wasted if he invokes this program in the evening,and keeps the workstation that has started the program 'a' through the SSH client switched 'on',just to keep 'a' running.

User can try the following solutions:

SOLUTION1:


$cd /path/to/a
$
sh a.sh &
$
logout

Disadvantage of this option is that it will not capture the exit code of 'a'

SOLUTION2:

$screen
$
cd /path/to/a
$
sh a.sh

Shutdown the machine that has started the program 'a' using ssh.

Next day,invoke the ssh session to the system and retrieve the same terminal that has started this long-running program 'a',using the following technique:

$screen -list

This will list the set of screen managers - in the above case you should see only one screen manager,something like the following:

This is a screen on:

There is a screen on:
23399.pts-1.maya-replace (Detached)

1 Socket in /tmp/screens/S-root.


Now , the following command should get the screen back.

$screen -d -r 23399.pts-1.maya-replace


17 November 2007

Grabbing redhat install screens

During graphical installs you can grab screenshots of any installation screen.To do this,press Shift+Print Screen to save the current screen to hard disk.

You can repeat this as many times as you like.When installations is completed,you can find the screenshot(s) in the /root/anaconda-screenshots directory.

Note:This feature is not supported in text-based installs.

16 November 2007

INTRO: SPLASH SCREEN

Splash screen is a term used to describe an image that appears while a computer program/operating system is loading.Splash screens used for Operating systems will usually cover entire screen whereas for applications a rectangle near the center.

GRUB SPLASHSCREEN IN RHEL 5

How to view the initial RAMDISK file in Redhat linux - PART 2

ls output of the RAMDISK directory

$
ls -l


total 68
drwx------ 2 root root 4096 Nov 16 16:03 bin
drwx------ 3 root root 4096 Nov 16 16:03 dev
drwx------ 2 root root 4096 Nov 16 16:03 etc
-rwx------ 1 root root 1979 Nov 16 16:03 init
drwx------ 3 root root 4096 Nov 16 16:03 lib
drwx------ 2 root root 4096 Nov 16 16:03 proc
lrwxrwxrwx 1 root root 3 Nov 16 16:03 sbin -> bin
drwx------ 2 root root 4096 Nov 16 16:03 sys
drwx------ 2 root root 4096 Nov 16 16:03 sysroot

Tree command output

$tree
.
|-- bin
| |-- dmraid
| |-- insmod
| |-- kpartx
| |-- modprobe -> /sbin/nash
| `-- nash
|-- dev
| |-- console
| |-- mapper
| |-- null
| |-- ptmx
| |-- ram -> ram1
| |-- ram0
| |-- ram1
| |-- rtc
| |-- systty
| |-- tty
| |-- tty0
| |-- tty1
| |-- tty10
| |-- tty11
| |-- tty12
| |-- tty2
| |-- tty3
| |-- tty4
| |-- tty5
| |-- tty6
| |-- tty7
| |-- tty8
| |-- tty9
| |-- ttyS0
| |-- ttyS1
| |-- ttyS2
| |-- ttyS3
| `-- zero
|-- etc
|-- init
|-- lib
| |-- cciss.ko
| |-- ehci-hcd.ko
| |-- ext3.ko
| |-- firmware
| |-- jbd.ko
| |-- ohci-hcd.ko
| |-- scsi_mod.ko
| |-- sd_mod.ko
| |-- uhci-hcd.ko
| `-- usb-storage.ko
|-- proc
|-- sbin -> bin
|-- sys
`-- sysroot

10 directories, 42 files

NASH Script Contents

$
cat init

#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/rtc c 10 135
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
...
...
...
...
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo "Loading uhci-hcd.ko module"
insmod /lib/uhci-hcd.ko
echo "Loading ohci-hcd.ko module"
insmod /lib/ohci-hcd.ko
echo "Loading ehci-hcd.ko module"
insmod /lib/ehci-hcd.ko
mount -t usbfs /proc/bus/usb /proc/bus/usb
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading scsi_mod.ko module"
insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
echo "Loading cciss.ko module"
insmod /lib/cciss.ko
echo "Loading usb-storage.ko module"
insmod /lib/usb-storage.ko
echo Waiting for driver initialization.
stabilized /proc/bus/usb/devices
echo Waiting for driver initialization.
stabilized --hash --interval 250 /proc/scsi/scsi
mkblkdevs
echo Scanning and configuring dmraid supported devices
resume LABEL=SW-cciss/c0d0p2
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro cciss!c0d0p1
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot

How to view the initial RAMDISK file in Redhat linux - PART 1

1.Copy the initial ramdisk to some other location as gz file

$cp /boot/initrd-2.6.18-37.el5xen.img /tmp/test/initrd-2.6.18-37.el5xen.gz

2.Decompress the file as

$
gunzip /tmp/test/initrd-2.6.18-37.el5xen.gz
$cd /tmp/test
$ls
$initrd-2.6.18-37.el5xen

3.Create a directory and use cpio command as

$ mkdir /tmp/test/initrd
$
cd /tmp/test/initrd
$
cpio -cidv -I ../initrd-2.6.18-37.el5xen

* i: Restore archive / extract
* d: Create leading directories where needed
* v: Verbose i.e. display progress
* c: Identical to "-H newc" i.e., -H FORMAT(Use archive format)., newc is a new (SVR4) portable format,which supports file
systems having more than 65536 i-nodes
* I: Archive filename to use instead of standard input

$ ls
$
bin dev etc init lib proc sbin sys sysroot

Then use the tree command to view the contents.
initrd file has a nash script that is used to load kernel modules.View the script with the command cat init to see what modules are loaded.

Virtual consoles available during Redhat installation


Ctrl+alt+F1 : Installer program in text mode
Ctrl+alt+F2 : Shell prompt
Ctrl+alt+F3 : A log of installer messages
Ctrl+alt+F4 : A log of kernel messages
Ctrl+alt+F5 : stdout from mke2fs and grub commands
Ctrl+alt+F7 : Installer program in graphical mode

How do I extract an RPM package without installing it ?

There is no direct RPM option available via rpm command to extract an RPM file. But there is a small utility available called rpm2cpio. It extract cpio archive from RPM Package Manager (RPM) package.

rpm2cpio converts the .rpm file specified as a single argument to a cpio archive on standard out.

Example

$ mkdir test
$ cd test

Extract RPM file using rpm2cpio and cpio command:

$
rpm2cpio php-5.1.6-12.el5.i386.rpm | cpio -idmv

Output of rpm2cpio piped to cpio command with the following options:

* i: Restore archive
* d: Create leading directories where needed
* m: Retain previous file modification times when creating files
* v: Verbose i.e. display progress

Output:

./etc/httpd/conf.d/php.conf
./usr/lib64/httpd/modules/libphp5.so
....
.....
..
./var/lib/php/session
./var/www/icons/php.gif
6349 blocks

Verify that you have extracted an RPM file in current directory:

$ls

Output:


etc php-5.1.4-1.esp1.x86_64.rpm usr var

This is useful if you want to extract configuration file or other file w/o installing an RPM file.

14 November 2007

How to view terminal values in UNIX/Linux?

Below command is used to view the terminal values

$stty -a

Sometimes,we may see rows & columns are displayed improperly or scattered to overcome this use the below command

$reset

Sun: Advanced Lights Out Manager

Sun™ Advanced Lights Out Manager (ALOM) is a system controller that enables you to remotely manage and administer the Sun server's.
ALOM works as soon as it is installed and power on the server. ALOM comes pre-installed on the below server models
  • Sun Fire V125 server
  • Sun Fire V210 server
  • Sun Fire V215 server
  • Sun Fire V240 server
  • Sun Fire V245 server
  • Sun Fire V250 server
  • Sun Fire V440 server
  • Sun Fire V445 server
  • Netra 210 server
  • Netra 240 server
  • Netra 440 server
ALOM enables us to monitor and control our server over a network, or by using a dedicated serial port for connection to a terminal or terminal server.
ALOM provides a command-line interface that we can use to remotely administer geographically distributed or physically inaccessible machines.
ALOM enables us to run diagnostics remotely such as power-on self-test (POST), that would otherwise require physical proximity to the server's serial port.


We can also configure ALOM to send email alerts of hardware failures, hardware warnings, and other events related to the server or to ALOM.


ALOM circuitry runs independently of the server, using the server's standby power. Therefore, ALOM firmware and software continue to function when the server operating system goes offline or when the server is powered off.

Note: Most of the people will refer this ALOM as remote console or SC console.

How to convert man pages into a text file

Sometimes it required to convert man pages into a text file.Below command will do the needful

$ man passwd | col -b > /tmp/a

where

/tmp/a is the output file location

Auto Directory Spelling Corrections

To turn/enable this feature:

$shopt -s cdspell

Now mispell a directory in the cd command

$cd /usk/localstill gets you to /usr/local
Following will list all the options of this command

$
shopt -p

Linux: How to enable root login for telnet sessions

Enable root login for telnet sessions is VERY BAD security.We have to make sure that is not configured on our production servers for this type of login.

simply edit the file /etc/securetty and add the following to the end of the file:
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9

This will allow up to 10 telnet sessions to the server as root user.

13 November 2007

Why do init scripts require lock files?

When a service is started through an init script, a file is touched in the /var/lock/subsys/ directory with the same name as the init script.

When the service is stopped,this file is removed.This file represents that a service's subsystem is locked,which means the service should be running. Since a service may consist of multiple executables with different names, finding the process ID (PID) of a single executable may not be sufficient to determine the status of the entire service itself.

For this reason, the command:
 
service "initscript" status
checks both the PID of the executable and the file in the /var/lock/subsys/ directory. If the PID is not found but the subsystem is locked, you will receive a message similar to this:
 
"service" dead but subsys locked
Managing a service's subsystem has two purposes.

I.If the service does not lock the subsystem, it can still be started and stopped through the service interface. However, when switching runlevels, the rc scripts check for the existence of the file in /var/lock/subsys/.
If this file is not found, the service will not correctly start or stop between runlevels, even if there are start and kill symbolic links in the /etc/rc#.d/ directories.

II. /var/lock/subsys/ directory is checked during reboots and shutdowns.

The order of a shutdown is as follows:
  1. Run service "initscript" stop for all known services
  2. Run kill -SIGTERM to terminate all processes
  3. Pause for five seconds
  4. Run kill -SIGKILL to kill all remaining processes
This method of shutting down is ordered such that processes are killed as gracefully as possible. During a shutdown, the script /etc/rc.d/init.d/killall checks the /var/lock/subsys/ directory to see if any subsystems are still locked. If a service's subsystem is locked after all other services have been stopped (i.e.step 1 above has completed), the killall script uses the subsystem filename to call service "initscript" stop.
This attempts to stop the service gracefully before handing off to steps 2 through 4, which forcefully terminate the process itself.

To find out if a command is aliased

Usage:

$ type -all
Example:
$ type -all ls
ls is aliased to `ls --color=tty'
ls is /bin/ls

$type -all mount
mount is /bin/mount

How do I view the contents of a .iso file in Linux?

ISO files are whole disk images. They are single image files that are used for burning to a CD or DVD.

To view the contents of a .iso file you need to mount the file as a loopback device with the following command

mount -o loop /path/to/rhel-4-U6-i386-as-disc1.iso /mount/point

An example of where this can be useful could be when setting up an installation server.

Download the required .iso files, mount them as loopback, copy all the files to a central repository, and perform an NFS installation.

Linux rpm package failed to install,How can I fix this?

Problem Statement:

I downloaded an RPM file to a Windows machine using Internet Explorer then transferred it to my Linux machine. When I try to install it with the RPM command, I immediately get a prompt back and it does not install.

Solution:

When downloading a file, IE sometimes places square brackets in the resulting filename. When the rpm command is run on a file with square brackets, it fails with no error message and does not install the package. The square brackets are a part of the Linux bash shell and are reserved for a technique called file globbing.

To fix this, rename the RPM with the mv command. When specifying the filename of the RPM at a shell prompt,type the
first few letters, then use the Tab key to autocomplete the name. This ensures that the brackets in the filename are properly delimited. Rename the file to so that it does not contain square brackets. For example:

mv kernel-2\[1\].4.21-20.EL.i686.rpm kernel-2.4.21-20.EL.i686.rpm
Alternatively, you can enclose the file in single quotes, like so:
mv 'kernel-2[1].4.21-20.EL.i686.rpm' kernel-2.4.21-20.EL.i686.rpm

After renaming the file, the rpm command can be used to install the package successfully.

How do I change the shell I use?

The chsh command can be used to change your shell.

There are other options that may be used as well. To check the available shells on your system, use the following command:
 
chsh --list
which will produce a list similar to:
/bin/sh
/bin/bash
/sbin/nologin
/bin/ash
/bin/bsh
/bin/ksh
/usr/bin/ksh
/usr/bin/pdksh
/bin/tcsh
/bin/csh

To change the shell to csh, use the command:
chsh -s /bin/csh

To verify the current shell, use the command:
echo $SHELL

Note:Above example is for the root user. Non-root users are prompted for their password before the shell is changed. These changes will take effect on the next login.

Password protect single user mode in Linux

The single user mode in Linux is considered the rescue mode.However,anyone who gets physical access to the machine could easily change the root password by booting into single user mode.

This is a security concern in Linux.

So to password protect the single user mode,add/append the following line in your
/etc/inittab file:

su:S:wait:/sbin/sulogin

Now,whenever the system is booted in single user mode,it'll first prompt for the 'root' password.

Changing the Subject in Outlook email messages

Make your email messages easier to find!
We all save email messages that are important to us. But many times the “subject line” doesn't quite describe the content or the reason you wanted to save the message. This makes it difficult to find the message without performing a search.
Wouldn't it be nice if you could change the subject line to something else? You can do this easily in Outlook 2000 and 2003:
  • Open the message
  • Highlight the text in the Subject field and retype with a more descriptive or informative title.
  • Select File/Save. (If you close the message before saving changes, Outlook will ask whether you wish to save
    changes first.)

This is especially helpful when an email thread has changed topics, but the subject line still refers to the original topic.

What IEEE 802 means?

IEEE has created an associated standard under project 802 for each medium,which was named for the month (February) and the year (1980) of its inception.Each medium has its own standard,which is named based on the 802 project.

Listed below are the medium and the respective standards

Ethernet : IEEE 802.3
Token-passing bus : IEEE 802.4
Token Ring : IEEE 802.5
Metropolitan area networks: IEEE 802.6
Wireless LANs : IEEE 802.11

Repair Corrupt RPM Database

Strange things sometimes happen, one of them is a corrupt rpm database. This means that the computer tells you something is installed and it really is not.
Here is how to solve this problem.

First backup and then delete by doing the following command:
$ su -

# cp /var/lib/rpm/__db.001 /home/test
# rm /var/lib/rpm/__db.001
# cp /var/lib/rpm/__db.002 /home/test
# rm /var/lib/rpm/ __db.002
# rpm –rebuilddb