Giter VIP home page Giter VIP logo

macos-dev-env's Introduction

macOS Development Environment

1. macOS Configuration

  • Download iTerm2
  • Install Homebrew
    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    $ (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/kevin/.zprofile
    $ eval "$(/opt/homebrew/bin/brew shellenv)"
  • Download Zettlr
    $ brew install --cask Zettlr

2. Visual Studio Code

  • Download VS Code
  • Insall VS Code Extenstions:
    • Extension Pack for Java
    • Spring Boot Extension Pack
    • Python
    • ES7+ React/Redux/React-Native snippets
    • Prettier - Code formatter
    • GitLens — Git supercharged

3. Podman Desktop

  • Podman Desktop for macOS
    $ brew install podman-desktop
    Brew will also install the Podman Engine along with the Podman Desktop application, in case you don't have it installed yet.
  • Open Podman Desktop Application within the Applications directory, onboarding for the following extensions:
    • Compose
    • kubectl CLI
    • Podman
  • Run a very basic httpd server (named basic_httpd) that serves only its index page.
    $ podman run --name basic_httpd -dt -p 8080:80/tcp docker.io/nginx
  • Open in browser: http://localhost:8080
  • Stop and remove the httpd container:
    $ podman stop basic_httpd
    $ podman rm basic_httpd

4. Git

  • Download for macOS
    $ brew install git
  • Check the current version of Git:
    $ git -v
  • Getting Started - First-Time Git Setup
    • View all Git settings:
      $ git config --list --show-origin
    • Setup Identity:
      $ git config --global user.name "Your Name"
      $ git config --global user.email [email protected]
  • Generating a new SSH key
    • Generating a new SSH key:
      $ ssh-keygen -t ed25519 -C "[email protected]"
    • When you're prompted to "Enter a file in which to save the key", you can press Enter to accept the default file location.
    • At the prompt, type a secure passphrase.
    • Start the ssh-agent and add SSH private key to the agent:
      $ eval "$(ssh-agent -s)"
      $ ssh-add ~/.ssh/id_ed25519
  • Adding SSH key to the ssh-agent
    • First, check to see if your ~/.ssh/config file exists in the default location.
      $ open ~/.ssh/config
      The file /Users/kevin/.ssh/config does not exist.
    • If the file doesn't exist, create the file.
      $ vi ~/.ssh/config
    • Modify the file to contain the following lines.
      Host github.com
        AddKeysToAgent yes
        UseKeychain yes
        IdentityFile ~/.ssh/id_ed25519
      
    • Add your SSH private key to the ssh-agent and store your passphrase in the keychain.
      $ ssh-add --apple-use-keychain ~/.ssh/id_ed25519
  • Adding a new SSH key to your GitHub account
    • Copy the SSH public key to the clipboard:
      $ pbcopy < ~/.ssh/id_ed25519.pub
    • GitHub > Settings > SSH and GPG keys, click New SSH key or Add SSH key.
      • Title: Macbook Air
      • Key type: Authentication Key
      • Key: [paste your public key]
    • Test the SSH key:

5. Java Development Tools

5.1. Install SDKMAN!

  • Installation
    $ curl -s "https://get.sdkman.io" | bash
    $ source "$HOME/.sdkman/bin/sdkman-init.sh"
    $ sdk version

5.2. Install Java Development Kit (OpenJDK - Eclipse Temurin)

  • List the available version of Java:
    $ sdk list java
  • Install Eclipse Temurin™ 21 - LTS
    $ sdk install java 21.0.3-tem
  • Check the current version of Java
    $ sdk current
    $ java -version
    
  • Switch to Java version in this shell.
    $ sdk use java 21.0.3-tem
  • Configure default Java version for all shells.
    $ sdk default java 21.0.3-tem
  • Locate where JDK is installed:
    $ readlink -f $(which java)

5.3. Install Apache Maven

  • Install Apache Maven:
    $ sdk install maven
  • Apply the setting to the bash terminal:
    $ source ~/.bashrc
  • Check the current version of Maven:
    $ sdk current
    $ mvn -v

6. React Development Tools

6.1. Install Node Version Manager

  • Download Node.js
  • Install Node Version Manager (NVM):
    $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  • Activate NVM:
    $ source ~/.zshrc
  • Check the current version of NVM:
    $ nvm -v

6.2. Install Node.js

  • Install the latest LTS version of Node:
    $ nvm install --lts
  • Make the default LTS version as NVM:
    $ nvm alias default "lts/*"
  • Check the installed version:
    $ node -v

7. Python Development Tools

7.1. Install Pyenv

  • Installing with Homebrew
    $ brew update
    $ brew install pyenv
  • Set up shell environment for Pyenv
    $ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
    $ echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
    $ echo 'eval "$(pyenv init -)"' >> ~/.zshrc
  • Restart shell for the PATH changes to take effect:
    $ exec "$SHELL"
  • Check the current version of Pyenv:
    $ pyenv --version

7.2. Install Python

  • Install the build-time dependencies
    $ brew install xz
  • List the available version of Python:
    $ pyenv install --list | grep '3.12'
  • Install Python 3
    $ pyenv install 3.12.4
  • Set global Python version:
    $ pyenv global 3.12.4
  • Check the current version of Python
    $ pyenv versions
    $ python -V

7.3. Install JupyterLab

  • Installing Jupyter
    $ pip install jupyterlab
  • Once installed, launch JupyterLab with:
    $ jupyter lab

macos-dev-env's People

Contributors

kairosys avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.