My Local Setup Notes

I mostly use these tools below so this post will be updated frequently.

Prerequisites for Linux Ubuntu WSL in Windows

apt(Advanced Package Tool) is a package manager in Ubuntu OS.

WSL stands for Windows Subsystem for Linux.

Install build-essential for GCC compiler(C compiler) and some other utility tools

sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \

libbz2-dev libreadline-dev libsqlite3-dev curl \

libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Package Managers

Chocolatey Package Manager

Chocolatey is a package manager in Windows OS.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Check Chocolatey Version:
choco --version
List packages in Chocolatey:
choco list

WinGet Package Manager(Official Windows Package Manager

WinGet is a package manager in Windows OS. It is already installed in Win 10, 11, etc. Find more details in WinGet

Check WinGet Version:
winget --version
List packages in WinGet:
winget list
Install a package in WinGet:
winget install <package-name>
Uninstall a package in WinGet:
winget uninstall <package-name>

HomeBrew Package Manager

HomeBrew is a package manager in Linux OS or Mac OS.

Run the following in your terminal, and when installation is completed, you need to run two commands specified at end of output. So, copy them and run in the terminal.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Check HomeBrew Version:
brew --version
List packages in HomeBrew:
brew ls

Runtime Version Manager

Asdf Runtime Version Manager for Runtime Versions

Asdf is a package manager in Linux OS, Mac OS and Windows OS. It manages all your runtime versions with one tool! Find more details in asdf

# List all available plugins that can be added to asdf
asdf plugin list all

# Add the Java plugin to asdf
asdf plugin add java

# Add the .NET Core plugin to asdf
asdf plugin add dotnet-core

# Add the Python plugin to asdf
asdf plugin add python

# Add the Go (Golang) plugin to asdf
asdf plugin add golang



# List all available versions of Java that can be installed
asdf list all java

# Install a specific version of Java (AdoptOpenJDK 22.0.2+9)
asdf install java adoptopenjdk-22.0.2+9

# List all installed versions of Java
asdf list java



# List all available versions of .NET Core that can be installed
asdf list all dotnet-core

# Install a specific version of .NET Core (version 8.0.401)
asdf install dotnet-core 8.0.401

# List all installed versions of .NET Core
asdf list dotnet-core



# List all available versions of Python that can be installed
asdf list all python

# Install a specific version of Python (version 3.12.6)
asdf install python 3.12.6

# List all installed versions of Python
asdf list python

Pyenv Python Runtime Version Manager

Pyenv is a Python package manager in Linux or MacOS.

Install via HomeBrew for Mac OS or Ubuntu OS:
brew install pyenv
Install via Automatic Installer for Mac OS or Ubuntu OS:
curl https://pyenv.run | bash
Configuring bashrc if Automatic Installer used:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc

echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc

echo 'eval "$(pyenv init -)"' >> ~/.bashrc
Check Pyenv Version:
pyenv --version
List Pyenv Remote Versions:
pyenv install --list
List Pyenv Local Versions:
pyenv versions

Pyenv-win Python Runtime Version Manager

Pyenv-win is a Python package manager in Windows OS, run below command in PowerShell Terminal.

Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"

Jabba Java Runtime Version Manager

Jabba is a Java package manager. Find more details in Jabba

Install via PowerShell Script for Windows OS:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-Expression (
  Invoke-WebRequest https://github.com/shyiko/jabba/raw/master/install.ps1 -UseBasicParsing
).Content
$PROFILE | Get-Member -MemberType NoteProperty
 
   TypeName: System.String
 
Name                   MemberType   Definition
----                   ----------   ----------
AllUsersAllHosts       NoteProperty string AllUsersAllHosts=C:\Program Files\PowerShell\7\profile.ps1
AllUsersCurrentHost    NoteProperty string AllUsersCurrentHost=C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts    NoteProperty string CurrentUserAllHosts=C:\Users\[YOU_USER]\OneDrive - BP\Documents\PowerShell\profile.ps1
CurrentUserCurrentHost NoteProperty string CurrentUserCurrentHost=C:\Users\[YOU_USER]\OneDrive - BP\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
code $PROFILE.CurrentUserCurrentHost
$userProfile = $env:USERPROFILE
$jabbaPath = "$userProfile\.jabba\jabba.ps1"

if (Test-Path $jabbaPath) {
  . $jabbaPath
  jabba use default
  $env:PATH = "$env:JAVA_HOME\bin;" + $env:PATH
}
# Jabba initialization
export JABBA_HOME=$HOME/.jabba
export PATH=$JABBA_HOME/bin:$PATH
 
# Function to use Jabba
function jabba() {
    pwsh -Command "jabba $*"
}
 
JAVA_HOME_WIN=$(jabba which $(jabba current))
JAVA_HOME=$(echo $JAVA_HOME_WIN | sed 's|\\|/|g' | sed 's|C:|/c|')
export JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
source ~/.bashrc
Install via Automatic Installer for Mac OS or Ubuntu OS:
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh

Windows Subsystem for Linux(WSL)

WSL is a Linux subsystem in Windows OS.

List Remote WSL Linux Distributions:
wsl --list --online

The following is a list of valid distributions that can be installed.

Install using 'wsl.exe --install <Distro>'.

NAME                                   FRIENDLY NAME

Ubuntu                                 Ubuntu

Debian                                 Debian GNU/Linux

kali-linux                             Kali Linux Rolling

Ubuntu-18.04                           Ubuntu 18.04 LTS

Ubuntu-20.04                           Ubuntu 20.04 LTS

Ubuntu-22.04                           Ubuntu 22.04 LTS

OracleLinux_7_9                        Oracle Linux 7.9

OracleLinux_8_7                        Oracle Linux 8.7

OracleLinux_9_1                        Oracle Linux 9.1

openSUSE-Leap-15.5                     openSUSE Leap 15.5

SUSE-Linux-Enterprise-Server-15-SP4    SUSE Linux Enterprise Server 15 SP4

SUSE-Linux-Enterprise-15-SP5           SUSE Linux Enterprise 15 SP5
Install WSL Distribution:
wsl --install Ubuntu-20.04
wsl --install Ubuntu-22.04
Uninstall WSL Distribution:
wsl --unregister Ubuntu-22.04
List Local WSL Linux Distributions:
wsl --list --verbose

  NAME            STATE           VERSION

* Ubuntu-22.04    Running         1

  Ubuntu          Stopped         1

  Ubuntu-20.04    Running         1
Set Default Linux Distribution:
wsl --set-default Ubuntu-22.04
wsl -s Ubuntu-22.04
Set Default WSL version to WSL 1 or WSL 2:
wsl --set-default-version 1
wsl --set-default-version 2
Accessing WSL Linux Distribution:
wsl -d Ubuntu-22.04
Shutdown all WSL Linux Distributions:
wsl --shutdown

Command-Line Shells

Powershell 7 Command-Line Shell

Install via HomeBrew for Mac OS or Ubuntu OS:
brew install powershell/tap/powershell
Access PowerShell in Mac OS or Ubuntu OS:
pwsh
Install PowerShell 7 via Chocolatey:
choco install powershell-core
Check Version:
$PSVersionTable.PSVersion

Major  Minor  Build  Revision

-----  -----  -----  --------

5      1      19041  3693
Install PowerShell Extension in VSCode:

Go to Extensions in VSCode and search for `PowerShell` and install it, then close VSCode and reopen it.

Open PowerShell Terminal in VSCode and run `$PSVersionTable.PSVersion` to check PowerShell Version.

Clearing Terminal:
cls

Databases

pgAdmin4 Database Management UI

pgAdmin4 is a open-source administration and development platform(UI) for PostgreSQL.

Installing via HomeBrew:
brew install pgadmin4
Installing via Chocolatey:
choco install pgadmin4

PostgreSQL

Install via apt for Ubuntu OS:
sudo apt install postgresql
Install via HomeBrew for Mac OS or Ubuntu OS:
brew install postgresql
Install via Chocolatey for Windows OS:
choco install postgresql
Check PostgreSQL version:
psql --version
Check pg_dump utility tool version:
pg_dump --version
Export Schema from Existing PostgreSQL Database:

remove `–schema-only` to export with data;

pg_dump -h HOST_NAME -p PORT -U USER_NAME -d DATABASE_NAME --schema-only > SCHEMA_FILE_NAME.sql

pg_dump -h HOST_NAME -p PORT -U USER_NAME -d DATABASE_NAME -n SCHEMA_NAME --schema-only > SCHEMA_FILE_NAME.sql

pg_dump -h HOST_NAME -p PORT -U USER_NAME -d DATABASE_NAME -t TABLE_NAME --schema-only > SCHEMA_FILE_NAME.sql

pg_dump -h HOST_NAME -p PORT -U USER_NAME -d DATABASE_NAME -t SCHEMA_NAME.TABLE_NAME --schema-only > SCHEMA_FILE_NAME.sql

Cloud CLIs

AWS CLI

AWS CLI is a tool provided by AWS to manage and interact with AWS Services directly from the command line.

Installing via HomeBrew for Mac OS or Ubuntu OS:
brew install awscli
Install via Chocolatey for Windows OS:
choco install awscli
Check AWS CLI version:
aws --version
List AWS Profiles in machine:
aws configure list-profiles
List AWS S3 buckets using AWS Profile:
aws --profile test_profile s3 ls

AWS SAM CLI

Install via HomeBrew for Mac OS or Ubuntu OS:
brew tap aws/tap

brew install aws-sam-cli
Install via Chocolatey for Windows OS:
choco install awssamcli
Check AWS SAM CLI version:
sam --version

AWS Amplify CLI

Install via Homebrew for Mac OS or Ubuntu OS:
brew install aws-amplify
Install via Npm for Mac OS, Ubuntu OS or Windows OS:
npm install -g @aws-amplify/cli
Check AWS Amplify CLI version:
amplify --version

Azure CLI

Install via HomeBrew for Mac OS or Ubuntu OS:
brew install azure-cli
Install via Chocolatey for Windows OS:
choco install azure-cli
Check Azure CLI version:
az --version

Azure Functions Core Tools CLI

Install via HomeBrew for Mac OS or Ubuntu OS:
brew tap azure/functions
brew install azure-functions-core-tools@4
Install via HomeBrew for Mac OS or Ubuntu OS:
choco install azure-functions-core-tools
Check Azure Functions Core Tools CLI version:
func --version