Thursday, May 11, 2006 

IRIX: CHECK FOR NEW CONFIGS

SGI loves to try and simplify your life with chkconfig switches to toggle various services on
and off. After each upgrade, DOUBLE check the chkconfig switches. If something doesn't
work all of the sudden check here.

For instance, tape drives in IRIX are disabled by a default install. To enable a tape subsystem:

# chkconfig ts on

# /etc/init.d/ts start

Friday, May 05, 2006 

KILLING MORE USERS

To kill all processes of a particular user from root at unix prompt type:

# kill -9 `ps -fu username |awk '{ print $2 }'|grep -v PID`

We can also use the username as an argument and pass it from command line, if this command is put as a script.

 

CLEANING DIRECTORIES

The creation of many temporary files in Unix during compilations, occupies a lot of memory space. This can be got rid of by using a simple script.

find $1 \( -name a.out -o -name '*.o' -o -name 'core' -o -name '*.ii' -o -name '*.ti' -o -name '*.class' -o -name '*.pur' \) -exec rm {} \;

Save the above line in a file and run this file after changing permissions. For example, if the file containing the above code has the name 'clean', then:

example% clean

will remove all the files specified in the script in the directory and all other subdirectories within it. You can add or remove any number of files in the script, to suit your needs.

 

GREP TEXT NOT BINARY

In some directories such as /etc you have a mix of file types. You may want to grep out a string from one of the files but don't want to worry about the binaries, data, etc. To accomplish
this, searching only text files do this:

grep `file * | egrep 'script|text' | awk -F: '{print $1}'`

 

REBOOTING BECAUSE OF FORK BOMBS

There is nothing more frustrating for an Administrator who has to reboot system due to fork bomb

(the number of processes in the system reaches the maximum limit when a user, even a superuser, tries to execute some command, the system will respond with Vfork failed)

In Solaris under SPARC, this can be controlled by specifying a line in /etc/system

set maxuprc=64

And reboot the system. Now a user can have maximum of 64 processes under his ownership. By default the 'maxuprc' value is 16*maxusers - 5 where 'maxusers' is another tunable
parameter in /etc/system

Caution : You should have a backup of /etc/system file before you make the changes. So that you can revert back to old system file using boot -a option in case of
inconsistent system file.