23 March 2022

After installing a fresh version of MacOS installation, you need to do a minimum installation of softwares for development or for entertainment purpose. Here is a list for the same

  • macOS version

    sw_vers
    
    system_profiler SPSoftwareDataType
    
    uname -a
    
  • install Homebrew - a package manager for mac

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  • install MacPorts (optional, as alternative to Homebrew)

    sudo port selfupdate # to update port
    port installed # all installed ports
    port outdated # list of outdated ports
    port upgrade vim # upgrade installed port
    
  • create .zshrc file in home directory

    nano ~/.zshrc
    
  • colorize terminal output (folders & files with diff. colors) (optional)

    nano ~/.zshrc
    export CLICOLOR=1
    
  • change shell from zshrc to bash (Only if you want to change shell, else leave it.)

    # list of included shells
    cat /etc/shells
    
    # change default shell to Bash
    chsh -s /bin/bash
    
    # change default shell back to Zsh
    chsh -s /bin/zsh
    
  • install xcode command-line tools (it prompts to install)

    git --version
    
  • download from sites

  • install & configure (export path variables to .zshrc/.bashrc)

    • Oracle Java JDK (LTS)

      # JAVA_HOME
      export JAVA_HOME=$(/usr/libexec/java_home)
      export PATH=$PATH:$JAVA_HOME/bin
      
      # export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk/Contents/Home
      
    • Python
      # Python - depending on your version & location
      export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin
      # export PATH=$PATH:/$HOME/Library/Python/3.9/bin
      
    • Go

      # GOROOT & GOPATH
      export GOROOT=/usr/local/go
      export GOPATH=$HOME/go
      export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
      
    • Maven

      # check JAVA_HOME
      tar xzvf apache-maven-3.8.5-bin.tar.gz
      sudo mv apache-maven-3.8.5 /opt/
      # path
      export MAVEN_HOME=/opt/apache-maven-3.8.5
      export PATH=$PATH:$MAVEN_HOME/bin
      
    • Protocol Buffers

      unzip protoc-3.20.0-osx-x86_64.zip
      sudo mv protoc-3.20.0-osx-x86_64 /opt/
      # path
      PROTOC_HOME=/opt/protoc-3.20.0-osx-x86_64
      export PATH=$PATH:$PROTOC_HOME
      # check
      protoc --version
      
  • configure git

    • create a personal access token

      git config --global user.email <you@example.com>
      git config --global user.name <Your Name>
      
    • configure git credential manager core for PAT (Personel Access Token)

      # tell Git you want to store credentials in the osxkeychain
      git config --global credential.helper osxkeychain
      
      # add your access token to the osxkeychain- by using pull/push
      # when prompted for password, instead enter access token(it get cached in the osxkeychain automatically)
      git clone https://github.com/username/repo.git
      
  • install & configure open-ssh

    sudo port install openssh
    sudo port load openssh
    
  • install/uninstall with brew

    brew install wget
    brew list # lists apps installed by brew
    brew uninstall wget
    
  • containers & kubernetes

    • install Docker Desktop on Mac
    • install Rancher Desktop (docker without Docker Desktop)
      • container runtime of your choice (containerd or dockerd) - free
      • kubernetes, Traefik
      • docker(cli), docker-compose, docker-buildx
      • kubectl, helm, nerdctl, rdctl