mac_setup_old.html

Setting Up an OS X Mac with The Usual Suspects

I have mostly-identical Macs running OS X at both the home and the office.
I’ve spent quite a lot of time getting the usual suspects, EMACS, LaTex,
etc., running, so I have all the tools I’m used to using on Suns and other
such machines. I put this page together to share my experience in making
that happen, and hopefully save some other folks some time.


I’ve been a longtime Mac user and fan,
from way back in 1985 when my father bought
the very first 128K Mac toaster. In graduate school and during my postdoc,
I primarily used SGIs and Suns. I’ve been using Windows quite a bit, as it
is what runs on my Toshiba and Sony laptops (I’ve tried linux, but I really
needed Microsoft Office compatibility, so I found I never used it). It
did seem Apple was behind the times for a while, but with OS X they got
it right. If I buy another laptop, it will be a Powerbook. OS X simply
stomps the daylights out of Windows XP; everytime I sit down to use a
Windows box now I have an urge to hurl. I spent a lot of time getting
Windows XP installed on my wife’s PC, and trying to get all her
hardware working
with it. Yes, Windows is more prevalent,
compatible, etc., but the Mac OS just works better.


Anyway, below are some notes to help make your OS X machine lean and mean
(well, not so lean, but definitely mean). Anytime I need to set up a new Mac,
I run through the notes on this page to make sure I’ve covered everything.

Tiger

Upgrading to Tiger is well worth it – everything is snappier.
(Note on something nice that appeared in Jaguar:
The Expose navigation tool is particularly nice; hit F9, F10, or
F11 to bring different things quickly in and out of view).
Also, make frequent use of the automatic update checker, available
by clicking on “Software Update” in the System Preferences.

A Couple of Tricks

Drag the Applications folder onto the Dock. Then, if you control-click
on the Applications menu, you get something like the Windows “Start”
menu (one of the few good things about Windows that the Mac is normally
missing). You can easily navigate into subdirectories – they appear
as submenus.

Also, make a folder called “My Downloads” on the Desktop, and drag that
onto the dock too for easy access. Set Safari and similar tools to download
into that folder, so you can clean it out quickly and find things
easily.


Note that in OS X you can type “open filename” at the command line,
and it will open the file with whatever the default program is. So while on
a unix system you might type “acroread paper.pdf,” in OS X you will type
“open paper.pdf”

Speeding Things Up Slightly

OS X’s GUI has become rather bloated with superfluous animation. To help
a bit, I recommend going into the Dock settings in the System Preferances
and setting the “Minimizing using” to “Scale Effect” and turning off
“Animate opening applications.”

Mouting Fileshares in CSIP

(This will only be meaningful if you work at CSIP at Georgia Tech.) Select
“Connect to Server…” from the “Go” menu in the Finder. Our server in
CSIP, “yamsa,” does not automatically appear on the list for some reason.
So, enter smb://yamsa.ece.gatech.edu. When the dialog box appears, click
“Authenticate” – it won’t know to look for your particular personal
directory unless you do. Enter your username and
password, then use the drop-down menu
to select your file share with your login name, and you should be good
to go.


I like to have a symbolic link “u” sitting in the root directory to point
to my mounted fileshare, so I can reference files like /u/tex/myproposal.
To set up this link, you can do:

sudo ln -s /Volumes/yamsa.ece.gatech.edu /u

It will probably prompt you for the admin password.

X Windows

In the early days, if you wanted X Windows, you had to use something called
OroborOSX. Apple now has its own X11 that starts up and draws a lot faster,
which comes with Panther. To get X11
to start automatically, go to the “Accounts”
panel in the System Preferences.” Click on your account, and drag X11 into the
“Startup Items.” (Note: When I installed Panther on my old G4 from the
Panther disks, X11 was automatically included; it doesn’t seem to have been
included with my new G5. I had to download it from

www.apple.com/macosx/features/x11/download
.)


You can put custom commands in the Applications menu in Apple’s X11. I
like to customize Terminal like this:



xterm -sl 1000 -sb -rightbar


I also like to set up custom commands to log into different machines,
for instance, a Bigzilla command which executes



xterm -sl 1000 -sb rightbar -title bigzilla -e ssh bigzilla.ece.gatech.edu


There seems to be a horrible bug in the Apple X11 Customize window which
takes bits of text in the window and copies it to things you click on when
you distinctly don’t want it to do that. Luckily, you can edit the
customizations directly by modifying the text file




/Users/lanterma/Library/Preferences/com.apple.x11.plist



(Clicking on the above link will show you my X11 customization file.)

Emacs

I used to use a Carbon version of Emacs by Mindlube from
mindlube.com/products/emacs/index.html.
I’ve since switched to Aquamacs, which
is much much much nicer – it adds a lot of Mac interface conventions on top of
Emacs.


It is set up as an OS X Application, meaning you can just double-click on
it. The menus show up along the very top of the screen
as in a usual Mac application. I like putting Emacs in the Application folder
and also dragging it to the Dock for fast access.


The Emacs that comes standard with Mac OS X is a non-fancy version
that doesn’t know about mice and other such things. To be able to run
the fancy Jaguar version you downloaded from the command line, you need to do
something like the following from a Terminal or xterm:


cd /usr/bin % find the standard boring Emacs
sudo mv emacs emacs_old % move it elsewhere

and make a new file called “emacs” (also need to use sudo
to be able to edit files in /usr/bin, i.e. “sudo vi emacs”) containing:



#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$@"


Then do



sudo chmod a+x emacs


so it’s runnable as a script.


Now when you type Emacs
from the command line, it brings up the cool Panther version of Emacs.

Aaron’s .emacs File

As an aside, I’ve found it useful to have this .emacs file in my home
directory:



(setq auto-mode-alist
(cons '(".tex'" . latex-mode) auto-mode-alist))

(define-key esc-map "G" 'goto-line)


You can type Escape, capital-G, and then a line number to quickly go to a
specific line.
Also, putting in this line will make it automatically put different
syntatic features in different colors for LaTex, C, HTML, whatever…



(global-font-lock-mode 1)

Viewing Postscript

The newest version of Panther will automatically convert PS to PDF for viewing,
so there’s no longer any need for a separate postscript viewier.


Here’s some old information from when I was running Jaguar, in case that’s
useful to anyone:


There’s a nice Postscript viewer called MacGSView that now has a
Mac OS X
version. I happened to run across it at

ftp://ftp.cs.princeton.edu/pub/cs126/software

but you can probably find it elsewhere as well. (Note: when you download this,
you’ll find
that the filename is too long for Mac OS X. It will truncate at the period and
try to interpret
it as an MS Word file. So, use save to disk, and give it a smaller filename so
the .sit stays
intact.)

Fink

There’s a convenient program called
Fink
which lets you download, install,
and uninstall various programs from the open source community. Most of
the programs available using Fink come from the Linux world; nice folks
with time on their hands have worked to make these things compile and run
on OS X.


After you install Fink, you’ll need to add this line to your .bashrc file
in your home directory:


source /sw/bin/init.csh


To get programs, run sudo dselect


There’s two ways to use fink. One way is from the unix command lind.
The sudo tells the computer to run dselect as root, so that it can
modify necessary things.


The dselect
interface is ASCII terminal based, and so it’s a bit clunky, but it’s
better than the raw fink command line interface. Using dselect, you first
always want to [U]pdate the list of available packages. Then
you [S]elect
the packages you want. Once dselect is happy with your
selections, you can
[I]nstall them.


Selecting packages can get a bit confusing. Fink will want you to install
other packages which the package you want depends on. In general, you want
to go ahead and install everything it recommends, with a few important
exceptions.
One important exception is
X windows applications, which will generally ask you to install various
things with “xfree86” in the name. If you’ve already installed OroborOSX as
described above, you already have free86 floating around, and you don’t
want fink trying to install a new one. So, you want to turn off installation
of anything xfree86ish, except you do want to “install”
system-xfree86, which is just a placeholder to let Fink know you’ve
previously installed free86.


After you install something with Fink, it’s a good idea to type
source .bashrc to make sure the system knows that new things have
appeared.

LaTex

I currently recomment using Gerben Wierda’s distribution, which you can
get from i-Installer. You can also get LaTex from Fink, as described below,
but I think that’s more painful.

Getting LaTex from i-Installer

Go to
www.uoregon.edu/~koch/texshop/texshop.html
,
and scroll down to “Obtaining TexShop and TexLive-teTeX.” You want the
II2.dmg installer to install a basic LaTex system. Under “Installing,”
read the parts starting with “To install teTeX/TexLive…” and install
the packages suggested. You generally do this by clicking on a package,
clicking on the “Install & Remove” button on top, and then clicking on
“Install.” (I don’t personally use TexShop, but you may find it interesting
to try. I just use Emacs with straight LaTex since that’s what I’m used to.)
You may also find it convenient to install Xaw3d and Ghostview (I’m not sure
what the former is, but the latter needs it), as Ghostview can sometimes come
in handy. Neither are needed for LaTex, but they’re available from the II2
installer so might as well grab them while you can.


To be able to access the programs, you’ll need to set your PATH
and MANPATH variables properly in your .bashrc file (in Panther).
For instance:



export PATH=$PATH:/usr/local/bin:/Applications/MATLAB6p5p1/bin:/Developer/Tools:/usr/local/teTex/bin/powerpc-apple-darwin-current
export MANPATH=$MANPATH:/usr/local/man:/usr/local/teTex/man

Installing LaTex with Fink

(Note: the instructions listed here were made when I was using Jaguar.
I don’t know if they still apply to using Panther. I don’t recommend using
Fink to install LaTex anymore, but here’s my old instructions just in case
they come in handy…)


Before you run dselect to install LaTex, you need to run the
following command from the prompt (for some reason, texmf won’t install
it using dselect, so you need to use fink directly):



fink install tetex-texmf


Now use dselect to install
bundle-tetex. That’s the full installation of tex-related
goodness which we come to expect on our unix systems. When installing this,
you have to careful to tell it to install everything it recommends, except
for system-tetex, which is a placeholder that we
usually don’t want (this is the opposite of an X Windows application, where
we do want to use the xfree86 placeholder).
Having system-tetex selected generally screws up everything else.
(For some reason, Fink insists on highlighting it to install. You have to
use capital-Q in order to force your selection on Fink and get
bundle-tetex to install. You may have to go through several
iterations to get everything installed.) Getting LaTex installed was the most
painful of all the steps listed on this page… it’s the one place where Fink
gave me trouble. Remember, system-tetex is bad news here.

Other Useful Software

  • The Gimp
    is a very nice open source image manipulation tool, like Photoshop.
    There are several ways to get it, but the easiest is to get the self-contained
    application bundle at
    gimp-app.sourceforge.net.


  • Windows Media Player

  • RealOne Player (you have to
    look hard to find the Free RealOne Player, but it’s there!)

  • DivX codec
  • Mozilla Firefox
    is useful in case there’s a webpage
    Safari has trouble with

MATLAB

You really want to get the new MATLAB 7. It works much more like a real
Mac product than MATLAB 6.5 did, and you don’t have to install any weird
patches to get it to work under Panther.

Mac OS 9

This no longer comes automatically installed, but it’s a good idea to
install it anyway, since you might run across an old program you might want
to run.

If You’re Georgia Tech Faculty…

We’ve got site licenses for Microsoft Office 2004, Matlab, Mathematica,
and LabView. I always install all four of those. Matlab and LabView
are
available from the ECS
website; the others from the OIT website.


I was able to get the Matlab 7 to talk to the campus license server with
no problem (I never could with the older versions of Matlab.)

Aaron’s .bashrc file

Note that bash is the default shell in Panther, instead of csh. I was a rebel
for a while and tried using csh, but I’ve recently
found it easiest to just go with the flow and use bash.

Here’s my .bashrc file.
Among other cool things, this causes directory listings to show up in color.
Note there’s also a “clean” alias which lets you clean up the backup files
that emacs makes, along with various temp files that LaTex creates.



export PATH=$PATH:/usr/local/bin:/Applications/MATLAB704/bin:/Developer/Tools:/usr/local/teTex/bin/powerpc-apple-darwin-current
export MANPATH=$MANPATH:/usr/local/man:/usr/local/teTex/man


export TERM=xterm-color
export CLICOLOR=true
export LSCOLORS=exfxcxdxbxegedabagacad


source /sw/bin/init.sh


alias clean='rm -f *~ *# *.aux *.blg *.log *.dvi'
alias ls='ls -G'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'


#note you don't want to this script to
#delete the aux files; latex needs this available
#on multiple passes!
lt() {
if [ -e "$@".tex ]; then
latex "$@"
bibtex "$@"
latex "$@"
dvips -G0 -Ppdf -o "$@".ps "$@".dvi
rm -f "$@".dvi
ps2pdf "$@".ps
rm -f "$@".ps "$@".blg "$@".log
open "$@".pdf
else
echo "file does not exist"
fi
}