Timothy Wood - Using a Mac for (Computer) Science

Using a Mac for (Computer) Science

I think Mac's are great (if a bit expensive), and provide an ideal mix of graphical ease of use and low level linux-y power. However, it takes a few steps to get one setup and actually usable.

Setting up a new Mac

First, memorize the ridiculous Mac keyboard shortcut keys to the right. Then install some useful stuff:

  • iTerm2 - much improved console app (crucial)
    • change terminal type to xterm-color
  • Dropbox - for keeping files in sync across multiple machines.
  • VLC - for all the video codecs you'd need
  • xcode - Now you have to install this through the app store. Even if you don't use it as an IDE, it is the first step towards installing command line tools
    • You can even get a real version of 'gcc' using these instructions.
    • This also gives you useful opendiff a very nice graphical diff viewer you can call from the command line.
  • macTex - includes everything you need to use latex (and possibly more) (crucial)
  • eclipse - a nice hefty development environment to use up all your RAM
  • Skype - for free voice/video chat and screen sharing
  • Home Brew - tool for installing many linux apps
    • Install gnuplot for making graphs (this will take a long time)
      • sudo brew install gnuplot ???
      • If you want dashed lines in plots, use set terminal pdf font "Times-Roman,8" rounded dashed size 3in,1.5in
    • Get bargraph.pl and install the transfig package
    • Get gcc and install GDB so you can actually debug your C code.
  • Install XQuartz for X11 support.
  • TextWrangler - a nice basic text editor
  • You may also want a more advanced, cross platform editor:
    • Jedit is java based and free, with a lot of handy plugins.
    • Sublime Text 2 is very pretty, but is not free.
      • Set up a bash shortcut: ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
      • To fix build problems (cannot find programs not on path):
        • sudo vi /etc/launchd.conf # add PATH=$PATH:whateverelse
        • launchctl setenv PATH $PATH # so that change goes into effect immediately instead of after next reboot
  • You'll want to be able to edit files over an ssh connection. This takes a few steps:
  • Enthought Python Distribution or Enthought Canopy - the default python with OS X 10.5/6 is a mess when trying to add new packages, so get this instead. It includes lots of handy science related packages (free academic license)
  • OmniGraffle - an excellent diagram making program (requires a license)
  • jitouch - allows for advanced gestures with the trackpad ($6.99 for license)
  • Picasa - iPhoto is nice, but I like something more cross platform
  • Gmail Notifier - adds a button to the OS X toolbar that indicates if you have new mail
  • Crashplan - free and cross platform backup software
  • R - for statistics and plots

On some macs/keyboards, you also need to fix the Home/End key behavior (go to start/end of line instead of start/end of document). The following tip is from LifeHacker. You must edit the default keybindings file,~/Library/KeyBindings/DefaultKeyBinding.dict. Create the directory and / or the file if they're not already there, and make it look like this:

{
/* Remap Home / End to be correct  */
"\UF729"  = "moveToBeginningOfLine:";                   /* Home         */
"\UF72B"  = "moveToEndOfLine:";                         /* End          */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";       /* Shift + End  */
}

If there are already entries in DefaultKeyBinding.dict, add this to the top of the file.

Updates for Mountain Lion and Beyond

(Mountain) Lion fixes some things and breaks others.

  • You can cut and paste a folder by copying it and then either hitting command-option-v (AKA apple-alt-v) or right clicking and holding the option button to change the menu to show "move to" instead of "paste".
  • Get XtraFinder and customize finder:
    • in the regular finder preferences, change the default folder for a new tab and tell it to show all file extensions
    • in xtraFinder add cut and the permanently delete options to the popup menu.
  • Installing Yosemite? This can be very slow if you use MacTex or have other software installed in /usr/local.
learn/osx.txt · Last modified: 2017/03/14 23:12 by twood