MacBook Pro

From GHER

Revision as of 13:51, 20 May 2013 by Charles (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

General

  • How to know the operating system?

http://www.apple.com/support/mobileme/en/os_version.html

  • Create a Mac App Store account without credit card

http://support.apple.com/kb/ht2534

  • Make a screen capture
cmd + shift + 3

http://graphicssoft.about.com/od/screencapturemac/ht/macscreenshot.htm

Notes: all the shortcuts are available in Préférences Système in Keyboard (Clavier)

  • Go directly to the desktop (expose)
fn + F11

(you can change in System Preferences --> Mission Control)

Configuration

The configuration is done through the Préférences Système menu.

Installations

Xcode

Xcode is the developer package of Apple. It allows one to install developer tools, essentially using the shell.

To install Xcode:

  1. Create an Apple Developer ID
  2. Use the application "App Store" (free and normally installed by default on the system)

More info about the changes in Xcode: https://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html

Since the 4.3 version, it will be a simple application placed in your /Applications folder.

Besides, Apple also distributes a Command-Line Tools for Xcode, which you can download here: Command-Line tools for Xcode. Those tools can also be installed by starting Xcode and using the Downloads preference panes.

Package managers

As on Linux, you have what we can call package managers and which are a very convenient way to download, configure, making, installing, and keeping up-to-date packages automatically.
The most common ones are:

Xcode is necessary in order to install these.

Although very convenient, they will install their packages in distinct folders by default, ex:

  • /opt for Macports,
  • /sw for Fink
  • ...

and if you are to compile programs in which you have to specify the compiler and library paths, be sure not to mix up all paths between your apple tools (typically installed in /usr/bin or /usr/lib...) and the packages installed via the package manager, and even your maybe self-installed packages (typically installed /usr/local)! This in order to avoid compatibility issues between the compiler and the libraries versions.

For example in order to use MacPorts tools, you'll have to set up correctly your PATH variable (see for MacPorts for example: Important steps when installing MacPorts). Look also below for more information about setting up your PATH variable.

Remember you can also use the which command in order to see where your system will fetch the command require.

Examples:

MacBook-Pro-de-GHER:~ gherulg$ which gcc
/usr/bin/gcc

MacBook-Pro-de-GHER:~ gherulg$ which gfortran
/usr/local/bin/gfortran

Setting up the PATH variable

To add permanently custom paths to your PATH environment variable:

  • edit the file /etc/paths or
  • add any text file (with any name) containing your paths line-by-line in the /etc/paths.d folder

The first paths to be cited will be the first ones to be searched.

You can also use the $HOME/.bash_profile (or .bash_rc) with an export PATH command, which will be executed every time you open a shell session.

For instance, for MacPorts:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0

GNU vs BSD

Apple's Mac OS X is based on the Darwin operating system, released by Apple in 2000 and, to cite Wikipédia, "it is composed of code developed by Apple, as well as code derived from NeXTSTEP, BSD, and other free software projects".

The license is APSL, the Apple Public Source License, that meets the requirements of the Free Software foundation (FSF) since 2003. However, the tools you will use are not likely to be exactly the same as the ones used on the Linux System, with a GNU License.

Quick examples:

  • tail -v, which is the verbose mode in which tail also prints a header with filename
  • execute command with sed.

The GNU tools can be installed, either manually (via websites [1] and [2]) or using a package manager. For example with macports you will need to install coreutils and findutils using

$ sudo port install coreutils findutils

Once installed, those tools are prefixed with the letter "g" to distinguish them from the BSD tools. For example : cp <-> gcp, ls <-> gls... If you want to use them by default, you can add this path to your PATH variable: /opt/local/libexec/gnubin/.

Configuration of SSH

Need to create the command ssh-copy-id in /usr/bin for instance. The script can be found on the internet, e.g., http://phildawson.tumblr.com/post/484798267/ssh-copy-id-in-mac-os-x

Then you can follow the instructions from http://modb.oce.ulg.ac.be/mediawiki/index.php/Using_SVN

Useful software to install

Python

sudo port install py26-wxpython py26-numpy py26-matplotlib
sudo port install py26-scipy py26-ipython

where py26 has to be adapted according to your installation.

Source: http://sublimated.wordpress.com/2009/01/20/how-to-install-matplotlib-and-scipy-using-macports/

sudo port install  py-matplotlib-basemap

Source: https://modelingguru.nasa.gov/docs/DOC-1847

  • Python Imaging Library (PIL)
sudo easy_install pip
sudo pip install virtualenv
sudo pip install PIL

Source: http://stackoverflow.com/questions/9070074/how-to-install-pil-on-mac-os-x-10-7-2-lion

gimp

http://gimp.lisanet.de/Website/Download.html

ncview

LaTeX

  • Mactex:

http://www.tug.org/mactex/

  • TexMaker (editor)

http://www.macupdate.com/app/mac/14641/texmaker

  • Missing packages: download the packages you need from CTAN, and place them in ~/Library/texmf/tex/latex/. You may have to create this directory.

http://forums.macrumors.com/showthread.php?t=668314

  • I also had to type
\usepackage{etex}

in the preambule to avoid error

No room for a new ‘thing’

ImageMagick

http://www.imagemagick.org/script/binary-releases.php

$ sudo port install ImageMagick

if you're using macports.

OpenOffice

http://sourceforge.net/projects/openofficeorg.mirror/files/stable/3.3.0/OOo_3.3.0_MacOS_x86_install_en-US.dmg/download?use_mirror=garr

Personal tools