macOS set-up
Setting up a mac for scientific computing
For me, macOS offers an expensive, but more user friendly alternative to Linux. However, if you’re like me, it can be rather easy to turn your machine into a mess (see this very poignant XKCD cartoon). Based on trial-and-error and reading what others have done, here’s what I’ve come up:
xcode
While I don’t use xcode directly, it provides a host of utilities that are useful.
Homebrew
Their tag-line says it all: “The Missing Package Manager for macOS (or Linux).” See install instructions at https://brew.sh. Here’s a list of the key Formulas and Casks I’ve installed:
- MacTeX: Allows you to compile LaTeX documents
- Skim: PDF viewer that works well with Sublime Text’s LaTeXTools package. Don’t forget to enable syncing for Sublime Text in the Settings.
- BibDesk: Excellent tool for BibTex files
- Ipe: Excellent drawing tool for making diagrams, especially when you want to include LaTeX symbols/equations. To get Ipe to compile LaTeX on the most recent versions of macOS (not sure when this issue started…), I have needed to create an
~/.ipe/ipe.configfile with explicitly showing the path for (e.g.,IPELATEXPATH=/Library/TeX/texbin). For reference, see - Gimp: Photoshop alternative
- Inkscape: Illustrator alternative
- Ghostscript: Command line PDF manipulation
- Imagemagick: Command line image manipulation
- FFMPEG: Command line video manipulation
- htop: Command line tool to view system performance
- dos2unix - convert line endings
- pwgen: Create secure passwords
- VLC: Most univeral video viewer that I’m aware of
- Panoply: netCDF viewer
- open-mpi: Message passing library for numerical tools
- pandoc: Universal document converter
Sublime Text
I use Sublime Text for simple text file editing and also for writing papers with LaTeX. Make sure you set up the command line interface so that you can open files in Sublime Text from the terminal. Package Control allows you to install handy add-ons to Sublime Text; I use:
- LaTeXTools: Note that you’ll want to update LaTeXTools settings to launch Skim automatically (
"viewer": "skim",). - Rainbow CSV
Sublime Merge
I’m capable of using git from the command line, but for more complex operations a GUI is very handy. While VS Code has very good built-in capabilities and extensions, I still like Sublime Merge for certain things.
Python
TODO
VS Code
TODO
MATLAB
TODO
Shell scripts
I have a coupe of custom bash scripts that I mostly keep track of in my GitHub gists.
ZSHRC
Here’s my ~/.zshrc file:
# -------------------------------------------------------------------------------
# Path
export PATH="$PATH:/Users/ryancoe/bin"
# -------------------------------------------------------------------------------
# Aliases
alias ls='ls -lh --color=auto'
# -------------------------------------------------------------------------------
# History and autocompletion
autoload -U compinit
compinit
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
setopt HIST_EXPIRE_DUPS_FIRST
setopt SHARE_HISTORY
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '\e[A' history-search-backward
bindkey '\e[B' history-search-forward
# -------------------------------------------------------------------------------
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/ryancoe/miniforge3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/ryancoe/miniforge3/etc/profile.d/conda.sh" ]; then
. "/Users/ryancoe/miniforge3/etc/profile.d/conda.sh"
else
export PATH="/Users/ryancoe/miniforge3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba shell init' !!
export MAMBA_EXE='/Users/ryancoe/miniforge3/bin/mamba';
export MAMBA_ROOT_PREFIX='/Users/ryancoe/miniforge3';
__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias mamba="$MAMBA_EXE" # Fallback on help from mamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<