If you are reading this you undoubtedly know how to browse the world wide web. From your workstation the best way to do that is to use netscape or mosaic. Both programs have versions to run under Xwindows, Macintosh, or Windows.
If you are travelling or at home, you can still explore the web from almost any terminal by connecting to one of our workstations and using lynx. This is particularly useful from remote places with slow access.
For other browsers see here.
The most powerful unix editor which is commonly available is "emacs". The principal virtues are that it allows for multiple windows and one can read (and save) mail from within emacs. Version 19 has some X support, with mouse driven commands.
A variant of emacs is "xemacs". Its interface has many mouse driven features which are integrated into Open Windows. It has several mail readers, of which "vm" is especially useful.
You might also try "jove", a light-weight version of emacs.
For previewing a dvi file, you can use xdvi; type ``xdvi name.dvi''.
Use either gv or ggv for viewing postscript files; some machines only have one or the other. To turn ``name.dvi'' into a postscript file do ``dvips name.dvi -o''. This creates ``name.ps.''
The epsf package is good for incorporating figures and color text into your document. See the dvips documentation for details.
To write a letter with a BNL/BSA letterhead, use this letter.tex as a sample. It must be processed with TeXsis, a local TeX macro package that is installed on all of the HET/NT computers. After writing the letter, do "texsis file.tex", then print as usual. The result should look something like this letter.ps. See Section 10 of the TeXsis manual for additional information.
To write a letter with a RIKEN/BNL letterhead, use this rikenletter.tex as a sample. It must be processed with TeXsis. The result should look something like this rikenletter.ps. The RIKEN/BNL letterhead is available only on quark.
The command "tf" will take a filename as an argument, try to decide if it is tex, latex, or texsis, and process it through to displaying it on your X window with either ghostview or gv.
The GNU g77 (Fortran), gcc (ANSI C), and g++ (ANSI C++) compilers are located in /usr/local/bin on quark.phy.bnl.gov. They were compiled for Solaris 2.6 using the egcs-2.91.66 release, so they will not work with older versions of Solaris.
Please remember not to print a .dvi file. To print a postscript file from the .dvi, do "dvips name.dvi". To produce a postscript file from the .dvi, "dvips name.dvi -o" will produce "name.ps"; you can then print name.ps on a printer by "lp -d destination name.ps", where destination is the name of the printer.
Print queue: ``lpstat''. If you have a long job which isn't going to work, please kill it. Any long jobs should probably be printed in the back room, see ``Alternate printers'' below.
Killing print jobs: First find the process number by ``lpstat''. Then kill it by typing ``cancel lp-\#'', where "lp-\#" is the process number. Alternatively, ``cancel -u username'' should cancel all your print jobs.
For long papers, and really in general, the best printer is in the library. This is very fast, and automatically prints double-sided! Do "lp -dlibrary name.ps" or "lpr -Plibrary name.ps" to print the file "name.ps".
To use the Riken printer in Rm 2-40, do ``lp -drikenpr filename''.
You can also use the HP5si double-sided Postscript printer in 2-84 and
the HP8550 Postscript printer in 1-87:
``lp -dphyhp1 filename'' for the HP5si printer
``lp -dphyhp2 filename'' for the HP8500
``lp -dphyhp2_c filename'' for the HP8500 (color)
Under "Window and link styles", your home page should be
http://thy.phy.bnl.gov/bnl.htmlTo be able to read news groups under Netscape, under ``Mail and News'' select:
News (NNTP) Server: news.bnl.govTo help load pages faster, you should use the CCD proxy server, which provides a cache for the whole Lab. Go to ``Advanced'' under the ``Preferences'' menu. Then under ``Cache'' set the disk cache to 0 kBytes and under ``Proxies'' set
HTTP Proxy: httpproxy.bnl.gov Port: 8080Also set no proxy for bnl.gov.
When you're done, choose ``Save Options''.
To quote from the ITD page on Labmail:
"Labmail is the BNL system for providing a generic e-mail address for BNL employees. This system allows people to contact registered users through an address of the form username@bnl.gov, rather than using the final destination address." To sign up, go to the above link.
This system is most useful if you know with absolute certainty that your employment at BNL will never cease. If you are not certain of this, then you should be aware that under current policy, labmail is turned off the day after your employment is terminated, with no possibility of having your email forwarded to any other account.
ftp ftpgw.sec.bnl.localAt theprompt enter
username@remote.site.nameand give your password when prompted. (Of course you should substitute the appropriate values for "remote.site.name"). For Telnet, type
telnet tngw.sec.bnl.localOnce you are connected, type
open your.remote.ip.addressand login as usual.
ssh-agent makes ssh even easier to use; it allows you to give a pass phrase once to identify yourself and then to login to remote machines without giving a password. Setting it up does require several steps:
#!/bin/sh if [ -f /usr/bin/X11/fvwm2 ] ; then if [ -f /usr/bin/ssh-agent1 ] ; then exec /usr/bin/ssh-agent /usr/bin/X11/fvwm2 else exec /usr/bin/X11/fvwm2 fi elif [ -f /usr/local/bin/fvwm2 ] ; then if [ -f /usr/local/bin/ssh-agent1 ] ; then exec /usr/local/bin/ssh-agent /usr/local/bin/fvwm2 else exec /usr/local/bin/fvwm2 fi elif [ -f /usr/local/bin/fvwm ] ; then exec /usr/local/bin/fvwm fiSee the "Secure Shell" section for a discussion of ssh-agent.
Cernlib documentation is available from CERN. The RHIC Computing Facility has local copies, although these may be out of date.
Type ``help'' for online documentation.
Control p (n) lets you flip back (forward) through the command history so you don't need to retype long lines.
We also have Doug's program ``axis''.
Once you get used to the interface, ``xfig'' makes nice line drawings.
The dumb but efficient way of using mathematica is to login to M and type
For long jobs, you need an editor. There are two ways to proceeding, each a putz. The first is to edit a file separately with the editor of your choice, and then read ``filename'' in by ``In[1]:= < < filename'' in mathematica. This is good for long files, but awkward for single lines.
If you use emacs, you can do the following. On machine M, type ``emacs &'' to open a local window running emacs off of M. Then get into shell, ``M-x shell'', and whence into Mathematica. One can then use emacs commands in the Mathematica shell. If you use tcsh, bash, etc, you will find annoying characters such as control M at the end of each line. To avoid this, add the line "setenv ESHELL /bin/csh" to your .cshrc file.
Figures: See below on setting the DISPLAY variable if you want graphics. Plots in Mathematica will pop up a new window with the graph on your screen. To save it, type
Unlike Mathematica 2, both versions 3 and 4 can use the $DISPLAY variable properly. But they still need special fonts installed in the local X-server, i.e., in your desktop machine. This requires mounting the exported Mathematica directory on your local machine with the same name as it has on the remote machine.
ps2ai file.psand then run AI on the output, which is file.ai.
Within AI, files can be saved as "file.eps", which can then be used in LaTeX, etc. Note, however, that most of the fonts with Illustrator 9 will only work under MS-Windows.
One can generate adobe figures within Mathematica, and then edit them with AI.
To draw Feynman diagrams directly with AI, use the sample files from FeynDiagram (/usr/local/src/FeynDiagram/Examples), convert to .ai format as above, and then use in AI.
mkdir $HOME/.sketch cp ~paige/.sketch/*.py $HOME/.sketchYour LD_LIBRARY_PATH needs to be properly set, e.g.,
setenv LD_LIBRARY_PATH /lib:/usr/lib:/usr/openwin/lib:/usr/local/libFor more information see the Sketch user's guide and developer's guide.
To use FeynDiagram, write a C++ program, say myfig.C, describing the diagram following the documentation in /usr/local/src/FeynDiagram/Docs and the examples in /usr/local/src/FeynDiagram/Examples on quark.phy.bnl.gov. The documentation and the examples are very good; you do not need any prior knowledge of C++. Compile your program with the GNU C++ compiler and execute it as follows:
g++ -o myfig myfig.C -lFD -lm myfig > myfig.ps ps2epsi myfig.ps myfig.eps
Before you use Star Office for the first time, you must run
/Office51/bin/setupFollow the prompts; the defaults are all reasonable. After running this setup (once), you can start Star Office by typing
~/Office51/bin/soffice [filename]You may wish to define an alias for this, e.g.,
alias soffice "~/Office51/bin/soffice \!*"
Before you use Open Office for the first time, you must run
/OpenOffice.org1.0/setupFollow the prompts; the defaults are all reasonable. After running this setup (once), you can start Open Office by typing
/OpenOffice.org1.0/program/soffice [filename]You may wish to define an alias for this, e.g.,
alias soffice "/OpenOffice.org1.0/program/soffice"
Some clever systems will try to guess who you want to reach from a guess at their address. This can be very useful for reaching someone whose address you are not sure of. For an example:
wind.phy.bnl.gov% finger gupta@lanl.gov [lanl.gov] 108097 Gupta Goutam T-10 K710 505-665-6463 099533 Gupta Rajan T-8 B285 505-667-7664 rg@lanl.govand you find Rajan's phone number and a good candidate for an email address. Sometimes it doesn't work so well:
wind.phy.bnl.gov% finger ginsparg@xxx.lanl.gov [xxx.lanl.gov]Sadly, life's mysteries must remain hidden from so many of you.
A newer version of compression is "gzip". "gzip filename" will produce "filename.gz". To uncompress, "gunzip filename.gz" will give back "filename" It is best using "gzip" and "gunzip" whenever possible. In particular, the hep server at Los Alamos now uses gzip for many papers; uncompress will not work.
If you have a file you want to uuencode, then type
Now you should know what to do with something called "file.tar.Z.uu" or "file.tar.gz.uu"
The program ``uufiles'' will put a bunch of files into an automatically unpacking compressed uuencoded tarfile ready for mailing.
To reverse the process:
Don't get too carried away with fancy html tricks, at least on your top level page. You might also check that things look O.K. under a more versitile browser, such as lynx.
Note also that web servers often log the requests they receive. Ours are logged on quark in /usr/local/etc/apache/var/log/access_log. After you set up your page, you can find out if anyone else has looked at it by grepping that file. This file is rotated twice a month since it grows so fast.
"nwreconver" is a GUI interface for backup recovery. It is considerably easier to use: you can select a date using "Browse Time" under the "Change" menu and set a recovery directory under the "Options" menu. Click on all the files or directories you want, then click "Start" (and be patient).
If you have to know more than clicking a gently pulsing, blue button, too much for me.
If this is a BNL machine, all software, including upgrades to the OS, should be paid for. Similarly, when I suggest below to back up on a hard drive, we will cover it. Don't ask for an iPod to back up, I tried it, doesn't work well, at least for me.
For personal purposes, either hardware or software, of any sort: all BNL employees, including RIKEN/BNL, are entitled to purchase items, for private use, under a Federal Employee program. This is about 20% discount off stuff from Apple. See here. So while the Cult of the Blue Button ain't cheap, could be worst. Ubuntu it ain't.
First things first - get your Firewall up! Go to the application "System Preferences" then "Sharing". Turn Firewall "On".
Under "Services", you probably want to click "Remote Login" on, so that you can login to other computers. This is also necessary for X11 to work properly.
When installing the operating system, you must do a "Custom" install, and click to install X11.
To install if OS X 10.4 is already there, see here. Basically: put your disk for OS X 10.4 in your CD drive. Look for the "Optional Installs.mpkg" program. Double click that, then install X11. By the way, just copying X11.app doesn't work.
With OS X 10.4, one must use secure SSH forwarding, by typing
"ssh -Y name@quark.phy.bnl.gov"
If you put "ForwardX11 yes" and "ForwardX11Trusted yes" lines in ~/.ssh/config and you won't need the -Y, but I just alias it. By the way, running X remotely on quark, I find Mozilla much faster than Netscape.
Only trick I know. Depress the "Apple" key, to the left or right of the spacebar, and then the "Tab" key. All of your open Applications appear in the middle of the screen as icons; keeping the Apple key depressed, repeatedly depressing the Tab key switches you between Apps. The arrow keys also work.
To have what fvwm had ten years ago, and which will be "Spaces" in Leopard, OS X 10.5, get Desktop Manager. Works well for me. Still, ain't Beryl, that's for sure.
To work behind BNL's firewall with proxies, it is easiest to do the following. In the application "System Preferences", go to "Network", then "Location", and click to create a "New Location", call it BNL, say. Then go to "Proxies", click configure "Automatically", then under "Configure Proxies" do "Using a PAC file", and enter for the PAC File URL: http://security.bnl.gov/proxy/cfg.pac .
With Opera web browser, I also have to specify this proxy as well.
This enables you to act as if you are behind a firewall. To set, in Terminal application type:
ssh -D 9999 username@server.address
"username" is you at "server.address" which is behind a firewall. Then using the Firefox browser, in "Preferences" then "Advanced" then "Network" then "Settings", click "Manual proxy configuration", then for SOCKS host, "localhost", and Port, "9999". Unfortunately, this doesn't work at BNL, they must have the firewall configured intelligently. Well, somebody's hard at work...
Go to "System Preferences" then "Network". For Airport MAC address, under "Location" then "Show: Airport", the left most bar. Your MAC address is "AirPort ID:"
For ethernet, under "Location", then "Show: Built-in Ethernet, go to right most bar, "Ethernet", your MAC address is "Ethernet ID:"
To login without typing your password: you need to have a key. You may have to do this soon, or have a cryptocard. Once you set it up, though, you don't have to keep typing in your password, which is handy.
For basics, the ITD home page is pretty good, see here.
After you do this, on the Mac a useful app is for using this is SSHKeychain. For transfering files, I like Fugu.
There are well known bugs between OS X and HP printers. For drivers which probably will work, see those helpful folks at Linuxprinting.org. For example, my HP Inkjet only works with their hpijs driver. Evidently HP wrote a "non"standard USB protocol. Uh huh. The U in USB is for, whatever.
This is the old fashioned way to work, giving you a terminal window in which you can use Emacs, do line commands, and the like. The default is bash shell. To configure prompt and aliases, enter commands such as the following into your .profile file in your home directory:
export PS1="\w> "
alias em='emacs'
BNL now has a site license, so you can get a free copy for your laptop.
To run under X11 from quark, you need to install Mathematica fonts locally. From F. Paige:
Put the Mathematica fonts somewhere, say /usr/X11R6/lib/X11/fonts/mathematica . As root do (once) "mkfontdir /usr/X11R6/lib/X11/fonts/mathematica" Then, each time you login and start X, you have to do "/usr/X11R6/bin/xset fp+ /usr/X11R6/lib/X11/fonts/mathematica/ /usr/X11R6/bin/xset fp rehash".
For example, OS X is built upon pdf, so it is much better to use pdf files than ps files. The default for opening pdf files is the Preview application. You may like that. I prefer Adobe Acrobat. To make all pdf files open with Acrobat, go to Finder, then click - once - on a pdf file. Then click "Get Info" under "File" in Finder. The fourth category down is "Open with"; you can click on that, and make all pdf files open with Adobe.
I am now back to Safari, the default web browser. Had used Opera, but a little out of date. Firefox is better as an alternate browser.
With Safari, the default to open pdf files from arXiv is in the browser. Most annoying. To avoid this, use Adobe Acrobat to open all pdf files, as explained above. Then, in "Preferences" for Adobe Acrobat, go to "Internet" and make sure that the first choice, "Display PDF in browser using" is not checked.
I like TeXShop, produces nice pdf output. Also, now it is very easy installing all of the relevant files to run TeX, just click one blue button, great for dummies.
I like to "Configure for External Editor" and use emacs in Terminal. But then I am backward.
The latest version, v. 2, has a nice feature. If you use the internal editor, you can depress the Apple key (to the left or right of the space bar), and click in the pdf file. It then goes automatically to that point in the .tex file in the editor. The converse works, as well: clicking while holding down the Apple key in the editor brings one to the relevant place in the .pdf output.
To convert .ps files to .pdf, use the Preview program. Kinda slow, but works.
The Mail program under OS X is most useful. However, as of July, 2007, you cannot forward mail from bnl.gov to mac.com; it is blocked by mac.com.
Thus you have to get mail from quark. Under preferences in Mail: account type, IMAP. Outgoing SMTP server: quark.phy.bnl.gov. Server port: 993. You don't need SSL for outgoing mail. In the Mail program, under "Preferences", then "Accounts", then "Advanced": Check "Enable this account", "Include when automatically...". Also, "Account Directory" should be ~/Library/Mail (N.B.: you do NOT need such a directory). You probably want to check "Keep copies of messages for offline viewing" so you can look things up when you don't have the Net. Check "Automatically synchronize changed mailboxes"; IMAP Path Prefix: ~/Mail. Port: 993, check "Use SSL". Authenication: password.
Every time you connect, it will ask if you accept a certificate for Frank Paige, you have to say yes, I don't know a workaround.
OS X 10.4 is most useful. It has "Smart Mailboxes", but these are NOT worth setting up; they are just folders, and do not save messages in and of themselves. Instead, OS X 10.4 is VERY fast in searching files. (This is the Spotlight feature.) Thus: generally, one has two types of mail. Stuff one wants to save, and stuff one doesn't. If you don't want to save, just delete. If you do, put all mail in one Mailbox (not a Smart Mailbox). Then, if you want to look up all emails to or from some person, go into that Mailbox, and use the "Search" feature (the box in the upper right and corner of the Mail window.)
I like Keynote, the Apple presentation program, because it is a low ball version of PowerPoint.
One useful thing is to go to "System Preferences" then "International", on the first line, then "Input Menu", extreme right. Add "Character Palatte", and check "Show input menu in menu bar". Also, add Greek to the languages. When you click on "Character palatte" in the menu bar, a window pops up, with choices for mathematical characters, arrows, and the Greek alphabet. Very useful.
For putting equations, use LaTeX Equation Editor. You type LaTeX into a box, it produces a .pdf file which you can drag and drop into your presentation. Just be sure you save all of your equations, it doesn't automatically do that.
To convert .ps or .eps files to .pdf, use the Preview application. Then you can directly insert into a slide, resize, etc.
Hard drives fail! You were warned!
Get SMARTReporter to test your hard drive. Typically, they takes days or weeks to fail, so you can backup.
If your machine is having problems: first, backup! If you don't have one now, get an external hard drive, and backup by firewire (much faster than USB 1.0). For backup, I use SuperDuper, but haven't really tried others, such as Carbon Copy Cloner or CopyCatX. The Sandbox option will only do an incremental upgrade, and so is fast. It is also useful having a copy of the OS on an external disk.
In general, a good rule of thumb when having problems is to search Google.
Magic keys: these are key combinations which you can use to boot up a Mac which is having problems. I do not see why Apple does not make this more commonly available. The above is something I stole off the Net.
If this and other attempts fail, and your stuff is backed up on an external disk, then the simplest thing is to reinstall your OS. Insert the OS disk, and reboot holding the "C" key down. You can then do an "Archive and Install", which keeps a .zip copy of your home directory. There are programs to repair a hard drive, such as Disk Utility in your "Applications, Utilities" folder; Disk Warrior, and Norton Utilities. From my experience, though, once your drive starts to go, give up, back up, get a new disk. Your time is worth more than the cost of a new disk.
Unfortunately, this may not work. If so, you have to reinstall everything. Actually, may not be that bad, if you are backed up. One note: you can NOT simply copy your Library folder, it gets confused. To transfer stuff in your Address Book, bookmarks, or similar stuff, go into Library, and transfer those individual folders. OK, not so easy...
It is remarkably easy to connect your iPod to someone else's computer, and when it asks, "Do you want to link your iPod to this library?", type yes, and wipe your iPod. Remember that Apple sells you the song once, then you're on your own. So you really, really should back up your music from iTunes.
If you do make the above mistake, you can recover, assuming you do nothing after that. The iPod is a hard drive, if you don't write over, the data is still there, and can be recovered by using a program such as PodSalvage.
To clean up duplicate files on my iPod, I found iDupe most useful.
Check out MacResearch, especially OpenMacGrid.
For tips by True Masters of OS X, suitable for physicists, see those of Warren Siegal and Hitoshi Murayama.