Colby's Astro Pages > Mac OS X/UNIX FAQ

Last update to this page: $Date: 2005/06/23 19:10:40 $ $Author: colby $

Mac OS X and UNIX Related Frequently Asked Questions or Frequently Useful Comments and Knowledge:

  1. What's this about Mac OS X on Intel?
  2. I'm an astronomer, what can I do with my Mac OS X box?
    1. IDL
    2. Matlab
    3. MIRIAD
    4. Supermongo
    5. Other FAQ's
  3. Is there a local Berkeley Astronomy mail list for mac users?
  4. Can I use Mail (Mail.app)?
  5. Other software resources (Open Source/Third Party Payware)
    1. Fink
    2. Darwin Ports
    3. NetBSD Packages
    4. Berkeley Workstation Software Support Group (WSSG)
    5. Academic pricing on Microsoft, Adobe, ... products (TRC)
  6. X Window System on Mac OS X
    1. Where's X11 in Jaguar (10.2), Panther (10.3), Tiger (10.4)?
    2. Using dtmail, X Error of failed request: BadAtom (invalid Atom parameter)
  7. SSH and Mac OS X/UNIX
    1. OpenSSH and Commercial SSH
    2. OpenSSH Configuration
    3. Mixing SSH Keys
    4. Restricting Access when using Pass-phraseless Keys
    5. What is this "scp: warning: Executing scp1." about?
    6. SSH and X11 forwarding
    7. SSH and (Un)Trusted X11 Clients
    8. SSH on OS9
  8. Copying files/data (local/network)
    1. Mounting Astro Disks to your Mac (Using Samba)
    2. Changing your Samba password
    3. Departmental Backups
    4. Carbon Copy Cloner, Retrospect and others
    5. rdiff-backup
    6. rsync
  9. Accessing departmental printers
  10. Mac OS X System and Application Troubleshooting
    1. Check the logs
    2. Freeing up diskspace
    3. Preferences Corruption (plist files, XML)
    4. Repairing Permissions
    5. Removing Cache Files
    6. Boot into safe mode
  11. Software Development
    1. IBM's Fortran compiler (xlf)
    2. (Re)Installing Fortran (g77)
  12. Managing Spotlight
  13. Automater and GetPath for files in Finder
  14. Mathematica Fonts
  15. Testing your Mac with benchmarks
  16. How do I swap keyboard keys (in software)?
  17. How do I create movies?
Answers/Comments:

  1. What's this about Mac OS X on Intel?

    That's right. Apple has announced that they'll be shifting to Intel CPU's.

    Here's what is known so far:

    Probably the biggest impact will be on those software packages that take advantage of the vector processing capabilities of the G5 processor. As for Astronomy users, this makes for some seemingly bad news.

    However, if IBM/Freescale have no road map for Apple to continue adding high performance chips to its desktop and laptop line in the form of PowerPC CPU's, it won't matter if todays designs are faster than Intel's CPUs. Apple would find themselves in the same lagging price/performance curve that Sun Microsystems finds themselves in today (the opteron is breathing new life into thier hardware line, but the cost/performance ratio is still poor compared to commodity PC's and even Mac OS X solutions).

    The transition from Mac OS 9 to Mac OS X was probably more dramatic and troublesome for developers than this transition. Creating a new Intel targeted binary will mostly be a matter of recompiling. Going from OS9->OSX was far more complicated (new interface layers, new system layers, etc..)

    It should also be noted that some processing tricks today's G5 desktops use are to offload some processing to the GPU on the graphics card. These same tricks can be used on an Intel CPU based platform.

    Also, the current generation of Intel CPU's and soon to be released ones have vector processing capabilities in the form of the SSE2/SSE3 instructions (Streaming SIMD (Single-Instruction-Multiple-Data) Extensions). The SSE2/SSE3 architecture is not directly equivilent to the G5, see: Velocity Engine (Altivec) for more info.

    FNAL has pages comparing a G5 2.0GHz vs a P4 2.8GHz (800MHz FSB) and G5 2.0GHz, vs P4E 2.8GHz. Also some benchmarks of code optimized for older P4 and slightly more recent P4 based computers.

    Apple's VP Phil Schiller has emphatically stated that you will not be able to buy a generic PC and run a legal copy of Mac OS X on it.

    A side note: you can get that Intel experience right now, if you sign up for a "select" apple developer program ($500) and then purchase a "transition kit" ($1000, you get a 3.6GHz Macintel computer that from the outside appears to be a G5. Unfortunately, you have to return it at the end of 2006. If you choose to sign up for a "premeire" developer account ($3500), you can buy up to ten of the systems (making for a 10 node cluster of 3.6GHz P4 macs for $13500). (ha ha ha).

    Two last things, this move does not preclude Apple from using AMD chips. It lays the ground work for it. I wouldn't be surprised to see an AMD based Mac in the high-end by 2007.

    And, Intel is agressively pushing their processor line towards the Itanium becoming the replacement for the Xeon processor line. The Itanium's slated for 2007 are supposed to be pin compatible with Xeons being sold then (reference later). If you've not read up on Itanium floating point performance (Intel Itanium Architecture Software Developer's Manual page 193/Sec 6.3) you may want to. It's architecture gives it substantially better FP performance than altivec on G5 or Opteron today (SPEC Bench CFP2000 results: Itanium@1.6GHz, 2675; Opteron@2.2GHz, 2045; G5@2.2GHz, 1241)


  2. I'm an astronomer, what can I do with my Mac OS X box?

    "Back off man, I'm a _Scientist_."
    Here are links and information for Astronomy, signals processing and generally useful related software on Mac OS X.

    1. IDL

      IDL for Mac OS X can be downloaded for from RSI. There are departmental licenses available for use by students, researchers and professors. Contact central@astro to find out more information.


    2. Matlab

      Mathworks provides a Mac OS X version of Matlab. The WSSG has an online form for ordering academically licensed copies of Matlab.


    3. MIRIAD

      Instructions for building MIRIAD on Mac OS X.


    4. Supermongo These build instructions for Supermongo work on 10.2 and 10.3.
      mkdir /usr/local/sm
      cd /usr/local/sm

      Then get a copy of the latest version of sm and unpack it:

      scp username@astron:/apps1/sm/sm2_4_13.tar.gz
      zcat sm2_4_13.tar.gz | tar xvf -

      This will create the directory sm2_4_13. You then enter:

      cd sm2_4_13
      ./set_opts

      set_opts will ask you several questions and then configure sm for your system. Take the default choice for everything. You'll have to enter: X11 when prompted for what device to use.

      When you are done, edit src/options.h as set_opts warns you to do, deleting the first 7 lines (thus accepting licensing terms) and then enter:

      make
      make install

      Contributed by Dan Plonsey

    5. Other FAQ's

      Harvard CfA's Naomi Ridge Mac OS X info
      Oxford Astrophysics' Edd Edmondson Mac OS X info
      Marshall Perrin's Mac OS X Tips

    Question and Answers contributed to by Marshall Perrin, refinements: Colby Gutierrez-Kraybill, Mike Fitzgerald.


  3. Is there a local Berkeley Astronomy mail list for mac users?

    Yes, send e-mail to central to be added to the macusers list.


  4. Can I use Mail (Mail.app)?

    It is recommended that you use CalMail with Mac OS X Mail. Please navigate your way to Using CalMail with your address@astro.berkeley.edu


  5. Other software resources (Open Source, Third Party Payware)

    The links above for astronomical software applications may have already led you to third party software porting efforts such as Fink. Here's a quick run down on these systems, including some best practices.

    It is possible to use all of these systems on your Mac OS X machine, should you find that a mix of their strengths is better for your needs.

    1. Fink

      If you are familiar with Linux, you may recognize the term RPM. This tool allows Linux users to pass around pre-compiled binaries (and source code to build into binaries) with relative ease. There is also the Debian GNU/Linux package management tool (apt-get) and is highly popular amongst its users.

      There is a tool similar to the Debian apt-get called Fink that can be used to automatically retreive and compile packages (or download binaries directly if available) for Mac OS X. This has become the de facto standard third-party open source software distribution system for Mac OS X users, but it is by no means the only one.

      I consider it best practice to use the X11 binaries and development environment (required to build other X11 applications) from Apple and to not allow Fink to install its own copy of the X11 environment (it took about a day to compile all of X11 on my 15" 1.25GHz 1GB RAM powerbook). Saurabh Jha says that as long as you have both the X11 environment and the X11 SDK installed from the Apple OS X disc(s), and that you have installed the Fink "virtual" X11 package, Fink should not attempt to (re)compile it (See also: Where's X11 in Jaguar (10.2), Panther (10.3), Tiger (10.4)? and Fink's FAQ #3.2 on Apple X11 Binaries)

      Saurabh recommends the following best practices for using Fink:

      Install fink

      Install and Use FinkCommander

      Regularly run "fink selfupdate-rsync" (there are two selfupdate methods, cvs and rsync, the latter seems to be preferred). The selfupdate is important because it will update the list of packages fink/FinkCommander knows about, and will show you which have become outdated, as well as automatically update the core fink packages.

      Install/update packages as necessary. (I don't ususally have great luck with the recommended "fink update-all" step, because it tries to update every outdated package at once and for some reason or another sometimes fails because of lots of mutual dependencies, etc. updating packages one or a few at a time works a lot better).

      Also, in FinkCommander, you can use the Binary installer for a package if it's available (and for Tiger, most of the packages you would like are binary available). There's an issue of trusting the person who compiled that package, but I suspect anything malicious would quickly be found out, so it doesn't bother me, and using the binaries is a lot quicker.


    2. Darwin Ports

      Another option is to use Darwin Ports. This system was created by the same developers who maintain OpenDarwin. OpenDarwin is the open source UNIX (Darwin) system from which Apple has built Mac OS X. Therefore, packages from the Darwin Ports system are not quite as disconnected from the main system as Fink packages and libraries tend to be.


    3. NetBSD Packages

      A third option is the NetBSD Packages Collection. Darwin and OpenDarwin are derived from the FreeBSD and Mach 3.0 development efforts. The FreeBSD developers focused on Intel based hardware (ironically) development while the NetBSD efforts focused on a multi-platform approach. This option is here just for completeness, but you may find some aspects of this package system more useful than only using Fink or Darwin Ports.


    4. Berkeley Workstation Software Support Group (WSSG)

      The Workstation Software Support Group (WSSG) provides free software for Mac OS X. Packages include, Eudora, Fugu, Installer VISE, Library Proxy Setup, AntiVirus software and various other packages.

      I wouldn't recommend using the Norton firewall software over the firewall that comes with Mac OS X. The technology behind the Mac OS X built-in firewall is a heavily tested and open source solution that works well (See IP Firewall (ipfw))

      The WSSG also provides ordering pages for software packages with special academic pricing. These include JMP, Maple, SAS, SPSS and Tripwire.

      They also oversee UC Software Agreements with Hewlett-Packard, Legato, Wolfram, Microsoft, Oracle, PeopleSoft, RedHat, Sun Microsystems and Sybase.


    5. Academic pricing on Microsoft, Adobe, ... products (TRC)

      The UC system has negotiated special academic pricing for these major applications:

      • Microsoft Office, SQLServer, Access, Exchange, Virtual PC, ...
      • Adobe Acrobat, Photoshop, Illustrator, or the entire Creative Suite
      • Dantz Retrospect

      This is not a comprehensive list, go to Technology Resource Center's website (TRC) for more information on ordering.

      The discounts for academia are substantial. If you already have Office 2004 media, you can get an extra license for ~$40 (as of 06/06/2005).

      Paul Kalas, writes:

      "[The TRC] system was recently implemented and gives pricing that is much better than even the student/academic pricing found at TSW. The main things to watch out for is that the license, the installation CD/DVD, and the documentation are separate purchases. The install cannot be done via downloads. Note also that something like MS Office is only $42, whereas if you buy the box set from TSW it is $148.

      Technically the University is supposed to have an office where we can check-out the installation media. Since this does not exist yet at UCB, anyone who wants to order Adobe CS2 or MS Office 2004 can stop by and borrow my installation media (after I actually receive it), which means that you only have to worry about purchasing the license."


  6. X Window System on Mac OS X

    The X Window System, created at MIT, is available to run on your Mac OS X system. The user interface provided by Apple is called Aqua and is a collection of technologies, not immediately compatible with X11. You will have to install X11 on your own to get the libraries and binaries to use it.

    1. Where's X11 in Jaguar (10.2), Panther (10.3), Tiger (10.4)?

      If you find yourself still using Janguar (10.2) and you wish to use X11, you can either download the source from Apple and compile it or use Fink to install it (it will compile it unless you can find a binary distribution from Fink).

      The X11 window system comes with the install discs for Panther (on the developer disc) and Tiger (the DVD). They are part of the developer packages and require separate installation outside of the normal operating system install. Once installed, you can launch the X11 software by typing "startx" in a terminal window (should open an xterm). I recommend using this version of X11. If you use Fink, make sure that you have installed the "x11 virtual package" so that Fink does not attempt to build X11 for you.

      Once you have the Apple X11 installed, you can launch it by typing "startx" from a Terminal window.


    2. Using dtmail, X Error of failed request: BadAtom (invalid Atom parameter)

      You see the following when starting dtmail and displaying it on your mac:

      X Error of failed request: BadAtom (invalid Atom parameter)
      Major opcode of failed request: 18 (X_ChangeProperty)
      Atom id in failed request: 0xc4
      Serial number of failed request: 13
      Current serial number in output stream: 14

      And a window pops up that says:

      Mailer: ToolTalk is not initialized. Mailer cannot run without
      ToolTalk.
      Try starting /usr/dt/bin/ttsession

      This means that a program dtmail needs (ttsession) to function is not launching properly on the solaris machine. Apparently, this has to do with a change in OpenSSH 3.8 defaulting all X11 applications to not be "trusted" and therefore running in a more restrictive way. You can get around this by forcing ssh X11 tunneling to run in this trusted mode:

      See: SSH and (Un)Trusted X11 Clients

      You can also get around this by launching ttsession in a special way:

      ttsession -S -c

      This will open another shell, at which point, you can type dtmail and it should launch properly. That is, assuming you have X11 forwarding properly set up. This is one way to avoid defaulting to the FowardX11Trusted mode, a potentially dangerous security hole.

      This answer prompted and then refined by Paul Kalas and Colby.


  7. SSH and Mac OS X/UNIX

    Secure SHell is a replacement for telnet. It provides a cryptographically secure network connection to remote hosts. Use of ssh has been expanded to include tunnling of ports (X11 traffic tunneling can be made automatic) and copying of files over a standard ssh channel via scp and sftp. sftp is not a true ftp client (the protocol is different) but retains the name as it does what it says (Secure File Transfer Program).

    1. OpenSSH and Commercial SSH

      There are two major versions of SSH programs in use today.

      • The "commercial" version, written and sold by SSH Communication Security (ssh.com, free for academic use)
      • The open source version, OpenSSH (openssh.org)

      The ssh program installed on the Solaris and Linux computers maintained by central is the commercial (ssh.com) derived version. Unfortunately, all Linux distributions and Mac OS X ship with the OpenSSH version. This creates an incompatibility between command-line parameters and ssh keys.

      For example, the command-line parameters for turning X11 forwarding on or off for the commercial version are "+x" and "-x". The parameters for OpenSSH are "-X" and "-x". This can lead to confusion when you are unsure which version of ssh you'll be executing or when you are writing shell programs that may use ssh.

      To determine which version of the ssh program you are using, you can specify the "-V" option on the command-line.

      Commercial SSH (pay no attention to the "non-commercial" part):

              $ ssh -V
              ssh: SSH Secure Shell 3.2.9.1 (non-commercial version)
                   on i686-pc-linux-gnu
            
      OpenSSH:
              $ ssh -V
              OpenSSH_3.8.1p1, OpenSSL 0.9.7b 10 Apr 2003
            
      Both versions have had security flaws found and fixed. In general, it would be nicer if the Astronomy Solaris and Linux network defaulted to OpenSSH, as this is the default for most unix systems today.

      For more information, see the OpenSSH FAQ and the Wikipedia entry for Public Key Cryptography


    2. OpenSSH Configuration

      It's possible to store host specific configuration information for OpenSSH in a file called ~/.ssh/config.

      Example:

      cipher blowfish
      protocol 2
      ForwardX11 yes
      ForwardX11Trusted yes
      host celestial
              hostname celestial.berkeley.edu
              user colby
              identityfile /Users/colby/.ssh/laptop
      host nadir
              hostname nadir.berkeley.edu
              user colby
              identityfile /Users/colby/.ssh/laptop
      host cvs.mmarray.org
              hostname cvs.mmarray.org
              user colby
              ForwardX11Trusted no
              identityfile /Users/colby/.ssh/cvs-acc-mmarray
      
      These are from my laptop and show default parameters (cipher, protocol version, Forwarding info) and three host configurations, nadir my desktop Mac OS X box; celestial, a Linux based machine connected to the Astronomy Solaris/Linux network; and cvs.mmarray.org, the CVS repository site for the CARMA source tree.

      With these host configurations in place, I can type "ssh nadir" or "ssh celestial" and all of the various parameters will be used to build a connection.

      I can also do CVS updates to my copy of the CARMA source tree using a different identity key that is passwordless, but is only used for my CVS access, and can only be used if I have logged into my laptop (using a local password).

      In particular, you should notice the "identityfile" parameter. One can specify a different identity file (private key) for each host specifier. This allows you to manage separate identity files for accessing various systems. By default, OpenSSH looks only at ~/.ssh/identity for your public key authorization.


    3. Mixing SSH Keys

      It may already be painfully obvious to you that OpenSSH keys are in a different format than Commercial SSH keys. Here's a quick how to on mixing these keys between systems.

      The most likely scenario:

      You want to create a public and private key pair on your Mac and use it when logging into a Solaris/Linux machine running the Commercial SSH in the Astronomy Department.

      Run ssh-keygen on your Mac OS X machine:

      colby@nadir ~/.ssh $ ssh-keygen -f astrokey -t rsa -b 1024
      Generating public/private rsa key pair.
      Enter passphrase (empty for no passphrase): 
      Enter same passphrase again: 
      Your identification has been saved in astrokey.
      Your public key has been saved in astrokey.pub.
      The key fingerprint is:
      f3:c4:e3:3f:95:00:52:8f:5a:d0:fe:38:49:d7:51:a2 colby@nadir.berkeley.edu
      
      WARNING If you do not put in a pass-phrase, this will allow anyone who gains a copy of your private key to use it for access to any machine you've configured to accept your key. Please be careful as the risk is not only to your own personal data, but possibly the personal data and work of others on the Astronomy network.

      There will now be a private key (~/.ssh/astrokey) and a public key (~/.ssh/astrokey.pub). The permissions on astrokey should always be unreadable by "other" or "group" (e.g. "-rw-------" or 400 in octal). The astrokey.pub is the key you will copy to the remote system (Solaris/Linux) on the Astronomy network. You will first need to convert it into the format the Commercial version of SSH expects or "IETF SECSH" format.

      colby@nadir ~/.ssh $ ssh-keygen -f astrokey.pub -e > astrokey.secsh.pub
      

      As per the above explanation about the ~/.ssh/config file, create an entry for this new key pair:

      host astro
             hostname astro.berkeley.edu
             user colby
             identityfile /Users/colby/.ssh/astrokey
      

      Now copy astrokey.secsh.pub to ~/.ssh2/astrokey.secsh.pub on the Solaris/Linux computer. Then, add a key line to the file "~/.ssh2/authorization":

      colby@astron ~/.ssh2 % echo "key astrokey.secsh.pub" >> authorization
      

      If the remote host is running OpenSSH, you can take the astrokey.pub and add it to ~/.ssh/authorized_keys2 on the remote host.

      Advanced (train spotting) topics:

      It is useful to combine using ssh-agent with keys that have pass phrases. It allows you to initially type in a pass phrase, then for a configurable time period you will not be prompted for the pass phrase again if you try to log into same machine(s) using the same key.

      There is also now a program that integrates SSH keys into the standard Apple Mac OS X Keychain (SSHKeyChain).


    4. Restricting Access when using Pass-phraseless Keys

      If you have a pass-phraseless key that you want to use with a remote system running OpenSSH but you would like to restrict access for commands that are run (such as say, running a backup using rdiff-backup):

      Dean Gaudet has written an excellent HOWTO on using restricted command access with OpenSSH and rdiff-backup.


    5. What is this "scp: warning: Executing scp1." about?

      As noted above, the Astronomy Solaris and Linux computers default to using the commercial version of ssh. When you attempt to use the OpenSSH version of scp (which is just a copy over an ssh encrypted login) to copy to or from a machine that is running the commercial version of SSH, you will see "scp: warning: Executing scp1." This happens because copying over an ssh channel is not a defined standard and is incompatible between the divergent development efforts of openssh.org and ssh.com.

      You might see an error after the warning that looks like:

      scp: FATAL: Executing ssh1 in compatibility mode failed (Check that scp1 is in your PATH).

      So, the ssh daemon on the server is attempting to fulfill your copy request by falling back to an older version of scp (scp1) but is unable to find it. You should ask that a copy of scp1 be placed on the target machine so that the scp1 can continue. There is no security risk to this, as the underlying encryption layer will still be based on your uptodate ssh program.


    6. SSH and X11 forwarding

      If you wish to run X11 applications on a Solaris or Linux computer on the Astronomy network and have the windows open on your local display, you should use SSH tunneling. This improves the security of your system by only opening up authorization to the specific machine you have ssh'd to and by securing the actual X11 traffic sent on the network.

      You can use the command-line parameter "-X", e.g. "ssh -X hostname".

      By default X11 Forwarding is turned off in the ssh daemon and ssh client on your Mac OS X based computer. The daemon's default is okay, if you do not plan on running X11 applications on your local machine and displaying them on another. However, if you do wish to do this, you must enable your ssh daemon to allow this behavior.

      The Solaris and Linux computers on the network are configured to allow X11 forwarding.

      For OpenSSH (the vintage that ships with Mac OS X and Linux) you can change the default behavior of the ssh daemon by editing its configuration file "/etc/sshd_config". You can do the same for your ssh client by editing the file "/etc/ssh_config".

      Also, you can modify the ssh client configuration just for your account (i.e. not the global ssh_config file) by creating ~/.ssh/config and adding options to it.

      For the client, turn on X11 forwarding by default with:

      ForwardX11 Yes

      If you do this, you need not type "ssh -X host" to get ssh forwarding the X11 traffic.

      For the daemon, allow X11 forwarding by default with:

      X11Forwarding yes

      In Mac OS X, it's important to remember that you must be running ssh from a shell that is already "X aware". This means that you are either already executing ssh from within an xterm window, or that you have properly set your DISPLAY environment variable.


    7. SSH and (Un)Trusted X11 Clients

      When OpenSSH transitioned to 3.8, the default behavior of X11 forwarding was changed. As reported in the 3.8 release notes:

      "ssh(1) now uses untrusted cookies for X11-Forwarding. Some X11 applications might need full access to the X11 server, see ForwardX11Trusted in ssh(1) and xauth(1) for more information."

      What this means is, clients no longer have full access to all information on the root X display to which windows are opened (your desktop/laptop). This creates a problem with running ttsession (and thus dtmail) and also leads to the bad behavior of xterm crashing, as reported by Marshall Perrin. The bug manifests when pasting from a remotely opened xterm to a locally open one.

      To avoid these problems, you can add the following to either ~/.ssh/config or /etc/ssh_config:

      ForwardX11Trusted yes

      Or, you can run ssh with an extra command-line parameter "-Y":

      ssh -X -Y othermachine

      This is also referenced in the OpenSSH FAQ 3.13 - I upgraded to OpenSSH 3.8 and some X11 programs stopped working.

      Isn't this a security hole?

      Yes, it is. What this does is allow arbitrary programs you run full access to your root X display. If one of these programs has some malevolent intent, it could potentially sniff passwords (by monitoring all keystrokes) or lock up your X display server (not a really big deal).

      The sniffing of passwords is a serious concern. It could be that some simple program on the remote machine was compromised in the past and silently is grabbing information off of displays when people run it (think, xclock, dtmail, etc...). How paranoid should you be about it? Probably enough to avoid using X11 at anytime you access any sensitive information you have on your local machine (banking accounts, personal identity information, etc...).


    8. SSH on OS9

      See: Connecting to Astronomy Computers from a Macintosh running OS9


  8. Copying files/data (local/network)

    Copying data to and from a Mac OS X machine can be straight forward. By default, you can use scp and sftp (the same tools that are on the Solaris and Linux computers).

    You should be aware that the default filesystem for Mac OS X (HFS+) holds meta-data that is not copied forward by some of the generic Unix tools such as tar, cp and rsync.

    1. Mounting Astro Disks to your Mac (Using Samba)

      The Astronomy server named "irk" now supports remote mounting of disks via a system called Samba. It is based on a Windows File Sharing protocol and is understood by and interoperates with Mac OS X machines.

      To use this service, you will have to contact central for an account and password.

      Once you have an account for the Samba service, you can mount a disk from Irk by going to the finder, selecting "Go" from the top menu and drag down to "Connect to Server..." (or you can use the apple-K shortcut).

      This will open a dialog that looks like this:

      Fill in the "Server Address" field with "smb://irk.berkeley.edu/a". "a" is the disk mount on irk that my account resides on. I could also use "smb://irk.berkeley.edu/celestial1" or another other disk that is mountable in the department (even though celestial1 is physically connected to my machine celestial). Then click on "Connect".

      A dialog box that should appear that looks like this:

      The default workgroup presented should be okay. Make sure the username is the one created for you by central. Then type in the password for this account. Et voila, the disk will be mounted! You can use the finder to access it, or, access it directly in a terminal window by navigating into /Volumes/a.

      You can also do this from within the terminal window by using "mount_smbfs". You could go so far as to create mount points in your / directory so that referencing files will look identical to how they are referenced on the Solaris and Linux network.

      e.g. I create a directory on my Mac called /celestial2. I then mount celestial2 onto that directory:

      mount_smbfs //colby@irk.berkeley.edu/celestial2 /celestial2

      This answer contributed by Colby Gutierrez-Kraybill and refined by Mate Adamkovics


    2. Changing your Samba password

      You can change your samba password by logging into "irk" and running the command "smbpasswd":

      $ ssh irk
      $ /usr/local/samba/bin/smbpasswd
      ...
          

    3. Departmental Backups

      Backups are now supported on the local network for Mac OS X users. Chung-Pei Ma points out: "Be warn[ed], however, that it will cost you $2 per Gbyte per month! (See http://astro.berkeley.edu/computing/astro-rates.html)"

      And Mate Adamkovics correctly points out: "In place of those rates, you can get a new 300GB external hard-drive every two months (see Newegg, Outpost, CDW, Central Computer). Or simply buy one and re-use for a year and save ~$1500 a year in backing up your 300GB.... but perhaps the supported backup is easier?" (it would be safer to have your backups on a disk not always connected directly to your computer or even in the same office, and with an external drive, you could pick it up at night and take it home with you).


    4. Carbon Copy Cloner, Retrospect and others

      Robert Crockett writes:

      "In Panther and Jaguar, "Carbon Copy Cloner" did this [created bootable disk] nicely, but it does not work for Tiger yet. In the meantime, this page covers your options:

      http://mundy.org/blog/index.php?p=55"

      There is also Retrospect from Dantz software, academic pricing is provided by the TRC.


    5. rdiff-backup

      For rolling your own backups, I recommend rdiff-backup. It is open-source and under the GPL.

      I've set up a system that backups both windows and macintosh data for the RAL using rdiff-backup (a python wrapper around rsync libraries). It provides incremental backups of the directories it is pointed at. It stores only the differences, making it nicely efficient and more flexible than using plain rsync.

      It's been working flawlessly since Apr 2004 and has saved the day twice for myself and more than a few times for other RAL members.

      It supports copying of the metadata forks in mac files. You can run it locally on your machine to an external drive, across a network via running it in a server mode (using ssh as the underlying transport layer, ensuring some privacy) or across smb/nfs mounts.

      Robert Crockett points out: "I believe that rdiff-backup does not create a bootable disk, which is nice if your drive fails and you'd like to be able to reboot your machine from the backup."


    6. rsync

      rsync is a useful way of copying files and it only transmits the differences it finds between files that are on each end of the copy (hence Remote Sync). rsync comes with Mac OS X 10.3 and 10.4 by default (unknown about 10.2...).

      The rsync that comes with 10.3 is unaware of HFS+ extentions. However, Saurabh Jha has pointed out that, "...on Tiger it is HFS+ aware if you use the -E option (highly recommended). Unfortunately it really only works reliably from a Tiger machine to another Tiger machine. To other machines you will need a patched rsync that is HFS+ aware."


  9. Accessing departmental printers

    First: On your mac, you must print from a username which is identical to your Sun username, and if you have a fixed IP address (that is, not using DHCP) you have to ask central to authorize you to print.

    You cannot print from bootes (the shared IP in the computer room).

    The general instructions for the setup in Mac OS 10.2, 10.3 and 10.4 are:

    1. Open Hard Disk --> Applications --> Utilities --> "Print Center" (Printer Setup Utility)
    2. Select the "Add" icon, or menu "Printer" --> "Add Printer"
    3. In the window that opens, select "IP Printer" from the top menu bar.
    3a. In 10.4, make sure the Protocol selected is "Line Printer Daemon - LPD"
    4. Put astron.berkeley.edu in the "Address" line or you could put in 128.32.92.108
    5. Put p433, or p544, or color in the "Queue Name" window (not an exhaustive list).

    Printer models:
    p433-->HP LaserJet 4050 series
    p544-->HP LaserJet 2300DN series
    color->HP color LaserJet 4600

    You can also print using PDF Services. Marshall Perrin has created instructions on how this is done.

    Contributors: Paul Kalas, Kelley MacDonald, Saurabh Jha, Marshall Perrin.


  10. Mac OS X System and Application Troubleshooting

    There are some Mac OS X specific trouble shooting methods that are useful when running into slow downs, crashes or generally unexplainable behavior of the system software or application software.

    It's worth while to try out these general trouble shooting procedures when one of the following occurs:

    There are many applications out there that present themselves as "general maintenance" tools. These tools try to perform some of the following procedures (cache cleaning for instance) as a method of avoiding potential problems. However, these are not general maintenance issues. For example, there is important information held in the caches area that interferes with using the system if deleted (e.g. asked to reapprove applications you have already approved for use).

    Here are some tips for dealing with common Mac OS X (10.2-10.4) problems.

    1. Check the logs

      Open the finder, go to Applications > Utilities > Console

      This application is a front end to the system logs. Click on the "Logs" button to see a list of logs to look at. Examine the most recent entries in console.log and system.log. If you see something that looks suspicious, google it to see if you can find out more information about the problem.

      System server crash logs can be find under /Library/Logs/CrashReporter while user application crash logs can be found in ~/Library/Logs/CrashReporter.

    2. Freeing up diskspace

      If there is not enough disk space for the system to use, your machine may exhibit erratic behaviors. Be sure that you leave at least 10% free diskspace on your system drive. This is a good rule of thumb for all forms of UNIX.

      Several areas that you can look to free up diskspace on your Mac OS X system are:

      • Log files - log files can build up over time and if you are squeezed for space, you can safely remove them. Generally, the system logs are cleaned up by cron scripts that run daily, weekly and monthly. However, if your machine is off during these times, the scripts won't run and logs may keep growing. You can clean them out by going to the finder, Applications->Utilities->Console. Click on the "Logs" menu item and start clearing.
      • Mail update (Tiger) - If you updated your OS without doing a fresh install, your e-mail was imported into the newer version of Mail for Tiger. This has a side effect of leaving behind an extra copy of your mail folders that you no longer need. If you have a 1GB set of mail folders, this will lead to 2GB of disk usage (unnecessarily) after the update. Source: macosxhints.com

        I strongly recommend that you make a backup of your ~/Library/Mail/Mailboxes directory before attempting to clean it up. This clean up procedure is *only* for Mail 2.0 (10.4+ or Tiger)

            $ cd ~/Library/Mail/Mailboxes
            $ find . -name mbox -exec rm {} \;
                

      Question/Answer: Paul Kalas, answer: Colby Gutierrez-Kraybill.


    3. Preferences Corruption (plist files, XML)

      Preferences for applications are stored in XML files. These files can become "corrupted" or incorrectly formatted, either by your own edits directly to them, or when an application mangles one while updating it. These files can define menu layouts, icon information and other meta-data. If corrupted, applications can exhibit strange behaviors. These files have the suffix ".plist". They are primarily located in ~/Library/Preferences and /Library/Preferences. You can make sure they are properly laid out XML files by running a program called "plutil". This utility will only confirm that they are proper XML, not that the data inside them is accurate. You can do the following in Terminal:

              $ sudo plutil -s ~/Library/Preferences/*.plist
              $ sudo plutil -s /Library/Preferences/*.plist
            
      The sudo is included because sometimes preference files are owned by the system (in the case of /Library/Preferences, but also in the case of ~/Library/Preferences).

      As stated, this does not prove that the content of these preference files is correct. If after trying this step, there are still problems with the system/application you're trouble shooting, you can make a backup copy of your ~/Library/Preferences directory, then removing everything in it and then logging out and logging back in. This will create new sets of preferences for your account and any applications you run will create new ones as well. If things improve, you may have now fixed it. If you're really curious, you could start copying back preferences, one by one. Sources: MacWorld (careful of the "maintenance" utilities list), Apple Site, Mac OS X: How to troubleshoot a software issue


    4. Repairing Permissions

      Mac OS X and UNIX in general has a complex relationship between applications, user access and the permissions for such access on the files on the system. It's easy to inadvertantly modify permissions and cause trouble for your access or your system's access to its own files. Apple addresses this problem by providing a utility to repair permissions. Disk Utility provides this mechanism (Open Finder, Applications->Utilities->Disk Utility). Click your startup disk, then select "Repair Disk Permissions".

      It's a good idea to do this on a regular basis (after updating the system or installing a few software packages.

      Note: The permissions information is stored in files located in /Library/Receipts. It's important to not delete these files, so that the above procedure will work.

      Source: Apple: Disk Utility Help


    5. Removing Cache Files

      The Mac OS X system and various applications keep cache files around to help speed up application launching and response. Ironically, these same cache files can end up slowing down applications if they grow so large that the application spends more time reading through them, than doing what you want it to do. Also, the caches may have incorrect information in them, again, leading to strange and incorrect behaviors.

      If you are worried that something seems more sluggish or an application is consistently crashing, you can start removing caches in this order (there's no particular need to back them up):

      1. ~/Library/Caches - holds login and application specific caches (Quicktime, Mail, Safari).
      2. /Library/Caches - more application layer caches (Font System, Software Update)
      3. /System/Library/Caches - system specific caches (Kernel)

      Source: Login Delays and Damaged Font Cache, Apple Site, Mac OS X: How to troubleshoot a software issue


    6. Boot into safe mode

      If you are familiar with Windows or other UNIX based systems, you have probably heard of "Safe mode" or "Single User Mode". Mac OS X offers something similar to these modes (infact, it offers both safe and single user modes).

      From the Apple Knowledge Database, "Starting up into Safe Mode does three things to simplify the startup and operation of your computer:

      • It forces a directory check of the startup volume.
      • loads only required kernel extensions (some of the items in /System/Library/Extensions).
      • It runs only Apple-installed startup items (some of the items in /Library/StartupItems and /System/Library/StartupItems - and different than login items).
      • Mac OS X 10.4 Tiger only: It disables all fonts other than those in /System/Library/Fonts .
      • Mac OS X 10.4 Tiger only: It moves to the Trash all font caches normally stored in /Library/Caches/com.apple.ATS/(uid)/ , where (uid) is a user ID number such as 501.
      • Mac OS X 10.4 Tiger only: It disables any Login Items."

      Also from the Apple Knowledge Database, "To start up into Safe Mode (to 'Safe Boot'), do this:

      1. Be sure the computer is shut down.
      2. Press the power button.
      3. Immediately after you hear the startup tone, press and hold the Shift key. Tip: The Shift key should be held as soon as possible after the startup tone but not before.
      4. Release the Shift key when you see the gray Apple and progress indicator (looks like a spinning gear).

      Single user mode is identical to the same feature of Solaris/Linux/Name A UNIX. This boots the machine without completing the startup file initializations, leaving the computer sitting in a single shell (clever naming). To boot into single user on your Mac OS X machine:

      1. Choose Apple menu > Restart or press the power button if the computer is turned off.
      2. Press the Command and S keys together as the computer starts up.

      Other useful startup key sequences are:

      • Command-V (Verbose, shows startup messages during boot)
      • Option (or "alt", boots into open firmware)

      Sources: Starting up in Safe Mode, What is Safe Boot, Safe Mode?, Starting up in single-user mode, Open firmware information, Magical Macintosh Key Sequences. Other (more comprehensive) troubleshooting pages: macfixit.com, macosxhints.com.


  11. Software Development

    There are a rich set of development tools that come with the Mac OS X system. The default tools are free and are enough to port/write UNIX applications. To install these tools see: Installing the Mac OS X Developer Tools on the Apple website.

    Here is some more collective wisdom on various tools for developing and compiling software astronomers are likely to run into:

    1. IBM's Fortran compiler (xlf)

      Yoram Lithwick has pointed out that there is a high performance fortran compiler published by IBM (XL Fortran Advanced Edition for Mac OS X).

      In Yoram's own words: "xlf is infinitely better than g77, and does fortran 90 as well." (He's probably correct)

      xlf is officially supported on 10.2 and 10.3. It is not officially supported on 10.4 (Tiger). However, I have installed it on my own tiger machine, and it is capable of turning out a runnable "Hello, World!" program. I would not recommend purchasing it outright without proper support, but if you get a demo version, it might be worth trying out.


    2. (Re)Installing Fortran (g77)

      Paul Kalas writes:

      "After installing Tiger (10.4) I had difficulty reinstalling a fortran compiler."
      Here are some edited notes on using the High Performance Computing (HPC) project version of the gcc/g77/g95 tools.

      First off, you can use the Fink port of g77 using the normal Fink installation procedure.

      OR

      You can use the HPC version of g77/g95:

      • Install XCodeTools 2.0 or 2.1. Select "Developer Tools Software", "gcc3.3" and "gcc4.0"
      • If you have an older version installed with Fink, make sure that you delete the older version
      • Download the g77 3.4 package from hpc.sourceforge.net and follow the installation instructions. The HPC site also has the newer g95 compiler which might be of interest.
      • Make sure that you are running the right compiler. At a terminal prompt, you can type "which g77 f77 gcc". It should respond with the full path to each of these tools. If the path does not look okay, make sure you have followed the second step of removing any older installation of g77 in /sw (in the case of Fink).
      • If you get an error like: /usr/bin/ld:can't locate file for: -lcrt1.o, it means that /usr/lib/crt1.o is missing. Under Tiger, insert your Mac OS X system DVD, got to System/Installation/Packages and run DevSDK.


  12. Managing Spotlight

    Spotlight is the name given to a new searching mechanism introduced with Mac OS X 10.4 (Tiger). This system is constantly indexing filesystem information and can be a drain on system CPU and disk resources. Paul Kalas points out that you can turn this indexing behavior on and off using a command line utility on a per disk basis:

    $ mdutil -i off /Volumes/NameOfDrive
        
    See the man pages for mdutil, mdfind and mdimport for more information.

  13. Automater and GetPath for files in Finder

    "I just got [a script] working that might be useful is a 'Get Path' command - just right click on any one file, select the command under 'Automator' (or dir) and it copies the path to your clipboard for easy pasting into IDL, X1, etc. You can get it at www.automatorworld.com/2005/04/28/get-path/

    The guy says there are faster ways to do this with various freeware things, but I thought people might use this. You may have to create ~/Library/Workflows/Applications/Finder/ and ~/Library/Scripts to put it in."

    This answer contributed by Josh Goldston

    See also: Automator on Mac OS X and Automator, How it Works.


  14. Mathematica Fonts

    Get the latest Mathematica Fonts updates.


  15. Testing your Mac with benchmarks

    Paul Kalas writes:

    Here are four performance benchmarks that I've found useful:

      1. In OS9, run graphing calculator in full demo mode. It should loop through the demo indefinitely. If not, there's something wrong with the CPU.
      2. If you have IDL on either OS9 or OSX, run time_test2.
      3. On OS9 or OSX, time how long it takes to encode a .aiff file on your hardrive to an mp3 using the "better quality" setting in iTunes3.0.
      4. On OSX, download and run XBench 1.0.

    Are there any good reasons to try these, you ask? Well, say you have a 73 slide powerpoint presentation, and your computer freezes in the middle, right in front of 200 people, but it didn't happen in the office three days ago. Is it because the file was corrupted somehow, or is it the operating system or hardware that is crippled? The benchmarks could at least tell you if the operating system or hardware is crippled. A classic example is that you set the Energy Settings to "Longest Battery Life" while on the plane, but forget to switch it back to "Highest Performance" before your talk.

    I've had #1 show me that a brand new G4 desktop had a bad CPU, and #2-4 revealed to me that by fiddling with my operating system, I had reduced performance by 30%. Also, you could try these before and after installing new ram or installing new software.

    For a 1 GHz Ti Powerbook with 768 RAM, OS10.2.4 here is what I get:

    #2:  Total time=1.5-2.5 seconds (astron=4.0 seconds)
    #3: 8:14 music file = 36 sec, 10:02 music file = 48 sec
    #4: Total score=87-91, CPU=108-114


  16. How do I swap keyboard keys (in software)?

    I'm trying to configure the keyboard for more convenient use with emacs. Has anyone successfully used xmodmap to swap the caps lock and control key on a G4 laptop running X11?

    "I tried long and hard to swap the function and control keys but ended up giving up. It came down to actually installing a kernel extension. I was using a program called DoubleCommand and I think, in your case, it should be sufficient.

    While we are on the topic of emacs what do you use for the meta key?

    The "Command" key (the one with the little apple on either side of the space bar) works as the meta key (so does ESC with limited functionality)."

    Joe Hall

    "I have used a program called uControl to modify keymaps. (In my case, I wanted to remap the "enter" key, not "caps lock".) Hope it helps."

    Robert Crockett


  17. How do I create movies?

    "QuickMovie (v1.5)can properly sort imported photos. If you want to try this program, which I recommend, go to the web site for Chaotic Software.

    The pros are that's it's simple, small, easy to use, supports many codecs, and the resolution seems fine. The con is that you can't do fancy things like have a variable frame rate (but you could do this creatively by adding copies of stills if you want it to go slower).

    Rejected possibilities

    Andrew Youdin

    "I would use IDL. Here's a bit o' code that I used to make mpgs from plot windows (r3b = "restricted 3 body" problem)... it helps if the images are created in IDL but I think you could use it..."

    Joe Hall


Colby's Astro Pages > Mac OS X/UNIX FAQ