Ulf Hamster 2 min.
cli command line cheatsheet macos R brew jupyter scala spark


Install Go via brew

Call in your sudoer account

brew install go
brew install zmq  # required for gophernotes

Set GOPATH in your user account's profile

Open in CLI

nano ~/.bash_profile

add this line and save

export GOPATH=$HOME/go

Reload profile

source ~/.bash_profile

Install gophernotes

Call in your user account

go get -u
#TARGET=$(jupyter --data-dir)/kernels/gophernotes
mkdir -p ${TARGET}
cp ${SOURCE}/* ${TARGET}

(Check README)

Troubleshooting. If the command


doesn't work, then check if the absolute path works


In the later case add the absolute path to

nano ${HOME}/Library/Jupyter/kernels/gophernotes/kernel.json

e.g. replace myusername with your's

    "argv": [


List all installed kernels

jupyter kernelspec list

Delete kernel

jupyter kernelspec uninstall <kernelname>


Install R via brew cask

Currently (2019-07-04), it's seems better to install r in MacOS as cask

brew uninstall r
brew cask install r

Set default CRAN repo

Package installation might stuck if no default source is set. Open

nano ~/.Rprofile

then add

local({r <- getOption("repos")
       r["CRAN"] <- "" 

See stackoverflow

R Kernel

Open R terminal and execute

IRkernel::installspec()  # local installation
#IRkernel::installspec(user = FALSE)  # for system-wide usage (requires sudo)

See docs

Scala (Spark)

Install via brew

Call as sudoer

brew cask install java  # requirement
brew install scala
brew install apache-spark

Check if it works by calling the CLI IDE “spark-shell

Install toree Kernel

Call in your user account

pip install toree

Find the Spark folder with libexec

find /usr/local/Cellar/apache-spark -wholename "*libexec"

Install jupyter kernel

jupyter toree install --user --spark_home $(find /usr/local/Cellar/apache-spark -wholename "*libexec")