Paul's unix tips and FAQ page

1. How do I get the backspace key to work correctly under IRAF when using a xgterm?
2. How do I stop unresolved symbols when using f77 under Linux with Starlink linked programs?
3. How can I control spam?
4. How much disk space am I using?
5. How much disk space is available?
6. Should I use 8 or 24 bit Xwindows?
7. Unit conversion program.
8. Using ssh keys.
9. FITS header errors (possibly CRVAL2) when using fits2ndf in starlink convert.
10. Using wine to display Microsoft Office documents.
11. pine displays garbled text.
12. Computer beeps
13. Alteration to postscript files using pstoedit


1. How do I get the backspace key to work correctly under IRAF when using a xgterm?

To get the backspace key to delete characters from within a xgterm when running the iraf cl instead of producing ^H characters, edit loginuser.cl and add the following line...

!stty erase ^H

This file should be in the same directory as your login.cl file and will be automatically read each time iraf starts.

back button


2. How do I stop unresolved symbols when using f77 under Linux with Starlink linked programs?

You must use the -fno-second-underscore switch when using the f77 compiler with Starlink programs under Linux. This is due to g77 having problems with underscores in subroutines. Failure to do this will cause the linker to complain about unresolved symbols.

back button


3. How can I control spam?

The University are running a spam filter on incoming mails which is delivered to your inbox with the *****SPAM***** prefix. pine has the capability to move or delete these files automatically whenever it starts. Please note that some messages may not actually be spam, so I recommend moving possible spam emails to a separate folder and periodically deleting by hand.

At the main pine menu press...
S (setup)
R (rules)
F (rule setup is a filter)
A (add)

Press enter to edit fields in the next section.
Do not modify fields except those below.

Nickname = spam
Subject pattern = *****SPAM*****
(Filter Action = Move) Folder List = spam

E (exit)
Y (commit changes)
Y (create spam folder)
E (exit)
Y (commit changes)

back button


4. How much disk space am I using?

The diskuse command shows a table of the highest users of diskspace for a selection of both non-backed up and backed up disks. The data for the table is compiled ON THE HOUR from 7am to 7pm everyday via a perl script.

The du command (local users only) indicates the space used by files and directories. The most common switch option is -k which gives answers in 1 kilobyte block sizes, but you may find that -h under Linux the better of the two as the answers are in human readable format.

back button


5. How much disk space is available?

Disk capacities and usage are given by the df command (local users only). This however only reports filesystems that are mounted. To mount a filesystem, then all you have to do is change directory to that filesystem and then retype the df command. Similar to du, the -k and -h switch options are also available.

back button


6. Should I use 8 or 24 bit Xwindows?

Easy answer : 24 (but read on!)

There is no need to use an 8 bit display unless you require saoimage or another older display program. These were written before 24 bit displays became widely available. There are newer, better programs for displaying images, namely gaia or ds9 which run under 24 bit. Be careful when using idl as colour usage is a minefield unless you have read the documentation!

back button


7. Unit conversion program.

Type units at the command prompt.

For example if you want to convert miles to metres...

You have: miles
You want: metres
* 1609.344
/ 0.00062137119

The first answer line gives the conversion factor, the second gives the inverse.

You can type any unit in the "You have:" section and hit return twice for a definition...

You have: jansky
You want:
Definition: fluxunit = 1e-26 W/m^2 Hz = 1e-26 kg / s^2

You can also use the command non-interactively for instance...

units mile
Definition: 5280 ft = 1609.344 m

units mile m
* 1609.344
/ 0.00062137119

At the time of writing, there are 1948 different units available. There are further instructions available using man units.

back button


8. Using ssh keys.

It is possible to use the secure key method of logging in (and scp'ing) rather than having to enter your password each time...

ssh-keygen -t rsa
Generating public/private rsa key pair.

Press return to accept the defaults for the following three questions:

Enter file in which to save the key (/home/username/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

You then need to copy your public key to another file...

cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

and that's it!

back button


9. FITS header errors (possibly CRVAL2) when using fits2ndf in starlink convert.

Several FITS files have been found to have incomplete headers. This is due to missing keywords regarding axes. For each axis (the NAXIS keyword gives the total number of axes), there should be a CRVALn and a CRPIXn keyword along with other keywords that give complete axis information.

When using fits2ndf (in starlink convert), an error message may appear regarding a missing keyword. It is beneficial to add this keyword to the FITS file and then re-run fits2ndf again.

For example, you have run fits2ndf on a file called test.fits and the output informs you that there is a missing CRVAL2 keyword. You should add this keyword to the FITS file using IRAF by using either of the following methods...

cl> hedit test CRVAL2 1 add=yes

or

cl> noao
cl> imred
cl> ccdred
cl> ccdhedit test CRVAL2 1

Now re-run fits2ndf again - there should be no output errors this time.

If you have already converted from FITS to SDF format and want axes information within gaia for example (and do not have access to the original FITS file to remake the SDF), then you can use fitsmod within kappa to edit the header to add the missing keywords...

fitsmod test CRVAL2 write 1 "Dummy" !

where test is a SDF file and not FITS!

You may need to use lxset and lyset within figaro afterwards to adjust the start and end positions of the axis. You may find istat within figaro useful for this purpose.

back button


10. Using wine to display Microsoft Office documents.

You can run the wine emulator to display, edit and print Microsoft Office documents (word, excel and powerpoint).

To setup your directory, do the following...

rm -rf ~/.wine

mkdir ~/.wine

cp -av /home/star/wine/* ~/.wine

To run word type...

wine winword

To run excel type...

wine excel

To run powerpoint type...

wine powerpnt

Important notes about wine...

back button


11. pine displays garbled text.

pine may display garbled text when using an xterminal (xterm) - this is usually due to a strange character being present in the subject field.

Usually adjusting the settings within pine can alleviate this problem - at the main pine menu press...
S (setup)
C (config)
Control - W (search) and enter "character" (pressing Control - W will continue to search)
unselect (no "X" in the "[ ]" boxes) by using the "x" key the following fields...
pass-c1-control-characters-as-is
pass-control-characters-as-is
E (exit setup)
Y (commit changes)

back button


12. Computer beeps

Your computer speaker should beep when certain events take place - i.e. when new mail arrives, when there is more than one option for filename completion, etc, etc.

To turn off all beeps for the current Xwindow session, type...

xset b off

To re-enable all beeps, type...

xset b on


If you want status information for the current Xwindow session type...

xset q


To turn off beeps just for xterminals (useful if you still want a beep when new email arrives), type...

set nobeep

To re-enable xterminal beeps, type...

unset nobeep


These options can be specified in ~/.cshrc, but should be nested within a prompt loop, i.e. ...

if ( $?prompt ) then

set nobeep

endif

back button


13. Alteration to postscript files using pstoedit

Existing postscript files may be altered by first converting to xfig format and then using xfig to make alterations.

NB: It is recommended to copy the postscript file into it's own (new) directory first as multiple encapsulated postscript files may be created when the conversion takes place.

To convert the file, type...

pstoedit -f xfig file.ps file.fig

Then use xfig to make alterations on the newly created file...

xfig file.fig

back button


Valid XHTML 1.0!