MacBook Pro@2021

Table of Contents

1 Homebrew

2 MacPort

Install and upgrade open source software on macOS. https://ports.macports.org/

3 GNUcore

4 Git

4.1 Account

  • name & address

    git config --global user.name "Your name"
    git config --global user.email "Your email address"
    
  • Remote Repository at GitHub

    ssh-keygen -t rsa -C "youremail@example.com"
    

    .ssh could be found in home folder. id\rsa and idrsa.pub

5 Maching Learning

  • Run PyTorch Natively on M1 MacBooks Installing Python’s deep learning libraries
    • Step 1 - Install and configure Miniforge
      • Install XCode Build Tools In the App Store to install XCode
      • Install Homebrew:

        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
        
      • Install Miniforge Restart the Terminal and

        brew install miniforge
        
      • Initialse the Conda for the Z shell

        conda init zsh
        

        Restart the Terminal.

    • Step 2 — Create a virtual environment

      conda create --name pytorch_env python=3.9
      

      Activate the created new virtual environment:

      conda activate pytorch_env
      
    • Step 3 — Install PyTorch

      conda install pytorch torchvision torchaudio -c pytorch
      
    • Step 4 — Testing PyTorch’s GitHub page comes with many examples, one of which is the script for training a handwritten digit classifier (link).

      python main.py
      

      Open up the Activity Monitor to verify Python is running natively.

      If you see “Apple” under “Kind”, it means the program is running natively on the M1 chip, and not under the Rosetta emulator.

6 Terminal Beautification

  • State "NEXT" from "DONE" [2022-01-20 Thu 15:15]
  • State "DONE" from "PROJECT" [2022-01-20 Thu 15:15]
  • State "PROJECT" from "DONE" [2022-01-20 Thu 15:15]
  • State "DONE" from "PROJECT" [2022-01-20 Thu 15:15]
  • State "PROJECT" from "DONE" [2022-01-20 Thu 15:15]
  • State "DONE" from "NEXT" [2022-01-20 Thu 15:15]

6.1 Install HomeBrew

Excute in a terminal:

path+=/opt/homebrew/bin

add "path+=/opt/homebrew/bin" in the file .zprofile

6.2 Install iTerm2

brew install --cask iterm2

add fonts: (should install svn first)

brew tap homebrew/cask-fonts && brew install --cask font-source-code-pro

6.3 Install oh-my-zsh

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

update:

omz update

7 Tools

Date: 2022-01-04 Tue 00:00

Author: Dr YF Lin

Created: 2022-01-20 Thu 15:24

ThingsEngine