Software and System Maintenance Tips and Tricks

Linux ext-2/ext-3 file systems for MacOS 10.5 and higher

Linux file support isn't built into MacOS X natively.
Mac OS has native support for only a few file systems. Some seismology data handling software (PASSCAL and Nanometrics) requires reading field disks written in a Linux disk format. You can download kernel extensions for support of these systems.

First, install the support base for OS X FUSE (an operating system support architecture for different file systems): a disk image (.dmg) that contains an installable package is available here. Next download the ext2 support (that uses FUSE): a disk image (.dmg) that contains an installable package is available here.

After these are installed, when you plug in an external disk (USB, Fire Wire) it will mount automatically. The Disk Utility can use FUSE features to repair and reformat the disk as well.

g77 for Intel MacOS X

g77 isn't supported in the gcc-4.x compilers
The GCC team decided to abandon g77 in favor of gfortran before gfortran was capable of compiling the full f77 language in compatibility mode. Consequently, much of the scientific Fortran community was temporarily left with unsuitable tools on Macs. This is my port of gcc-3.4.3 g77 to Intel (and PPC) Macs. It was also posted on James Wookey's Mac Eye for the Geophysics Guy site, and has also been built and distributed from Fink and the Sourceforge HPC Mac OS X site.

If you want to build it from source yourself, here are the directions. (Updated and improved on 2 Oct. 2009)

Seismology tools for Bristol Seismology

Want to add capability to your data analysis tools?
Access the tool storage area through the "Go"->"Connect to server":

Login as Guest, and mount the "Tools" directory tree. The ReadMe file contains documentation about the set of tools.

Anonymous FTP access

Want to send or retrieve files via Anonymous FTP?
Access the tool storage area through the "Go"->"Connect to server":

Login as Guest, and mount the "FTP Area" directory tree. Put files for sending to users in the top-level directory (remember to make the files readable by everybody). Users can drop files in the "incoming" directory folder. Move a file from "incoming" to your own machine to retrieve it. Files left for more than one week will be automatically removed.

Formatting LaTeX for Nature

Want to write a Nature manuscript in TeX? Here's what to do:
Use these statements as a preamble (notes at right):

\documentclass[12pt,a4paper]{article}       %12 point type, A4 paper
\usepackage{graphicx}                       %For figures in the text
\usepackage{setspace}                       %Option to double-space everything
\usepackage{lineno}                         %Option to put line numbers in text
\usepackage[sort&compress]{natbib}          %For \citep and \citet citations
\bibstyle{nature}                           %For numbered bibliography
\bibpunct[, ]{}{}{,}{s}{}{,}                %For superscript number citations
\doublespacing                              %Review copies double spaced
%                                           %End of preamble before document
\linenumbers*[1]                            %Start left margin line nos. at 1

... %Rest of document follows here

\bibliography{XXX}                          %Bibliography will be in XXX.bib

... %Figure captions, acknowledgements and extended Methods section here

\bibliography{YYY}                          %Optional Methods bib. in YYY.bib

If you need multiple reference lists (for a long Methods section, for example), you need to manually override automatic citation handling. Run bibtex to produce your reference list and insert the output by hand into your TeX document where your \bibliography{...} appears (comment out the command).
Then edit the second reference list slightly. First, add \setcounter{NAT@ctr}{XX} replacing XX with the number that you want your second reference list to begin with. Insert this command after the \begin{thebibliography} command in the TeX file!

Conversion of LaTeX documents to Word

Have a Nature manuscript written in TeX that you want to make suitable for publication?
Download latex2rtf (URL is ) and build from source code. (Sorry, no detailed instructions on building the executable. The following comments apply to latex2rtf version 2.1.0.) The program will convert TeX to RTF, which can be read using Pages or Word.

Tips on making a Nature manuscript conversion successful.

MPEG-2 (.mpg) to MPEG-4 (.mp4) file conversion

Want to view an MPEG-2 movie with vanilla QuickTime or your iPod/iPhone?
Download VLC from a download site and install it on your Mac. Versions 1.0.5 and earlier don't properly convert the format through the pull-down menu items. You must use the command line interface. This command changes an MPEG-2 file called "file.mpg" to an MPEG-4 file called "file.mp4": file.mpg --sout="#transcode{vcodec=mp4v,vb=2048,acodec=mp4a,ab=96,channels=2}:std{access=file,dst=file.mp4}"
It assumes that your current working direction is the directory containing the VLC application.

ISO file system images

Want to make an ISO image of a directory to burn to CD/DVD?
MacOS X has these features built into it. Firstly, locate the directory of which you want to make the image. (This top-level directory name will become the name of the CD/DVD if you burn it to one.) Then make an ISO file system (assuming that the directory you want to convert is called CD-IMAGE):

hdiutil makehybrid -iso -joliet -o /tmp/image.iso CD-IMAGE
This makes a new ISO file system in the Unix file called /tmp/image.iso. (The -joliet option allows lower case and Unicode file names; otherwise they will all be upper case. See man hdiutil for more options.)

If you want to burn it to a CD/DVD, load a blank one into your burner, use Disk Utility, select "Images->Burn" from the menu, navigate and select /tmp/image.iso, and you'll have a copy on your selected media.

NFS MacOS X-Unix cross-mounts

Want to mount an NFS file system that resides on a Unix system on your Mac?
You need to have the directory exported properly from the Unix side for a successful mount. Change /etc/exports on the host machine to permit export of the file system. In the export entry, make sure that the option insecure is selected, or else you will see messages like this in your Unix system's message log:

XXX mountd[4830]: authenticated mount request from HHH:923 for /ld1 (/ld1)
XXX kernel: nfsd: request from insecure port (89de148b:49384)!
After editing /etc/exports, re-run exportfs to let mountd and nfsd know that access is permitted. (If this is unsuccessful, shut down the NFS subsystem and restart it; mountd's permissions might not be properly refreshed.)

On the Mac side, in the Finder select Go->Connect to server... and type

to the prompt. dir is the directory that you want to mount from the Unix system.

Mac Magic Wake-up

Awaken from sleep
When connected to an ethernet port (note NOT Airport), you can awaken an Apple Mac from a slumbering state by sending it a magic packet. You don't need to know its IP address, just the MAC address of its Ethernet interface. Here is a MacOS X (and Linux) C program to send a wakeup packet. Code.

MPI on your Mac

LAM/MPI 7.3.1
If you want to develop and/or run MPI on a cluster of MacOS X machines, install the LAM/MPI programs and libraries. This installs documentation in your man pages and programs in /usr/local/bin. See for details. The present version only runs on homogeneous machine clusters (all PPC or all Intel); no mixed architectures, unfortunately.
G5/PPC Installer package - Pro/Intel Installer package.

File System Disaster Recovery (OBSOLETE)

Booting a workstation when its root file system disk is unusable
This can arise when the root file system disk, from which a workstation boots, becomes inoperable. It also arises when you wish to reformat or alter boot information on a disk that is working, or ailing. Procedure.

Cloning the System for a New Workstation (OBSOLETE)

Setting up a new version of the system on a new workstation
You need to do this when you are initially installing, or restoring, a system onto a disk that just has been reformatted. Procedure.

Installing New Printers (OBSOLETE)

Installing a printer on the AppleTalk/EtherTalk network using CAP
Many printers nowadays use the AppleTalk protocol to send data from the host system to the printer hanging somewhere on the network. This procedure describes how you can hook a PostScript printer or a non-PostScript printer (e.g. Hewlett-Packard LaserJets or DeskJets) to the system, via the network. Procedure.

Installing a New SCSI Disk (OBSOLETE)

Attaching a new internal or external disk to a workstation
This can arise when the root file system disk becomes inoperable, or you simply want to add a new, external disk to the system. Procedure.