Skip to main content
Version: 2023

Machine Setup

note

Make sure you installed all required softawre as listed in Local Setup

Shell

A shell is a program that takes commands from the keyboard and gives them to the operating system to perform. In the old days, it was the only user interface available on a Unix-like system such as Linux. Nowadays, we have graphical user interfaces (GUIs) in addition to command line interfaces (CLIs) such as the shell.

To open a shell, you can use the following keyboard shortcut:

  • Mac: Cmd + Space and type Terminal
  • Linux: Ctrl + Alt + T

BASH

bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. First released in 1989, it has been used widely as the default login shell for most Linux distributions and Apple's macOS Mojave and earlier versions.

We will not go into the details of bash here, but you can find more information on the Wikipedia page.

While we will not be using bash as our default shell, it is still a good idea to know how to use it. Furthermore, many of the commands we will be using in this course are written for bash.

ZSH

zsh is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with a large number of improvements, including some features of Bash, ksh, and tcsh.

We will be using zsh as our default shell in this course.

Install

brew install zsh

Set as default shell

Set zsh as default shell:

chsh -s $(which zsh)

Oh-My-Zsh

Oh-My-Zsh is an open source, community-driven framework for managing your zsh configuration (and it comes with a bunch of plugins and themes).

Install
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

.zshrc

The .zshrc file is a script that is executed each time a new zsh shell is started. It is located in your home directory (~/.zshrc).

You can edit the .zshrc file with your favorite text editor.

We will be adding some configuration to the .zshrc file in the next sections.

Git

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

A version control system (VCS) allows you to track the history of a collection of files. It supports creating different versions of this collection. Each version captures a snapshot of the files at a certain point in time and the VCS allows you to switch between these versions.

Check out the Git documentation for more information.

To check if you have Git installed, open a shell and run the following command:

git --version

Visual Studio Code

Visual Studio Code is a free source-code editor made by Microsoft for Windows, Linux and macOS. Features include support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git.

It is a good idea to install the following extensions for Visual Studio Code. These extensions will make your life easier when working on the assignments.

Extensions

Open Visual Studio Code and click on the Extensions icon in the sidebar.

Live Share

This extension allows you to share your code with others and collaborate in real time.

Remote Dev

This extension allows you to develop inside a container, on a remote machine, or in the Windows Subsystem for Linux (WSL).

Docker

This extension allows you to manage Docker containers and images from within Visual Studio Code.

Python

This extension adds support for Python to Visual Studio Code.

C/C++ Extension Pack

This extension adds support for C/C++ to Visual Studio Code.

Jupyter

This extension adds support for Jupyter notebooks to Visual Studio Code.

Python

Python is an interpreted, high-level and general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation.

Virtual Environments

To avoid conflicts between different Python projects, it is a good idea to use virtual environments. A virtual environment is a directory tree which contains Python executable files and other files which indicate that it is a virtual environment.

Install

Let's install the virtualenv package and virtualenvwrapper extension for Python.

pip3 install --user virtualenv virtualenvwrapper

.zshrc

We will be adding some configuration to the .zshrc file.

Open the .zshrc file with your favorite text editor and add the following lines:

# Python
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source virtualenvwrapper.sh

Jupyter

Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.

We will be using Jupyter Notebook to write some assignments.

Install

pip3 install jupyter