Skip to content

Instantly share code, notes, and snippets.

@jagdeepsingh
Last active December 9, 2021 10:26
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jagdeepsingh/b2b24da1abd94271129a9eab8d0a9b84 to your computer and use it in GitHub Desktop.
Save jagdeepsingh/b2b24da1abd94271129a9eab8d0a9b84 to your computer and use it in GitHub Desktop.
Set up macOS Catalina 10.15 with development tools | Git | Homebrew | rbenv | bundler | Atom | Databases | Node.js | Yarn | kubectl | Elastic Stack

Set up macOS Catalina 10.15

Contents:

1 git

1.1 Installation

Open the terminal and type git. If it not installed, you will see a dialog box with a button to "Install" it. Click on the button and git will be installed in a couple of minutes.

$ git --version
git version 2.20.1 (Apple Git-117)

1.2 Configure

Configure the username and email to be used.

$ git config --global user.name jagdeepsingh
$ git config --global user.email jagdeepsingh.125k@gmail.com

Generate SSH key. When prompted to select file location and to enter passphrase, leave it empty.

$ ssh-keygen -t rsa -b 4096 -C 'jagdeepsingh.125k@gmail.com'
Generating public/private rsa key pair.
...
Your identification has been saved in /Users/jagdeepsingh/.ssh/id_rsa.
Your public key has been saved in /Users/jagdeepsingh/.ssh/id_rsa.pub.
...

Copy the contents of file ~/.ssh/id_rsa.pub and add it to "SSH Keys" under "Github > Settings > SSH and GPG Keys".

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Enter your mac password when prompted.

$ brew -v
Homebrew 2.1.11
Homebrew/homebrew-core (git revision f8ea; last commit 2019-09-30)
$ brew install rbenv

$ rbenv -v
rbenv 1.1.2

$ rbenv init
# You will find a list of intructions here. Follow them to set up rbenv shell integration.

Close your terminal window and open a new one for changes to take effect.

Verify that rbenv is properly set up by running:

$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
Checking for `rbenv' in PATH: /usr/local/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20190828)
Counting installed Ruby versions: none
  There aren't any Ruby versions installed under `/Users/jagdeepsingh/.rbenv/versions'.
  You can install Ruby versions like so: rbenv install 2.2.4
Checking RubyGems settings: OK
Auditing installed plugins: OK
$ rbenv install 2.6.4

Check the installed ruby versions.

$ rbenv versions
* system (set by /Users/jagdeepsingh/.rbenv/version)
  2.6.4

Use a specific version.

$ rbenv local 2.6.4

Check the current active version.

$ rbenv version
2.6.4 (set by /Users/jagdeepsingh/code/work/.ruby-version)

See full rbenv cheetsheet for more commands.

$ gem install bundler

$ bundler -v
Bundler version 2.0.2

Install "Atom" and then install shell commands (e.g. atom) by clicking on "Atom > Install Shell Commands".

7 Databases

7.1 MySQL

$ brew install mysql

$ mysql --version
mysql  Ver 8.0.18 for osx10.15 on x86_64 (Homebrew)

Follow the instructions to set a password for root user and then get the service running.

Test successful setup by running:

$ mysql -uroot -p
Enter password: 
$ brew install postgres

$ postgres --version
postgres (PostgreSQL) 11.5

Create role "postgres" by running:

$ /usr/local/opt/postgres/bin/createuser -s postgres
$ brew tap mongodb/brew

$ brew install mongodb-community

Test the installation success by running mongo in terminal.

$ brew install node

$ npm -v
6.11.3

$ node -v
v12.12.0
$ brew install yarn

10.1 Install with Homebrew

$ brew install kubernetes-cli

See version:

$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T23:35:15Z", GoVersion:"go1.14.2", Compiler:"gc", Platform:"darwin/amd64"}

10.2 Install with cURL

Download the latest release:

$ curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl"

Make the kubectl binary executable:

$ chmod +x ./kubectl

$ mv ./kubectl /usr/local/bin/kubectl

See version:

kubectl version --client
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"}
Quick Links
Home
Guide
Installation
What is Elasticsearch

Install...

$ brew tap elastic/tap
$ brew install elastic/tap/elasticsearch-full

... and start it.

$ brew services start elastic/tap/elasticsearch-full  

To verify, make the following cURL request (or simply visit the URL):

$ curl http://localhost:9200
{
  "name" : "Jagdeeps-MacBook-Air.local",
  "cluster_name" : "elasticsearch_jagdeepsingh",
  "cluster_uuid" : "xxxxxxxxxxxxxxxxxxxxxx",
  "version" : {
    "number" : "7.9.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "d34da0ea4a966c4e49417f2da2f244e3e97b4e6e",
    "build_date" : "2020-09-23T00:45:33.626720Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment