<<

- -4pc - -4pc Berserk User’s Guide Eric Nodwell Scott Webster Copyright © 2002-2004 Eric NodwellScott Webster

This document can be freely redistributed according to the terms of the GNU General Public License.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Foundation; with no Invariant Sections, with no Front-Cover texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Table of Contents Introduction ...... 3 What is the Berserk computer system? ...... 3 Introduction to Command Line ...... 3 Guidelines - Getting Along With Other Users ...... 4 Use the cluster Luke! ...... 4 Berserk Features ...... 4 Printing ...... 4 Setting default print options ...... 4 Setting print options from the command line ...... 6 Using xpp or kprinter instead of lpr ...... 6 Printing to espresso (colour laser printer) ...... 7 Setting the Default Printer ...... 7 How to cancel a print job ...... 8 How to print to a Berserk printer from Physics ...... 8 Windows Networking: Accessing Berserk from a lab Windows computer ...... 8 FTP: Sending and receiving large data files ...... 9 Outgoing FTP ...... 9 Incoming FTP ...... 9 Floppies and CDs ...... 9 How do a use the floppy/cdrom drive? ...... 9 Burning CDs ...... 9 The Trash: Restoring accidently deleted files ...... 11 Sound ...... 12 Configuring Sound ...... 12 Playing Audio CDs ...... 13 Scanning Images ...... 13 Software on Berserk ...... 13 Text Editors ...... 13 ...... 13 jpico and nano ...... 13 and XEmacs ...... 13 Vi, and Elvis ...... 14 LaTeX ...... 14

1 Berserk User’s Guide

- -4pc - -4pc ...... 14 TeXmacs ...... 14 Word Processing and Office Software ...... 14 OpenOffice (StarOffice) ...... 14 KOffice ...... 15 WordNet ...... 15 Reference Managers ...... 15 ...... 15 Image Manipulation and CAD ...... 15 QCad ...... 15 The GIMP ...... 15 ...... 16 ...... 16 gThumb ...... 16 Mathematics and Number Crunching (and some Plotting) ...... 16 Matlab ...... 16 ...... 17 Mathematica ...... 17 Igor Pro ...... 18 Octave ...... 18 Numerical Python, Scientific Python, SciPi and MayaVI ...... 18 FDTD ...... 18 FElt ...... 19 Plotting and Scientific ...... 19 Grace ...... 19 Gri ...... 19 ...... 19 Mathematical and Scientific Utilities ...... 20 Units ...... 20 GPeriodic ...... 20 g3data ...... 20 Qalculate ...... 20 Programming ...... 20 and KDevelop ...... 20 Python ...... 20 Lahey Fortran ...... 20 GCC Compiler (versions 2.95 and 3.2) ...... 21 /C++ and Fortran Compilers ...... 21 ATLAS, LAPACK and BLAS linear algebra libraries ...... 21 GNU Scientific Library ...... 22 netCDF ...... 22 noweb - Literate Programming ...... 22 Bluefish ...... 22 Quanta ...... 23 Viewers and Players ...... 23 XMMS ...... 23 RealPlayer ...... 23 Handy Little Utilities ...... 23 ...... 23 ImageMagick ...... 24 KSnapshot ...... 24 ps2eps, ps2pdf and pstoedit ...... 24 Tips ...... 24

2 Berserk User’s Guide

- -4pc - -4pc LaTeX Tips ...... 24 Getting Started with LaTeX ...... 24 Using Emacs to edit LaTeX files...... 24 Generating HTML from LaTeX ...... 25 Generating accents in LaTeX ...... 25 Drawing circuit diagrams with LaTeX ...... 25 Changing the print margins or paper size ...... 25 Counting the number of words in a LaTeX file ...... 26 Emacs Tips ...... 26 Changing the font size in Emacs ...... 26 Inserting special characters such as a degree sign ...... 26 Removing the Toolbar and Scrollbar ...... 26 Mutt Tips ...... 26 Using mutt and IMAP to read your physics e-mail ...... 27 Customizing the colours in mutt ...... 27 Using emacs as the mail editor with mutt ...... 28 Keyboard shortcuts in Mutt ...... 28 Pretty Printing in mutt ...... 28 Additional Assorted Tips ...... 29 My DOS text files look funny in my Linux (or vice-versa)! ...... 29 Quick command-line spell checking ...... 29 Complex Variables in C ...... 29 Accessing a Windows Share from Berserk ...... 30 Using PostScript tools to change the page size ...... 30 Renaming a group of files ...... 30 A Fast and Elegant : Blackbox ...... 31 Customization of X programs ...... 32 Using DocBook to create documentation ...... 32

Introduction This is the user documentation for the Berserk computer system in the MBE and Nano labs (Department of Physics, University of British Columbia). It is impossible to document every aspect of a complex and constantly changing computer system. In any case a complete documentation would be too long and nobody would read it. However, we hope to provide new users with enough tips and nudges to help them get started and to help avoid frustration. We hope to also show them some useful tricks which they might otherwise never discover. Finally, this is the place where we record all those details which we would otherwise forget ourselves.

There is a companion manual for system administrators, which is also available from the web site. What is the Berserk computer system?

Berserk is multi-talented Linux machine running Linux (http://ww.debian.org [http://www.debian.org]). It runs programs, contains the harddrives with users’ data, acts as a file server for Windows and Mac machines, backs up data onto tapes, and much more. Berserk is a dual-processor MP2000+ Athlon machine with 2 GB of RAM and a total of 240GB of hard disk space.

Associated with Berserk are a bunch of X-terminals, basically each a keyboard, mouse and large monitor. Some of them have sound cards and speakers. We use LTSP (Linux Terminal Server Project, http://www.ltsp.org to run our X-terminals).

3 Berserk User’s Guide

- -4pc - -4pc Introduction to Command Line Linux

There’s a lovely introduction (which I wrote) to using Linux, particularly command line-oriented stuff, which you can find here [../../linux-intro//index.html]. It’s not long, and I especially recommend it if you intend to you berserk fro programming. Guidelines - Getting Along With Other Users

Berserk is a shared facility. If you hog all the resources, you will make other people mad, and since we all know each other, that is Not A Good Thing. Keeping that in mind, here are some rules.

1. There is no fixed system for allocating resources. We expect that people will work things out with others to their mutual satisfaction. This means it’s important to talk other users!

2. Calculation jobs on berserk should always be "niced", so that people who are using the system interactively don’t get the impression that the system is sluggish. This is easy to do: just precede your command with the word nice. For example, instead of running "mycalc inputfile" run "nice mycalc input file".

3. Don’t stay logged in to an X-terminal when you are not around. This prevents other people from being able to use that terminal. It is also a security risk. If there is something you need to keep running, you don’t have to remain logged in to do this. See the section on Keeping a job running after you log out [../../linux- intro/html/long-calculations.html] in the Command Line Introduction to Linux.

4. Long calculation jobs should be run on the steamengine cluster, not on berserk, unless there is some reason they can’t run on the cluster (RAM requirements for example).

5. The amount of data which can be backed up is limited. Therefore every user has a nobackup directory. (If you don’t have one, just create one - only the name is important). Anything in this directory doesn’t get backed up. Please use it for your large data files, mp3 files, CD images and other such things. Use du -h to determine your disk usage (the option --max-depth n where n is a number may be useful.)

Use the cluster Luke!

Berserk is not really intended for long-running calculation jobs. There are now several clusters available for such purposes, our own steamengine cluster [http://www.physics.ubc.ca/mbelab/computer/steam_user/html/index.html] being one. Another cluster which anyone in physics can get an account on is the physics vn cluster. If you want an account on this system, contact Matt Choptuik ([email protected] [mailto:[email protected]]). For more information to the web site [http://laplace.physics.ubc.ca/People/matt/Doc/VN/overview.html]. In addition Westgrid will be coming on-line "soon" and will supposedely obsolete all other clusters. Berserk Features Printing

4 Berserk User’s Guide

- -4pc - -4pc Setting default print options

If you want to change the default print options, there are a number of ways you can do this. From the web interface (http://localhost:631), click on the Configure button for the printer in question.

Alternatively, from the KDE Printing Manager, click on the Instances , then click on Settings. (A few of the options in the KDE Control Center are KDE-specific: they won’t apply to non-KDE programs.)

5 Berserk User’s Guide

- -4pc - -4pc

As a third alternative, you can use the command line; see below. Setting print options from the command line

It is easiest to set print options using xpp or kprinter (see above). However, if you prefer to use the command line, this can of course be done too. To list all available options for a printer, use: lpoptions -p optra_color -l

To set a particular option as default, use something like: lpoption -p optra_color -o PrintQuality=Pres -o MediaSize=Tabloid

If you want to change the options for a single print job, use the -o flag with lpr: lpr -p optra_color -o PrintQuality=Pres -o MediaSize=Tabloid yourfile.ps Using xpp or kprinter instead of lpr

6 Berserk User’s Guide

- -4pc - -4pc

Many programs use lpr to print. This is not so convenient if you want to specify printer options, such as paper type and print quality. In this case, you can use xpp or kprinter instead. Either of these commands will open a dialog box from which you can choose print options. Programs which use lpr almost always have a setting in the print dialog for the print command. Just change this to xpp or kprinter.

Matlab and Acrobat Reader are examples of programs which use lpr to print. (KDE programs use kprinter by default.) xpp and kprinter can of course also be used from the command line to print postscript or text files: xpp file.ps Printing to espresso (colour laser printer)

In order to print directly to espresso, the colour laser printer on the 2nd floor, you need to have an account on physics, and the account name must be the same as on berserk. If this isn’t the case, you can always print to a file, copy the file to physics, something like: scp out.ps you@physics:. and print it from there with lpr -P espresso out.ps. Setting the Default Printer

For example: lpoptions - nano_lj4

You can also do this through the web interface or the KDE control center.

7 Berserk User’s Guide

- -4pc - -4pc Note

The environment variable PRINTER will probably override this default setting. You can change this environment variable with the command:

export PRINTER=nano_lj4

You can add the above line to your .bashrc file or your .bash_profile to make a permanent change. How to cancel a print job

For the Lexmark printers, if the jobs is already printing the easiest way is from the control panel on the printer itself. Press the Menu button until Cancel Job appears on the LCD display, then press the Select button.

You can of course also cancel jobs from the web interface http://localhost:631 [http://localhost:631], or from the KDE Printing Manager.

If you prefer the command line, use for example lpq -P nano_hp1 to find jobs numbers and then for example lprm -P nano_hp1 1234 to remove a job; lprm -P nano_hp1 - will remove all your jobs. How to print to a Berserk printer from Physics

Use the option -P optra_t@berserk or similar, for example: lpr -P optra_t@berserk somefile.ps

If printing directly from a program, most programs allow you to specify print options. Windows Networking: Accessing Berserk from a lab Win- dows computer

If you create a user account on a Windows machine in the lab with the same user name and password as your Berserk account, then you automatically get access to your home directory on Berserk (through Network Neighbourhood) and either the mbeuser directory or the nanolab directory, depending on which lab you are in. You can map these directories to drive letters for convenience. If you use a different user name on the Windows machine, then Windows might ask you to enter a name and password when you try to access Berserk, or it might just fail.

8 Berserk User’s Guide

- -4pc - -4pc Note

If this doesn’t work for you, come see an Administrator. The problem is most likely that you aren’t on the Samba users list, which is easy to fix. FTP: Sending and receiving large data files

Occasionally you need to send or receive data files which are too large to email. For this purpose, an anonymous ftp server is set up on berserk. Outgoing FTP

• Put your file(s) in the directory /var/ftp/pub .

• Tell the person you want to send the files to to download the files from ftp://berserk.physics.ubc.ca/pub. They should log in as "anonymous", with no password.

• Don’t forget to eventually delete the files from /var/ftp/pub . Remember the whole world can download them from there.

Incoming FTP

• Tell the person who wants to send you files to upload them to ftp://berserk.physics.ubc.ca/incoming. They should log in as "anonymous", with no password. Nothing can be downloaded from this directory.

• When the files arrive, copy them from /var/ftp/incoming to your home directory and delete the originals.

Floppies and CDs How do a use the floppy/cdrom drive?

To read a floppy or a CD-ROM, you must mount it first: mount /mnt/floppy mount /mnt/cdrom0 mount /mnt/cdrom1

The contents of the floppy or the CD are inserted into the file system at the specified directory. You can now read and write files as usual. Before you remove the floppy or the CD-ROM, you must unmount it with a command like umount /mnt/floppy. Burning CDs

9 Berserk User’s Guide

- -4pc - -4pc

The CD burner in Berserk is 24x-10x-40x speed. As usual, you have your pick of software for CD burning.

Here are some general tips for CD burning. Tip

• The ISO CD standard is really lousy (max. filename length 30 characters, doesn’t distinguish lower/uppercase letters, max. subdirectory depth 6). There are various schemes to overcome these limitations, but they aren’t necessarly compatible. This accounts for much of the pain of burning CDs.

• You should select the burn-safe option is there is one, since the hardware supports it. Some of the software (i.e. ) detects this automatically.

• "On-the-fly" burning will be a little bit faster, but might fail if there is a heavy load on berserk.

• For more detailed instructions, consult the CD-Writing HOWTO http://www.tldp.org/HOWTO/CD-Writing- HOWTO.html.

Burning CDs with GUI programs

There are several graphical programs for burning CDs. Try k3b or xcdroast.

Burning data CDs (command-line)

To create an image, put all your data file in one directory, say ~/toburn. Create the image with mkisofs - -o /tmp/image1.raw ~/toburn

The -U option will allow all filenames and directory structures, but violate the ISO standard.

The -J option will write the Microsoft standard Joliot extensions, so that long filenames appear correctly on Windows machines.

To burn an image to a CD, use cdrecord -v speed=16 dev=ATAPI:0,0,0 driveropts=burnfree -data /tmp/image1.raw

10 Berserk User’s Guide

- -4pc - -4pc Note

The device number might not be ATAPI:0,0,0 if the system is reconfigured and I don’t update the docu- mentation. You can find out what it is with cdrecord -scanbus (for scsi drives) or cdrecord dev=ATAPI -scanbus

Copying data CDs (command-line)

To copy data CDs, you first need to get a CD image readcd dev=1,0,0 f=/tmp/cdimage.raw

You can then use the cdrecord command above to write this image.

Burning a collection of music to an audio CD (command-line)

To burn an audio cd from .wav files: cdrecord -v -eject speed=4 dev=ATAPI:0,0,0 driveropts=burnfree -dao -pad *.wav

This worked for me (Scott) on April 5, 2004. I tried the same thing using k3b’s default settings (16x speed etc.) and got an audio CD with skips in it.

Copying an audio CD (command line)

To grab the CD image, with a TOC (table of contents) file: cdrdao read-cd --driver generic-mmc --datafile /tmp/cdimage.raw /tmp/toc-file

Burn it with cdrdao write --driver generic-mmc --datafile /tmp/cdimage.raw /tmp/toc-file

In theory, it should be possible to use both drives like this: cdrdao copy --source-device 0,0,0 --source-driver generic-mmc --driver generic-mmc --buffers 64

This didn’t work for me; let me know if you get it to work. The "source-device" likely needs to be changed here as well. The Trash: Restoring accidently deleted files

Berserk is configured so that files which are deleted or overwritten get moved to the user’s Trash directory. There is a limit of 50MB to the size of this directory. However, it only when you log in that the Trash directory is actually cleaned, which happens by deleting the oldest files first until the total size of deleted files is under 50MB.

For convenience, the following aliases are defined for every user: * 0.60+1em

* 0.60+1em hardrm Deletes an item without moving it to the trash. Useful for deleting CD images!

11 Berserk User’s Guide

- -4pc - -4pc * 0.60+1em trash_off Disables the trash (in the current console), so that anything which is deleted vanishes forever! This may be useful if for some reason the trash causes some problem with a particular program, or if there is some performance issue. If your simulation constantly creates and destroys temporary files, your trash could get huge without this.

* 0.60+1em trash_on Enables the trash again if it has been disabled.

One peculiarity is that you cannot delete files in your Trash directory. This is intentional, because it saves you from commands like rm -rf. Should you wish to delete files in your trash directory, you must first set this environment variable: export PROTECT_TRASH=NO

The behaviour of the trash can be configured. If you wish to modify it, copy /etc/libtrash.conf to .libtrash in your home directory and edit it. There are copious instructions included in the file. Sound Configuring Sound

Sound will work from any terminal which has a sound card and speakers. When playing sound, there are several output options. Usually whatever program you are using will have at least a couple of these options in its settings or configuration. The following list is very much an ordered list! The options at the top are the best, and it gets worse as you go down. (This just applies to our particular setup, where the terminals are using NAS.)

• NAS (Network Audio System)

• OSS (Open Sound System)

• esd (eSound)

• aRts (Analog Realtime Synthesizer)

12 Berserk User’s Guide

- -4pc - -4pc

KDE programs always use aRts, which is the worst choice. So it’s best to play sounds with non-KDE programs.

In general, for playing various audio files, is a good choice. Playing Audio CDs

To play audio CDs, insert them in the drive in berserk, then run xmms. Open a new file (or URL) and enter either /dev/cdrom0 or /dev/cdrom1. The former is the top CD-ROM drive in the case. Scanning Images

Berserk has a Umax Astra 2200 scanner connected to it. This is a pretty decent colour scanner, which even has back-lighting for scanning negatives if you should want to do that. Using the scanner is easy. Just put the thing you want to scan on the scanner bed (the scanner is in the office in room 443), then from any terminal, run either xsane or xscanimage. Both of these programs are quite easy to use. You can also scan from within the Gimp if you are familiar with that image-editing software. From within the GIMP, choose Xtns, Aquire Image, umax from the menu. Software on Berserk There is a lot of software on berserk. This list is not comprehensive. If you use something useful which is not on this list, please be kind enough to add it, so that others may benefit!

On Linux systems there tend to be many different programs which do very similar things. Within each section, programs are listed approximately according to the order which we might recommend them. This may mean that the easiest to use are listed first, or it may mean that the one with the most features is listed first.

There are two predominant Environments for Linux: KDE and Gnome. Both (as well as WindowMaker and various other window managers) are installed on Berserk. You can always run any program, whether it belongs to KDE or Gnome, in any window manager. Most users are using KDE, so in the list below where there is both a KDE and Gnome program for a specific function, I have listed only the KDE program unless the one for Gnome has some particular advantage.

Most of these programs can be found in the KDE menus if you hunt around a bit. Or you can start them from the command line. Usually you just enter the name of the program in small letters with no spaces. (So for example you can start QCad with the command qcad). Text Editors Kate

Kate is the KDE text editor. If you want a text editor with a graphical interface, this is a good one. It displays many structured documents (such as HTML files or programming code) with colouring and highlighting, and has lots of other bells and whistles. jpico and nano

These are small easy-to-use console editors which are good if you just want to quickly edit a small file and you don’t want to learn emacs or vi. They are both derivatives of the pico editor, and they both display a couple of lines of common commands at the top or bottom of the screen, so that you don’t really need to know anything to start using them. Since they run in a console, they are faster and lighter than Kate, much may be a consideration if your’re accessing berserk over a slow remote connection, or you’re just logged in with a console and not an X-terminal.

13 Berserk User’s Guide

- -4pc - -4pc Emacs and XEmacs

The most famous text editor for geeks. If you learn to use this editor, you’ll never need another editor. It runs in console or in graphics mode. You can use it to read your e-mail, or write and compile Latex files, or as a C code editor/debugger or whatever. It usually can show document structure with highlighting and coloring.

I recommend emacs over : xemacs looks better but emacs is actually more functional.

See the tips section for emacs. Vi, Vim and Elvis

These are all variants of the classic Vi editor which some people prefer to emacs. You probably want to use vim or elvis instead of vi. LaTeX

LaTeX is a document mark-up language for creating , books and theses. It is very popular in the physical sciences, because it does equations. Everything you need to use LaTeX is on berserk.

See the tips section on using LaTeX. Kile

This is a GUI editor for LaTeX, with pull-down menus from which you can select special LaTeX characters and formatting. TeXmacs

If you like emacs and you’re writing something in LaTeX, you might want to give this a spin. From the web site (http://www.texmacs.org/):

"GNU TeXmacs is a free scientific text editor, which was both inspired by TeX and GNU Emacs. The editor allows you to write structured documents via a (what-you-see-is-what-you-get) and user friendly interface. The program implements high-quality algorithms and TeX fonts, which help you to produce professionally looking documents. The high typesetting quality still goes through for automatically generated formulas, which makes TeXmacs suitable as an interface for computer algebra systems." Word Processing and Office Software OpenOffice (StarOffice)

An office suite from Sun, which is a virtual clone of Microsoft Office. It does an excellent job of reading and writing Microsoft Office files. Is also available for Windows. You can get the Win- dows version for free from http://www.openoffice.org. It is also installed on the physics server, refer to http://www.physics.ubc.ca/clab/staroffice.html.

You can run it either from the menu, or by entering ooffice on the command line.

14 Berserk User’s Guide

- -4pc - -4pc Note

Star Office and OpenOffice are identical, except that StarOffice includes a database component and costs money. KOffice

Unlike OpenOffice, KOffice is not a clone of Microsoft Office. This may be either an advantage or a disadvantage, depending on your feelings about Microsoft Office. I find the interface to be much more logical and useable. It may have have not quite a many features as OpenOffice, and it is not quite as good as reading the Microsoft Office formats. One big big advantage if you use any tools which generate PostScript graphics (quite common in Linux) is that, unlike Microsoft Office or OpenOffice, when you import a PostScript graphic, it is displayed with a very high quality on the screen (and you’re not required to print to a PostScript printer).

The main components of KOffice are kpresenter (presentations), kspread () and (word processing). There are other components for drawing, graphing, equations, flowcharts and so on. For some of these things there is other software on berserk which does the job better. Tip

When importing a PostScript graphic into KOffice, you may have to run ps2epsi on your PostScript file first. WordNet

WordNet is a dictionary, not just a spell-checker, but a real, honest to goodness dictionary with meanings in . For example, to get an overview of the meanings of "date", enter the command wn date -over. Most people will prefer to use the graphical version, which you start with wnb. Reference Managers Pybliographer

Pybliographer is a very nice, full-featured with an attractive interface. Note that you start this program with the command pybliographic, since the pybliographer command starts the command-line version, which you probably don’t want.

Homepage: http://pybliographer.org Image Manipulation and CAD QCad

QCad is am easy-to-use 2D CAD program.

Homepage: http://www.qcad.org/ The GIMP

A very powerful image manipulation program for such tasks as photo retouching, image composition and image authoring. Handles every imaginable format for bitmap images.

There is a good manual which is separate from the on-line help. It is at /usr/share/doc/-manual/html/index.html.

15 Berserk User’s Guide

- -4pc - -4pc

Homepage: http://www.gimp.org/ Inkscape

Inkscape is a vector-based drawing program which seems quite easy to use.

Homepage: http://www.inkscape.org Sodipodi

Sodipodi is a vector-based drawing program. It is similar to Inkscape (which is in fact derived from it), but I find the less intuitive). It may however be more powerful.

Homepage: http://sodipodi.sourceforge.net/ gThumb gThumb is a photo management program that is very useful for organizing albums of digital images etc. It also makes web of your photos.

Homepage: http://gthumb.sourceforge.net/ Mathematics and Number Crunching (and some Plotting) Matlab

Everyone knows Matlab. Presently Matlab 6.1 is installed.

16 Berserk User’s Guide

- -4pc - -4pc Note

Matlab seems to need special treatment (as of version 6) no run with nohup. Suppose you want to run your script called myscript.m. Start it like this:

nohup nice matlab -nojvm -r myscript

Notice that we don’t use the ampersand (&). Matlab justs seems to hang if you do. Now hit CTRL-Z to get the command prompt back. Use jobs to see your job. It will be marked as stopped. Assuming that it has job number 1, get it running with bg %1 (bg stands for "background"). Now use jobs again to confirm that it is running.

The -nojvm flag tells matlab to start without the java interpreter. A consequence of this is that matlab doesn’t use a graphical display, so it doesn’t get killed when you log out. Maple

Version 7 is installed. Access GUI with xmaple and text-window version as just maple. Please see some of the links below for useful hints. Review of first year mathemat- ics with Maple, http://www.botik.ru/~duzhin/maple/Maple.htm [http://www.botik.ru/~duzhin/maple/Maple.html] Calculus I with Maple V, http://courses.ncsu.edu/classes- a/maple_info/www/MA141Contents.html [http://courses.ncsu.edu/classes- a/maple_info/www/MA141Contents.html] MapleTech, http://web.mit.edu/maple/www/plibrary/mtn.html [http://web.mit.edu/maple/www/plibrary/mtn.html] Maple Problems, http://www.cs.utah.edu/~zachary/ [http://www.cs.utah.edu/~zachary/] Maple at MIT, http://web.mit.edu/afs/athena/software/maple/www/home.html [http://web.mit.edu/afs/athena/software/maple/www/home.html]

Mathematica

Mathematica isn’t actually installed on Berserk, however you can run it from physics with ssh: ssh yourid@physics mathematica

Replace yourid with your actual user id on physics.

Mathematica will complain about missing fonts. Just ignore these messages - the fonts are indeed present on berserk and its X-terminals.

17 Berserk User’s Guide

- -4pc - -4pc Note

You can’t run Mathematica if you’ve logged on using X-Win from a Windows machine. In this case the fonts are indeed missing. Igor Pro

The Windows version of Igor Pro runs reasonably well under emulation on Berserk. Start it with the command igor. Octave

From the web site (http://www.octave.org/):

"GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language.

Octave has extensive tools for solving common numerical linear algebra problems, finding the roots of nonlinear equa- tions, integrating ordinary functions, manipulating polynomials, and integrating ordinary differential and differential- algebraic equations. It is easily extensible and customizable via user-defined functions written in Octave’s own lan- guage, or using dynamically loaded modules written in C++, C, Fortran, or other languages."

Documentation is in /usr/share/doc/octave2.1-doc and /usr/share/doc/octave2.1-htmldoc. Numerical Python, Scientific Python, SciPi and MayaVI

Python is a high-level language which is a joy to program. My experience is that it makes a very good replacement for Matlab. Python scripts are also portable (they run on , Windows, Macs, etc...)

Numerical Python adds a fast, compact, multidimensional array language facility to Python. Most of what you need to do numerical programming in Python is here.

Numerical Python Homepage: http://www.pfdubois.com/numpy

ScientificPython is a collection of Python modules that are useful for scientific computing. In this collec- tion you will find modules that cover basic geometry (vectors, tensors, transformations, vector and tensor fields), quaternions, automatic derivatives, (linear) interpolation, polynomials, elementary statistics, non- linear least-squares fits, unit calculations, Fortran-compatible text formatting, 3D visualization via VRML, and two Tk widgets for simple line plots and 3D wireframe models. For details consult the manual at /usr/share/doc/python-scientific/HTML/Scientific.html

Scientific Python Homepage: http://starship.python.net/~hinsen/ScientificPython/

SciPy is an open source library of scientific tools for Python. SciPy supplements the popular Numeric module, gathering a variety of high level science and engineering modules together as a single package. SciPy includes modules for graphics and plotting, optimization, integration, special functions, signal and image processing, genetic algorithms, ODE solvers, and others.

SciPy homepage: http://www.scipy.org/

MayaVi is a free, easy to use scientific data visualizer. The manual is at /usr/share/doc/mayavi/guide/book1.html .

18 Berserk User’s Guide

- -4pc - -4pc FDTD

To get FDTD and CAD running properly and fast you need to make sure your LD_LIBRARY_PRELOAD and PATH environment variables are set correctly. Both need to include /usr/local/lumerical. It seems that for maxi- mum performance LD_LIBRARY_PRELOAD also needs to include /usr/local/lumerical/lib/bin/glnx86

One way to accomplish this would be to add the following to your .bashrc: if [ -z "$LD_LIBRARY_PATH" ]; then export←- LD_LIBRARY_PATH="/usr/local/lumerical:/usr/local/lumerical/lib/bin/glnx86" else export←- LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lumerical:/usr/local/lumerical/lib/bin/glnx86" fi export PATH=$PATH:/usr/local/lumerical

FElt

FElt is a free system for introductory level finite element analysis. It is primarily intended as a teaching tool for introductory type courses in finite elements. In a command line environment, FElt uses an intuitive, straightforward input syntax to describe problems. It also includes a for workstations that allows the user to set-up, solve and post-process the problem in a single CAD-like environment.

Project homepage: http://felt.sourceforge.net Plotting and Scientific Graphics

Also check out the programs in the Mathmematics section, some of which can generate plots. Grace

Grace is a graphical 2D plotting tool. It has powerful data manipulation and analysis and generates very high-quality plots.

Homepage: http://plasma-gate.weizmann.ac.il/Grace/ Gri

Gri is a language for scientific graphics programming. The word "language" is important: Gri is command-driven, not point/click.

Some users consider Gri similar to LaTeX, since both provide extensive power as a reward for tolerating a learning curve.

Gri can make x-y graphs, contour graphs, and image graphs, in PostScript and (soon) SVG formats. Control is provided over all aspects of drawing, e.g. line widths, colors, and fonts. A TeX-like syntax provides common mathematical symbols.

Homepage: http://gri.sourceforge.net/

19 Berserk User’s Guide

- -4pc - -4pc GnuPlot

A widely-used script-based plotting program. I haven’t used it myself, since I prefer gri. Mathematical and Scientific Utilities Units

This is a handy little program for converting units. It knows over 2000 different units! (e.g. kg to MeV/c^2) Just type units in a console and follow the prompts. GPeriodic

A periodic table. g3data g3data is used for extracting data from graphs. In publications graphs often are included, but the actual data is missing. g3data makes the extracting process much easier. Qalculate

Qalculate is a powerful calculator program with the ability to make plots etc.

Qalculate Homepage: http://qalculate.sourceforge.net/ Programming

Programming languages and utilities is where Linux really shines. So much so that I’m not even going to try to mention everything which is available on the system in this regard. Everyone has their favourite programming language and they are all well-supported in Linux (well except for the Microsoft Visual family!). I’ll just note a few special things here. Anjuta and KDevelop

Anjuta is a versatile Integrated Development Environment (IDE) for C and C++. It has been written for GTK+/GNOME, and features a number of advanced programming facilities. It is a graphical interface to the col- lection of command line programming tools available for Linux and UNIX systems.

Another C/C++ IDE is KDevelop. KDevelop is very slick, but is more specifically oriented to writing programs using the KDE libraries. For more generic programming, Anjuta seems to be preferable.

Homepage: http://www.anjuta.org/ Python

I just have to mention Python, because it is my favourite programming language. It is concise, readable, and portable (run it on Windows as well). With the Numerical and Scientific modules (see the section above), it can do a lot of what Matlab does, and with a surprisingly similar syntax.

Homepage: http://www.python.org/

20 Berserk User’s Guide

- -4pc - -4pc Lahey Fortran

A version of fortran which can generate parallel-tasking code for multi-processor machines. If you’re interested, borrow the manual (in the nanolab). GCC Compiler (versions 2.95 and 3.2)

GCC is the standard Linux C/C++ compiler. Version 2.95 is very stable; version 3.2 produces faster code but in rare cases might cause problems. To use version 3.2, use this command before compiling or linking:

export CC=gcc-3.2

G77 will compile Fortran 77 code, but not newer Fortran 90 or 95. Intel C/C++ and Fortran Compilers

Intel C and Fortran Compilers are available in /opt/intel/compiler70. These compilers generate code which is supposedly faster than gcc. In particular, I have observed that the gcc compiler is only able to submit 2 simultaneous float operations using Intel SSE extensions, while the icc compiler can submit 4 simultaneous float instructions, so you may see a large improvement if you can a lot of float-length floating point operations. For double-length precision, there is less difference. Documentation is in /opt/intel/compiler70/docs.

To run the fortran compiler, you must first set some environment variables. This can be done by calling:

. /opt/intel/compiler70/ia32/bin/ifcvars.sh

For the C/C++ compiler, the script is:

. /opt/intel/compiler70/ia32/bin/iccvars.sh

You can put this line in your .bash_profile to avoid typing it in every terminal. ATLAS, LAPACK and BLAS linear algebra libraries

First the : LAPACK (Linear Algebra PACKage) is the standard open-source linear algebra library. BLAS (Basic Linear Algebra Subprograms) provides the basic underlying matrix operations, things like matrix inversion and factorization. ATLAS (Automatically Tuned Linear Algebra Software) is a project to generate highly optimized BLAS and LAPACK libraries. These libraries are widely used; Matlab for example uses them as its linear algebra engine.

The default version of ATLAS on the system is optimized for Athlon processors, which is what we have in Berserk. If this is fine with you, you don’t have to do anything special to use ATLAS other than link to them - they are on the standard library path. If however you are compiling your program to run on another computer with Intel processors, you should use the libraries optimized for the Pentium III. Programs compiled for the Pentium III run just fine on Athlon processors, but the reverse is not true! The Pentium III ATLAS libraries are in /usr/lib/sse/atlas; to use them, add the path to your LD_LIBRARY_PATH variable before compiling:

export LD_LIBRARY_PATH=/usr/lib/sse/atlas

You should first check whether there are any other paths in LD_LIBRARY_PATH which you want to preserve (echo $LD_LIBRARY_PATH). If so, it is better to do:

export LD_LIBRARY_PATH="/usr/lib/sse/atlas:$LD_LIBRARY_PATH"

You can find documentation in /usr/share/doc/atlas-doc.

21 Berserk User’s Guide

- -4pc - -4pc

BLAS Homepage: http://www.netlib.org/blas/

LAPACK Homepage: http://www.netlib.org/lapack/

ATLAS Homepage: http://www.netlib.org/atlas/ GNU Scientific Library

GSL provides a modern Applications Programming Interface (API) for C , while allowing wrappers to be written for very high level languages.

The library covers the following areas,

Complex Roots ofSpecial Functions Numbers Polynomials Vectors andPermutations Sorting Matrices BLAS Support Linear Algebra Eigensystems Fast FourierQuadrature Random Transforms Numbers Quasi-Random Random Statistics Sequences Distributions Histograms N-Tuples Monte Carlo Integration Simulated Differential Interpolation Annealing Equations Numerical Chebyshev Series Differentiation Approximation Acceleration Discrete HankelRoot-Finding Minimization Transforms Least-Squares Physical IEEE Floating- Fitting Constants Point

Homepage: http://www.gnu.org/software/gsl/ netCDF

NetCDF is a standardized file format optimized for storing scientific data. There are for C, Fortran, Python, and everything else. Matlab also reads and writes NetCDF files.

To see the documentation for the C interface, browse to /usr/share/doc/netcdf-doc/guidec.html/index.html . The Fortran interface documentation is at /usr/share/doc/netcdf-doc/guidef.html/index.html . noweb - Literate Programming

"Literate Programming" is embedding documentation for a program within the program itself. It works with many different languages. If this sound interesting to you, I recommend that you check out http://shelob.ce.ttu.edu/daves/lpfaq/faq.html noweb Homepage: http://www.eecs.harvard.edu/~nr/noweb/ Bluefish

22 Berserk User’s Guide

- -4pc - -4pc

From the Bluefish website: "Bluefish is a powerful editor for experienced web designers and programmers. Bluefish supports many programming and markup languages, but it focuses on editing dynamic and interactive websites."

Bluefish Homepage: http://bluefish.openoffice.nl/ Quanta

Quanta is a web development tool designed for quick . It is affiliated with the KDE project.

Quanta Homepage: http://quanta.sourceforge.net/ Viewers and Players XMMS

XMMS is a good multimedia player. It can play most any audio format.

In the preferences section, choose OSS as the output plugin. RealPlayer

RealPlayer is used to play various media formats from Real Networks. These are often used for streaming video on the web.

To set up RealPlayer for the first time you need to follow the following steps:

Open a terminal.

Type the command unset LD_PRELOAD

Type realplay to start RealPlayer.

Click on View -> Preferences, then choose the Performance tab.

Select Esound support.

Shutdown RealPlayer and restart. Everything should now be functional.

All this will only work if your terminal uses the esd sound daemon. Ask the administrator if you have trouble. Handy Little Utilities

These are listed alphabetically, since there is no reason to recommend one over another: depends what you want to do. Also have a look at the section on Math and Scientific Utilities. wget wget is a command-line tool for downloading. Why use it instead of a browser? Well it’s more robust, and you can background it and log out while downloading large files. Use it like this: wget ftp://ftp.kernel.org/pub/linux/kernel/v2.5/linux-2.5.68.tar.bz2

It can also download with http. The -b flag will cause it to go to the background (so you don’t require nohup).

23 Berserk User’s Guide

- -4pc - -4pc Tip

One you’ve located a file with your browser which you want to download, here’s how I recommend to download it. Right click on the file in your browser, choose Copy Link Location, then open a terminal window, type wget -b and a space, then centre-click in the terminal window to paste the download location to the command line. ImageMagick

This can convert nearly any graphics format to any other. It may be easier to use the Gimp, which has a graphical interface.

Documentation for ImageMagick is at /usr/share/doc//html/ImageMagick.html. KSnapshot

A screen-grabber utility. ps2eps, ps2pdf and pstoedit

Any Linux program can create a PostScript file by printing to a file. These utilities are useful for converting to eps (Encapsulated PostScript) and PDF (Portable Document Format). pstoedit can convert PosScript to various vector graphics file formats. Tips These tips are in addition to the Command Line Introduction to Linux [../../linux-intro/html], so you should read that first. LaTeX Tips Getting Started with LaTeX

LaTeX requires some learning, that’s for sure. There are a number of books about LaTeX kicking around the lab which you can borrow. There is also a good introduction called "The Not So Short Introduction To LaTeX" on berserk. You can read it with: gv /usr/share/doc/texmf//general/lshort.ps & or print it with lpr /usr/share/doc/texmf/latex/general/lshort.ps

There is also other good documentation in the same directory. Using Emacs to edit LaTeX files.

Emacs integrates well with LaTeX. To compile your latex file from within emacs, press CTRL-c CTRL-c; to view it, press CTRL-c CTRL-c again. If you compile and get errors, CTRL-C ‘ will move the cursor to the line causing the error and display the error message.

24 Berserk User’s Guide

- -4pc - -4pc To view equations and figures nice formatted, as they will be when you compile your latex file, hit CTRL-c CTRL-c g RETURN. To edit them now, just click on them.

For more information on viewing LaTeX formatted within emacs, see the preview-latex manual http://preview- latex.sourceforge.net/manual/index.html. The section on key bindings is particularly useful.

If you’re new to either LaTeX or emacs, you may find it easier to use kile. Generating HTML from LaTeX

The program latex2html does an excellent job of generting HTML from a LaTeX file. Basic operation is simple: latex2html yourfile.

This will generate a directory with the HTML files. Equations will be rendered as graphics. The defaults work quite well, but if you want to customize the output, the documentation is at /usr/share/doc/latex2html/html/index.html [file:/usr/share/doc/latex2html/html/index.html]. Generating accents in LaTeX

Accents are well-described here: http://www.giss.nasa.gov/latex/ltx-401.html Drawing circuit diagrams with LaTeX

You can make beautiful circuit diagrams in your LaTeX file easily with the circ package. Eric has the printed documentation for this package. Changing the print margins or paper size

Many LaTeX templates, including most of the ones for journals, are based on A4 paper. If you print to letter paper, you may get very little margin at the top of the page, or you may get even get text cut-off. There are several possible solutions. They don’t all work in every case, so you may have to experiment a bit:

• Set the paper size in your LaTeX file. You would need a line like this:

\documentclass[letterpaper]{article}

This is however not such a good idea if you are using a particular journal format. In this case you don’t want to modify the journal format in any way, so it’s better to modify the ps file for printing.

• Tell dvips to force a particular paper size:

dvips -t letter -o outfile.ps infile.dvi

25 Berserk User’s Guide

- -4pc - -4pc • Tell dvips use an offset:

dvips -O 0,3cm -o outputfile.ps infile.dvi

• Use a PostScript tool to modify the ps file. See the section on using PostScript tools to change the page size.

Counting the number of words in a LaTeX file

One possibility is to use the dvi2tty command: dvi2tty test.dvi | wc -c Emacs Tips Changing the font size in Emacs

To start emacs with a certain font size, you can specify the font on the command line, for example emacs -font 6x13

To see which fonts are available on the system, use the xlsfonts command.

To change the default size, you can set corresponding X resources. The default X resources are in the file /etc/X11/Xresources. It appears however that KDE doesn’t load these. To specify your own values, put them in the file ~/.Xresources. For example, you could add these lines: emacs*font: 6x13 emacs*geometry: 80x35

This won’t take effect until either you login again, or you use the command xrdb -merge ~/.Xresources. Inserting special characters such as a degree sign

ISO characters can be inserted with CTRL-x 8. For example, to insert a degree sign, type CTRL-x 8 o. To get a list of the possible characters, type CTRL-x 8 CTRL-h. Removing the Toolbar and Scrollbar

If you’re using Emacs you’re not probably using the mouse to edit. I prefer just to remove the toolbar and scrollbar and save some screen space. Add this line to your .emacs file:

(tool-bar-mode nil) (scroll-bar-mode nil)

26 Berserk User’s Guide

- -4pc - -4pc Mutt Tips Using mutt and IMAP to read your physics e-mail

Mutt isn’t actually installed on physics. This doesn’t stop you from using it to read and store your e-mail there. We will do this with the IMAP protocol. This has the advantage that it interoperates very nicely with the WebMail program on physics, so you can switch back and forth as you like, and access all your saved mail from either.

To use IMAP with mutt, you can hit c for change folder, then enter for example: imap://[email protected]/INBOX

It will ask for your password. INBOX is a special folder which refers to your system inbox. You can substitute any mail file, and specify a complete path.

What you really want to do probably is to automate this. Just add lines like the following to your .mutt/muttrc file. (If this file doesn’t exist then create it: first create a directory .mutt, which will be hidden because it begins with a period.)

# this section configures IMAP access to physics # This assumes you store your mail in a directory called "mail". # If it is something else, like "Mail", use that instead. set spoolfile = imaps://physics.ubc.ca/INBOX set folder = imaps://physics.ubc.ca/mail set postponed = imaps://physics.ubc.ca/mail/postponed set record = imaps://physics.ubc.ca/mail/sent # Substitute your own user id here!!! set imap_user = nodwell set from = [email protected] set use_from = yes set move = no set mail_check = 90 set timeout = 15 set certificate_file = ~/.mutt/certificates

You can also specify your password with the set imap_pass option, but if you do this make sure that the read permissions for the .mutt/muttrc file for group and other are off: chmod -R go-rwx .mutt

The configuration described here actually uses IMAP over SSL, which is secure. The first time you connect, you will be asked if you want to accept a certificate. Choose to save it. Customizing the colours in mutt

Here are my colour customizations (in my .mutt/muttrc file): color normal black default color tree brightmagenta default

27 Berserk User’s Guide

- -4pc - -4pc color quoted blue default color header green default "^(From|Subject|Reply-To|To):" color attachment brightyellow red

You can find more example muttrc files on the mutt web wite, http://www.mutt.org [http://www.mutt.org]. Using emacs as the mail editor with mutt

Add the following line to your muttrc file: set editor = "/usr/bin/emacs -nw %s"

Add the following line to your .emacs file:

(load "/usr/share/emacs/site-lisp/post.el")

Keyboard shortcuts in Mutt here are a number of built in shortcuts which refer to specific mailboxes. These shortcuts can be used anywhere you are prompted for a file or mailbox path.

! refers to your $spoolfile (in- coming) mailbox > refers to your $mbox file < refers to your $record file - refers to the file you’ve last visited ~ refers to your home directory = refers to your $folder directory @alias refers to the de- fault save folder as determined by the address of the alias

Pretty Printing in mutt

The following lines in your .mutt/muttrc file will result in much prettier printing of e-mails:

28 Berserk User’s Guide

- -4pc - -4pc set print="yes" set print_split set print_command="enscript --landscape --columns="2" --header=’%n@%M:%d|%F←- %C|Pag e ($%/$=)’ --media=letter --silent --encoding=88591 --pretty-print=mail --printe r=optra_t" set print_decode

Additional Assorted Tips My DOS text files look funny in my Linux text editor (or vice-versa)!

This is one of those silly minor incompatibilities which exist for no reason at all. DOS uses CR LF to mark line ends, and Unix (and Mac) systems use LF alone. You can do the conversions from one to the other with dos2unix and unix2dos. Quick command-line spell checking

If you want to quickly check the spelling of a word without firing up StarOffice or WordNet or something, try this: echo "accomodation" | ispell -a

This returns:

& accomodation 1 0: accommodation

giving the correct spelling of accommodation. Complex Variables in C

Complex variables were not part of the original C standard, and this is a pain for numerical programming. However, they are part of the C99 standard. If you use the gcc compiler, there is a good description of using complex variables in C at http://www.fnal.gov/docs/products/gcc/v3_1/gcc.info,.Complex.html. The short story:

• Include complex.h.

• Prefix any type declaration with _Complex to make a complex type (for example _Complex double).

• Get the real and imaginary parts with crealf, creal, creall, cimagf, cimag and cimagl.

• Complex conjugation with conjf, conj and conjl.

29 Berserk User’s Guide

- -4pc - -4pc • Many mathematical functions are available for complex variables by adding a c to the standard real-valued function, for example cexp(x) is the complex-valued exp(x).

Accessing a Windows Share from Berserk

If the Windows machine is on the local network, the easiest way is with , the KDE file and web browser. Just enter lan:/ in the address bar to get a list of machines on the local network and select the one you want, then select SMB, which is the Windows Networking protocol. You can now drag and drop files in the usual way in Konqueror.

You can also use the smbmount program. You need to create an empty directory in your home directory, for example /home/you/mnt. You can then mount the Windows Share with something like:

smbmount windowscomputer /home/you/mnt -o username=yourid,password=yourpassword

The corresponding unmounting command is smbumount /home/you/mnt.

As usual, consult the man page for details.

You can also use smbclient from the command line, which has an interface similar to ftp. Consult the man page for more information. Using PostScript tools to change the page size

Sometimes you need to adjust a PostScript file before printing it. Here are some options. * 0.60+1em

* 0.60+1em Converting from A4 paper to Letter paper psresize -PA4 -pletter in.ps out.ps

* 0.60+1em Scaling and offsetting by an arbitrary amount pstops -p letter [email protected](0,3cm) in.ps out.ps

This would scale the original PostScript file by 90% and offset it by 3cm vertically.

* 0.60+1em Printing two pages on one page (2-up) pstops -p letter 2:[email protected](8.5in,0)[email protected](8.5in,5.5in) in.ps out.ps

If you’re printing from a KDE program, or if you use the kprinter command, then 2-up and 4-up printing are standard options anyway.

Renaming a group of files

The system has a command rename which can be used, but you must know some perl expressions, or at least regular expressions.

I have written a handy script group-rename which is simple to use. Type group-rename without any arguments to get a brief description and examples.

30 Berserk User’s Guide

- -4pc - -4pc Note

You must have /usr/local/scripts on your path to use group-rename. You should already, but if not, type export PATH=$PATH:/usr/local/scripts. You can add this command to your .bashrc file.) A Fast and Elegant Window Manager: Blackbox

I find KDE and GNOME to be cluttered and slow, especially starting up. An alternative which I like, and which several others have been converted to, is BlackBox. It seems to hit that sweet spot of trade-off between functionality, speed and customizability. Here’s how I suggest customizing it.

• Instead of choosing BlackBox at log-in, choose Default and create a .xsession file to specify exactly what you want started. Here’s mine.

# .xsession # Things to run at start-up

# If a is available, then let the band play! if [ -n "$AUDIOSERVER" ] ; then auplay /nobackup/eric/fun/sousa.au & elif [ -n "$ESPEAKER" ] ; then esdplay /nobackup/eric/fun/sousa.au & fi

# Start some programs aterm -geometry 80x30+0-0 & bbpager &

# Finally start the window manager blackbox

Notice bbpager: you’ll want to run it with blackbox. An important point is that everything must be started in the background by putting an ampersand after the command, with the exception of the last command, which is the window manager. When this exits, your session ends.

• Customize your menu. Put the line

session.menuFile: .blackbox/menu

Then make a directory .blackbox and a file .blackbox/menu something like this:

# Eric’s blackbox menu file [begin] () [exec] (aterm) {aterm} [exec] (galeon) {galeon} [exec] (konqueror) {konqueror}

31 Berserk User’s Guide

- -4pc - -4pc [submenu] (System Menu) [include] (/etc/X11/blackbox/blackbox-menu) [end] [submenu] (BlackBox) [config] (Settings) [stylesmenu] (Styles) {/usr/share/blackbox/styles} [stylesmenu] (My Styles) {~/.blackbox/styles} [restart] (Restart) [exit] (Exit) [end] [end]

This gives me a simple top-level menu with the two menu items I need the most (aterm and galeon) as well as access to the standard system menu when I need it. Tip

To move or resize windows, instead of trying to click and drag the tiny bottom-right corner of the window, just hold down the ALT key and click and drag anywhere in the window. The left mouse button moves the window and the right one resizes it. This trick works with quite a few window managers on Linux. Customization of X programs

Many X programs have their own methods of customization. Less known is that most also support an older technique through the file .Xresources. This can be handy when you don’t want to figure out the particular technique for each program. Here’s my .Xresources file.

! .Xresources

! emacs, xemacs emacs*Background: White emacs*Foreground: Black emacs*pointerColor: Orchid emacs*cursorColor: Orchid emacs*bitmapIcon: on emacs*font: 6x13 emacs*geometry: 80x71-0-0

! (and friends) XTerm*highlightSelection: true XTerm*scrollBar: false XTerm*font: 6x13 XTerm*geometry: 80x30+0-0 XTerm.VT100*dynamicColors: on ! Number of lines of scrollback to save XTerm*saveLines: 1500 xterm*reverseWrap: true

The .Xresources file only gets read at log-in, so if you modify it, you’ll have to log out and log back in again.

32 Berserk User’s Guide

- -4pc - -4pc Using DocBook to create documentation

This documentation is written in the DocBook format. DocBook is a markup language similar to html. A useful reference webpage is http://xml.web.cern.ch/XML/goossens/dbatcern/index.html.

33