brew switch <package name> <version>-
Add the following to
~/.bash_profile,if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then GIT_PROMPT_START="\e[0;32m\u\e[0m at \e[0;31m$(scutil --get ComputerName)\e[0m in \e[0;34m\$PWD/\e[0m" GIT_PROMPT_END="\n->" __GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" fi
Notes:
username: user name, e.g.,hchen;remoteserver: remote server, e.g.,skynet.colorado.edu.
On local computer, type the following in a terminal
ssh-keygen -t rsafor convenience, hit enter two times.
On local computer, type the following in a terminal
ssh username@remoteserver mkdir -p ~/.ssh
and enter the password for the account on the remote server (e.g., [email protected]).
On local computer, type the following in a terminal
cat ~/.ssh/id_rsa.pub | ssh username@remoteserver 'cat >> ~/.ssh/authorized_keys'
and enter the password for the account on the remote server (e.g., [email protected]).
Now you can login in username@remoteserver without typing password.
Add alias ssh="ssh -o 'XAuthLocation=/opt/X11/bin/xauth'" to .bashrc or .bash_profile.
Install libRadtran on Mac
-
libradtran v2.0.1
tar -xvzf libRadtran-2.0.1.tar.gz -C ~/soft/libradtran/v2.0.1_inst --strip-components=1 -
optprop
tar -xvzf optprop_v2.1.tar.gz -C ~/soft/libradtran/v2.0.1_inst/ -
ic_yang2013
tar -xvzf ic_yang2013.tar.gz -C ~/soft/libradtran/v2.0.1_inst/data/ic/yang2013/ -
reptran
tar -xvzf reptran_2015_all.tar.gz -C ~/soft/libradtran/v2.0.1_inst/
-
Xcode
Download Xcode from App Store and install command line tools (simply open Xcode).
-
gcc and gfortran
try:
which gccwhich gfortranIf nothing returns, install gcc through homebrew, e.g.,
brew install gcc -
other libraries
brew install hdf5brew install zlibbrew install netcdfbrew install gslbrew install ndiffbrew install gawkbrew install https://raw.githubusercontent.com/Homebrew/homebrew-science/b9fd4d202e6f35cd4897962a05ad90d03d7c91f1/nccmp.rbbrew install open-mpi
./configure --prefix=/Users/hchen/soft/libradtran/v2.0.1 make make check make install
-
If Anaconda is installed, remove it from
PATH(simply comment out related lines in.bash_profile) before installation; -
Found a bug in
data/ic/yang2013/Makefileanddata/ic/yang2013/Makefile.in; -
After installation, add the following to
.bash_profile,export LIBRADTRAN_DATA_FILES="/Users/hchen/soft/libradtran/v2.0.1/share/libRadtran/data/"
-
Download Xcode from App Store
-
Install XQuartz
- After installation, logout current session and login again.
-
Install Homebrew
-
Open a terminal window, type
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -
Hit
enter/returnkey -
Type in account password and install
-
-
Install packages using Homebrew
- Use
typecommand to check if package has been installed, e.g.,type wget
brew install vim brew install gcc brew install wget brew install hdf5 brew install netcdf - Use
-
Install Anaconda
When there are too many files in a directory, it will raise system error of Argument list too long. if one try
rm -rf * to delete all files under the directory.
To fix this problem, one can use the following commands instead (e.g., delete all files under current directory)
-
find ./ -name "*" | xargs rm -f -
perl -e 'for(<*>){((stat)[9]<(unlink))}'
youtube-dl -i -f mp4 --yes-playlist 'https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2'