ANL Physics computing, hints and kinks on the Suns

Note: some of these hints and kinks will also work on the linux machines.

How do I copy a file from the VAX

Q: How do I copy a file from the VAX analysis cluster - now that I cannot use ftp and the vaxes do not know anything about scp?

A: The vaxes DO know about ssh, so here is a trick to get a file from the vaxes over to the suns: from the unix machine type something like

    ssh user@anph04 'type file.dat' > file.dat

The idea is: you use ssh to access the vax, but rather than logging in interactively you execute the command in the quotes. This command types the file you want to get and since you redirect the output into a file (on the suns) that is called the same name, you end up with a copy on the sun. This will work for ascii files and is a lot faster than the reverse of the procedure - see next.

To transfer a file from a unix machine to the VAX: ftp the file to the gwingpc pc first, then fetch it from the VAX.

I do not exist when I say yppasswd

Q: why does the computer say I do not exist when I say yppasswd?
A: the machine is running NIS+ and you should use passwd rather than yppasswd. Yppasswd only communicates with the old NIS system which isn't running anymore on the machine you are on.

why does it say "passwd does not decrypt secret key"

Q: why does it say "passwd does not decrypt secret key" when I log in on the sun console?
A: the reason is that you have not yet made yourself a client of the NIS+ domain. You do that by, e.g.,

> keylogin
> chkey
Updating nisplus publickey database.
Generating new key for ''.
Please enter the Secure-RPC password for stanton:[1]
Please enter the login password for stanton:[2]
for [1] you type the network password which you can get from Torben Lauritsen. At [2] you type your own password. You only need to do this once. After that it will not complain again. Please note: if you just click the 'ok' box, it will let you log in anyway, so this is just a warning message.

Please note that if you do 'keylogin' or 'chkey' again, you should now use your own password for the 'Secure-RPC password' - since you by the action above changed your 'Secure-RPC password' from the default system password to your own password.

if your have just been given a new account, you should use the temp password the system administrator gave you for the 'Secure-RPC password' and not the default 'Secure-RPC password'. Only the 'old' accounts on the machine need to use the default 'Secure-RPC password'

"Sorry, wrong passwd"

Q: when I use passwd to change my passwd and I type my password in when it prompts me, why does it says "Sorry, wrong passwd" even though I KNOW I typed it right?
A: the reason is that you have not yet made yourself a client of the NIS+ domain. Fix this problem as described above 'Q: why does it say "passwd does not decryp...'


To use radware add the following lines to your .cshrc file:
# radware setup
if ( -f  /dk/bgo2/util/setup/radware ) then
  source /dk/bgo2/util/setup/radware
This setup file will add the appropriate path (depending on what UNIX platform you are on) and define some environment variables that Radware needs.

mail alias

To set up a mail alias of the type: use URL:

to archive (backup) your files

Using TAR to archive (backup) your files

change the priority of your jobs

How to use nice to change the priority of your jobs on the unix machines

eps files from Dave's Mac

How to converts eps files from Dave's Mac for use on the Suns

move a directory (with subdirs)

How to move a directory (with subdirs) from one machine to another

find the biggest files in a directory

To find the biggest files in a directory do
     ls -l | sort +4n
and to find the biggest files in a directory tree do
     ls -Rl | sort +4n

which printers are available

How do I see which printers are available on my computer?
On a linux system, more the file: /etc/printcap
On a Solaris machine, type
  niscat printers.org_dir
or just "printers" which is aliased to the above command

scale a postscript picture

How do I scale a postscript picture for the big printer in Dave Kurth's office?
...good question, still trying to figure it out...

How do I handle mime encoded files

How do I handle mime encoded files?

On the new solaris machines, just use dtmail rather than mailtool and it will handle mimeencoded files automatically. So will pine.

On the Suns running SunOS there is a program called "mimencode" that allows you to decode mime encoded files. There is a man page for the utility. You would extract the mime encoded document, then type

        mimencode -u mime-file -o decoded-file
where 'mime-file' is the file you extracted and 'decoded-file' is the file you want the decoded file to end up in. You will have to remove ANY headers the mail utility left in extracted file before you use it. There should not be anything 'readable' in the mime-file that you input to the mimencode program with the -u option.

Mimencode is supposed to replace uuencode.

On the VMS machines: Extract the email on the VAX a file (message and all) and then exit mail. At the dollar prompt: $MUNPACK filename.ext If MUNPACK can decoded it, it will tell you the name of the new file(s) it creates.

On the Linux machines: Pine should handle mine-encoded documents internally.

postscript file from europe

Q: I have received a postscript file from europe. When I print the file, the top lines are chopped off. Can I fix that?

A: use the psresize utility. Example:

   psresize -PA4 -pletter

this command will convert a document on A4 size (european) paper to letter size (US) paper

Manually you can locate lines like

%%Page: 1 1
%%Page: 2 2
%%Page: 3 3
in the postscript file and insert the line
0 -50 translate
just after all these lines. This line will drop the origin down in the y direction by 50 ps units or 50/72 of an inch.


Revtex is available on the Solaris machines. The package is installed in /usr/local/revtex/revtex - which is really a link to the current package installed in a directory in /usr/local/revtex. Older or newer versions may also be available. Look in the /usr/local/revtex/revtex direcory for information on how to use the revtex package and for sample papers.

The style files are included by the environment variable TEXINPUTS, which is set when you start a window on the Solaris machines. If you want to use another package, change the environment variable to what you want. Currently the TEXINPUTS environment variable is set as:

setenv TEXINPUTS /usr/local/revtex/revtex4:

To use revtex3.1 version, set your TEXINPUTS environment variable to
  setenv TEXINPUTS /usr/local/revtex/revtex3.1:

move mail to inbox

Q: Is it possible to move a mail from a folder (mail file) back to the In-Box? I don't see In-Box as a folder. Is that where all the incoming messages are stored?
A:at the upper right hand corner of Suns mailtool, specify "/var/mail/your_user_name" and then use the "move" button to move mail back. "/var/mail/your_user_name" is where your inbox really is and from that point of view, it is just another (special) folder. On the SunOS machines (not Solaris) the name is "/var/spool/mail/your_user_name"; but it points to the same physical file which lives on a disk partition on our mail server.

why doesn't acroread work

Q: why doesn't acroread work properly for me?
A: chances are that you have an old .acrorc from an older version of acroread. It may not work so well with the new version of acroread. Do 'rm $HOME/.acrorc' and try again.

why doesn't acroread print

Q: why doesn't acroread print for me?
A: Printing: no document printed and/or error in lp log. When you lp, it creates a symbolic link from the spool file to the file. This saves space on the file system. Unfortunately, Acrobat creates a temporary file to spool, writes the PostScript out, and then deletes the temporary file before the lpd process can get hold of it. SOLUTION: Include the "-c" option (copy) on the lp or lpr command in the print dialog box. This forces the lp process to copy the file to the spool area instead of making a link.
'/usr/bin/lp -c' in the print window works

new SSH key,display not set properly with ssh

Q: something changed on machine xxxx. Now when I log in using ssh it nolonger sets the display properly and nothing works as it used to. Arghhh!
A: the problem might be that a new system was installed on the machine and the ID ssh uses for identification changed (the public key!). Most likely you also saw something like this warning when you logged in:
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /home2/tl/.ssh/known_hosts2 to get rid of this message.
Offending key in /home2/tl/.ssh/known_hosts2:9
RSA host key for gam3 has changed and you have requested strict checking.
do you want to continue (Yes/No):
You probably just said yes to last question and ssh logged you in anyway.

However, as it may warn you: "X11 forwarding is disabled to avoid attacks by corrupted servers." it will not set the environment up properly in that mode -- and that is the problem you see. The fix is DO TO WHAT SSH TELLS YOU TO DO: "Add correct host key in /home2/xxx/.ssh/known_hosts to get rid of this message.". Actually, the easiest thing to do is to delete the key for the computer with the problem, log in again and say 'yes' when it asks you to save the (new) public key.

This is a problem whenever the version of ssh changes; but we have to use the latest versions of ssh to avoid bugs...

why doesn't 'more' and 'vi' work properly

Q: why doesn't 'more' and 'vi' work properly on the new solaris 8 machines?
A: You probably have set an inproper LD_LIBRARY_PATH path. A proper one is set in the '/etc/csh.cshrc' file -- which you should source first in your .cshrc file. So comment out the one you have in your .cshrc file (or related file) and things will work fine.


Q: how do I use staroffice (soffice, openoffice) to read/edit MsWord documents etc.

A: To set up soffice in your directory, execute the command

The menu will guide you through the setup (select network installation). When it is done, you will have a directory "OpenOffice.org1.1.2" which contains links to the programs you need. To run soffice after the initial startup, run "OpenOffice.org1.1.2/soffice" or add OpenOffice.org1.1.1 to your path so that you can just say 'soffice'. Your word documents can be located anywhere (there is not a default 'work' area as with the older versions of soffice)

consult for details on the use of staroffice.

Soffice contains an html editor as well as calendar utilties, todo utilities, mail util, a spredsheet and a 'presentation manager'. The latter utility looks much like powerpoint.

printing from dtmail

Q: printing from dtmail (under Solaris 8) doesn't work on the networked postsript printer. What do I do?

A: The old Openwin mailtool had an option for adding a filter that would convert the mail you were printing to postscript using whatever filter you wanted (usually mp or a2ps). In dtmail this useful option is for some reason missing. However, if you create a file '.dt/types/dtmail.dt' you can filter you print data through the filter/formatter program specified in this file. The simplest thing to do is to copy a working dtmail.dt file to your directory, e.g.:

  cp ~tl/.dt/types/dtmail.dt ~/.dt/types/dtmail.dt
The filter part is the
  | /usr/local/bin/a2ps -1 -p -nP
part. Here we ask to for the mail-text to be filtered through the a2ps utility in portrait mode (-p) and on one page (-1). (-nP means, do not print from a2ps itself). The resulting output is in postscript format and will print on the printer you have specified in the 'print' menu available from the "Messages" meu option of dtmail. If you on the same menu specify '-o nobanner' in the Print Command Option, it will not waste a page printing the banner page. (I do not know how to make dtmail remember the latter option...)

The dtmail.dt file might look like this:

# Override default Print action for mailboxes 
LABEL           Print
TYPE            COMMAND
EXEC_STRING     sh -c ' \
                     dtmailpr -p -f %(File)Arg_1% | \
		     /usr/local/bin/a2ps -1 -p -nP | \
                     dtlp -u %(File)Arg_1%;' 

How do I create a pdf file

Q: How do I create a pdf file from a postscript file on the suns?

A: Say your .ps file is calle, you would then type

and the x.pdf file will be generated. The distill converter is somewhat old - so it may not do as good a job as newer version of the converter.

There is also a ps2pdf utility in /usr/local/bin which might do just as good a job.

How do I select transparencies on the hp4550/phaser printer?

To print on transparencies on a hp4550 color printer, type:
hp4550trans < | lp -d fwhp4550
The hp4550trans program will add a magic header line - which will switch the printer into using transparencies.

For the Phaser printers, type:

phasertrans < | lp -d p8200dp1

How do I see what is on a tartape?

Put the tape in a tape drive and position it at the start of the the file you want to inspect, e.g.:
  mt -f /dev/rmt/1mbn rew
  mt -f /dev/rmt/1mbn fsf 3
- in this example file no 3 on drive /dev/rmt/1mbn. Then you can list the content of the tar backup in that file as:
  tar -tf /dev/rmt/1mbn
To extract all the files in the tar backup
  position tape as above
  cd to directory you want to recover in
  tar -xvf /dev/rmt/1mbn
To extract a specific file called test.dat
  position tape as above
  cd to directory you want to recover in
  tar -xvf /dev/rmt/1mbn test.dat
Consult 'man tar' for more options for tar.

Why can I not read my Gammasphere tape?

Some Gammasphere tapes are written on datedrives that do compression. However, not all our tapedrives used for sorting can handle compresses 8mm tapes. In general, most of the full hight drives cannot handle comepressed tapes whereas most 1/2 hight drives CAN read compressed tapes. The only way to see if a tape is written with compression is to try to read it first in a 1/2 hight drive and then a full fight drive and see what the response is.

We do not have the ability to make Gammasphere write medium density tapes in the drives that can do compression, even if the drives are able to write without compression. The EPICS driver does not have a density (or compression) option like the workstations have.

I can't log in from outside the division/lab

With the new network configuration, you cannot ssh into just any sun from outside the division anymore. Only Sun0 is visible from oustside the division (and the lab) so you must ssh to this machine. If you need to, you can the ssh from sun0 to the specific sun that you want to reach.

more documentation than man pages

You can find a wealth of documentation for the suns by consulting the answerbook pages at sun

ssh login without passwd

Sometimes it is usefult to be able to log in to other machines that you use often without having to type your password everytime. This is possible to do with ssh. Execute the following steps and you should be able to log in from the machine you created the files on to any of the other Suns.

If you scp the file over on the maria machine, and append it to your .ssh/authorized_keys file there, you should be able to log into the maria linux cluster machines without a password as well.

reading data off a graph

use the g3data utility to trace a line in a plot in order to extract the underlying data.

my environment is messed up

If your environment is messed up (e.g., if you made a mistake when you edited ypur.cshrc) it can be a problem to get back because 'nothing works'.

In that case type

mv .cshrc .cshrc.old
cp /usr/local/etc/csh.cshrc .cshrc
source .cshrc

That should give you a new start. You can then add back (good) aliases and setups again.

Also, make sure you do not have a .login file: type 'mv .login .login.old' Some of the old SunOS .login files upsets the Solaris system, so it is better not to have a .login file.

convert color ps files to bw ps files

You can converts a color postscripts file to a bw version using the 'colorps2bwps' utility. If the utility is not in your path, you may have to type the full name
Typical use:
   colorps2bwps >

where are the man pages for the compilers?

use cman, rather than man, to find the man pages for the compiles. E.g., man cc gives help on the front-end cc; but cman cc gives you the man pages for the real cc compiler behind the front-end cc.
cman is just an alias for "man -M /opt/SUNWspro/WS6/man/"

writing CDs on the suns

You can write CDs on Bethe (located in the f-wing terminal room). Here is an example of how you could write your src directory to a CD for backup and transport: Dont' forget to remove /tmp/iso_image, or other people cannot use /tmp because it fills up. You must have /tmp/iso_image on bethe (but it does not have to be in /tmp - any local disk will do). It is not reliable to use cdrw with an isoimage that is on a remotely mounted disk.

Here is an example of how you can recover the content of the CD again in case you need to do that rather than just read the content of the CD disk.

The file format on the CDs is iso9660, so they are readable on windows machines and MACs.

To reuse a rewritable CD you must first erase it with 'cdrw -b all'. This can take a very long time, so erase the disks before you you really need them.

Use 'eject cdrom' to get the CD out of the CD drive - if the program doesn't do that for you.

writing DVDs on the SUNs

Some SUNs (currently Wigner in F-133) have DVD writers installed for making DVD archives. The SUN workstations seem to have spotty performance (i.e. sometimes they work, sometimes not) reading DVD+R media. Using DVD-R media appears to be fairly safe. However, even though the SUN may not recognize a DVD+R that it just wrote, a Linux or Win** PC may be able to access the data just fine. Go figure.

The cdrecord-ProDVD program has been installed in /usr/local to facilitate this. Type 'cdrecord-ProDVD -help' for more info. Note that in order to write to DVD media, one needs an access/security key (free for non-commercial use) to be set before running. There is a wrapper script ( in /usr/local/bin that you may use. There is a lovely GUI interface to cdrecord-ProDVD called xcdroast that makes generating DVDs much easier. It not only provides a nice interface, but also takes care of little things like the security key and device permissions. Here is a brief overview for creating a DVD archive with xcdroast.

Note that a full 4.7GB DVD is equivalent to roughly 120 minutes of video. So, writing a whole 4.7 GB on a 2X DVD-R disc will take about one hour to complete. These are IDE DVD drives, not SCSI. It's not a good idea to do anything else on your computer that may be cpu or hard-disk intensive or you may just burn a coaster.

Table of Isotopes

You can view the Table of Isotopes online as
   acroread /usr/local/doc/toi/toi.pdf

deleting print jobs under solaris

You should be able to delete all you print jobs by typing
  cancel -u 'username'


  cancel -u stanton  
To see the jobs in a queue type
  lpstat -d fwhp4550
in this case for printer "fwhp4550". Identify the job you want to delete, e.g., "fwhp4550-196", and type
  cancel fwhp4550-196


Speakeasy is available on the Suns. Simply type
(notice the spelling) and it should come up. Kill netscape before you start it up or the colors will come up funny.

/usr/local/speakeasy contains help directories such as: demo, demotool, example, tutorial, help, lecture which might help beginners getting started.


A set of new compiler have been installed on the suns (Forte 7 or actually 'Sun ONE studio') and some old Fortran codes may not compile as well with f77 as they used to. The reason is that there is really nolonger an f77 compiler. See the details in: here.
I have found that the new compiler are a bit more
picky about my source codes. In case you have problems
with your codes, you can still use the old compilers,
- I did not delete them.

E.g, if 

   f77 mycode.f
fails, and you would like to use the old compiler rather than
fix the problems, do the following:

which f77

the response should be:


then the old compiler is in

               add this 
and you should be able to compile as

  /opt/SUNWspro_old/bin/f77 mycode.f
the same goes for cc and CC - although there could be problems
with libraries.


I have installed Jim Beene and Co's evapOR from ORNL ( evapOR is an improved version of PACE2. To use it you need to make an input file and run the programs as
   evapOR < my.inp
Here is an example of a most simple input file for the reaction 48Ca[Z=20]+108Pd[Z=46]@191MeV:
*TITLE  gsfma68 simulation 48Ca[Z=20]+108Pd[Z=46]@191MeV
*NAMES  152dy_191

(notice the 5 empty lines at the end). You can find documentation for the input format in '/usr/local/src/evapOR/evapOR.doc'. I don't know if the mass table is as good as it can be. I'm using the one that came with evapOR.

I can't change my password!

Q: It says permission denied or something when I try to change may password. Whats wrong?
A: Long story... but if you you type
  chkey -p
(respond with your current password) first, then you should be able to set your password with

copy 8mm tapes to DLT

Q: how do I copy a number of 8mm tapes to a DLT tape?

A: below is a script that will copy four tapes: t1,t2,t3 and t4 to a DLT tape:


#copy tapes in stacker INDRIVE to 
#OUTDRIVE (usually a DLT drive)
#with logfiles and Email notification

# indrive is 8mm tape stacker

set INDRIVE  = /dev/rmt/1mbn

# outdrive is DLT, to use compression
# specify /dev/rmt/2cbn

set OUTDRIVE = /dev/rmt/2mbn

# check output tape

echo "test for output tape..."
mt -f $OUTDRIVE status
set st = $status
if ( $st != 0) then 
  echo "output tape NOT ready - quitting..."

foreach tape ( t1 t2 t3 t4 )

# ... test if new tape is ready

  echo "test for input tape..."
  mt -f $INDRIVE status
  set st = $status
  if ( $st != 0) then 
    echo "input tape NOT ready - quitting..."
# ... copy from 8mm to DLT tape

  echo "-----> copying tape $tape"
  echo "       $INDRIVE to $OUTDRIVE "
  tcopy $INDRIVE $OUTDRIVE >! exa2dlt.$tape
# ... status

  echo "input:"
  mt -f $INDRIVE status
  echo "output:"
  mt -f $OUTDRIVE status

# ... pop the old tape

  mt -f $INDRIVE rewoffl

# ... wait for stacker

  echo "waiting for stacker..."
  sleep 180

# send Emails 

echo "... exa2dlt done" 
echo "exa2dlt done on `date` in `\pwd`" | mailx jack, 



To use it:

To run the script, log into the mashine with the tape drives,
cd to your copy directory and type

  ./exa2dlt > exa2dlt_1.log &
Here we are asking for the output from exa2dlt to be written to exa2dlt_1.log and the '&' at the end puts the script in the background so that we can log out and wait to be notified by email when the copy is done. You should be able to 'more exa2dlt_1.log' to see how far the copy is.

The output from tcopy, which shows the details from each tape copy, will be written to the logfiles:

or whatever extensions you specified. By looking in these log files
you can add up how much data you have copied to the DLT tape. Note: The
above script will not handle overfilling the DLT tape gracefully! -- so
you will have to use your own judgment as to when to change the output
DLT tape.

When you are done copying, you could use 'tdir' to list what is on the DLT tape and double check that you copied what you though you were copying. the 8mm tape drives and stacker are not all that reliable, so be sure to check that the copy was successful.

If you for some reason need to restart the copy script, do

  pkill -KILL exa2dlt
  pkill -KILL tcopy
then manually unload the tape in stacker tape drive (push the button) and put it back into the stacker cartridge again. Now close the door on the stacker and press 'esc' 'enter'. That will start the stacker sequence again. Use
  mt -f /dev/rmt/2mbn rew
to return the output DLT tape to the beginning again.

duplex printing on the Phaser printers

To print in duplex mode on the Phaser printers, type

  lp_duplex < | lp -d p8200dp1
the lp_duplex program will add the duplex command to the top of the '' postscript file before the result is piped to the 'p8200dp1' Textronics Phaser printer

Sending Email

Q: Why does my mail handler (pine/dtmail) no longer send Email out?
A: We are no longer allowed to run sendmail on the local machines. Only is allowed to run this program which actually handles the Email transactions. Thus, in pine and dtmail (or whatever mail handler you are using) you must set the outgoing SMTP server to ''.

login ok, but no display

Q:I can log in on the suns, but the display will not come up. It used to work just fine. What is wrong?
A: There could be many reasons for this, but one very common one is that you are over quota. When that happens, the display cannot be set up because ssh cannot create/modify your .Xauthority file. Clean up your account, log out and log in again. You cannot ignore the warning that you are over quota, the system will come back and bite you...

How do use root on the suns?

A: Place a file called .setuproot in your home directory with the content

# setup the version of root that you want to use. On the
# Suns, there will be various versions of root available in
#          /usr/local/root_vx.xx.xx 
# Here we select the version we want to use:

#set ROOTVERS=3.02.07
set ROOTVERS=3.10.02

# ---- you should not have to change anything below

setenv ROOTSYS /usr/local/root_v$ROOTVERS

# add a path to root

set path = ( $path /usr/local/root_v$ROOTVERS/bin )

# add corresponding sharable object library path

setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:/usr/local/root_v$ROOTVERS/lib

# unset ROOTVERS


if you say "ls /usr/local | grep root" you can see what versions of root are available. To make root available from your current window, say "resource" (which is an alias for "source ~/.cshrc"). When you log in the next time it will be available without saying resource. Also, to 'switch' version, edit .setuproot and say 'resource' PLEASE NOTE: to read an old .root (or .map) file, you may have to select the version it was created with. Unfortunately, ROOT does not always seem to be backward compatible. PLEASE NOTE: The different versions of ROOT requires different startmapaddresses, so be sure to go through the sdummyload sequence when you change to a new version and want to use shared .map files in GSSort/GSUtil PLEASE NOTE: The makefile for GSSort has been changed to use the ROOTSYS environment variable set from the .setuproot file.

using USB disks

Q:how do I use USB disks on the suns
A: Click here please.