Top Kubectl commands you should know.

Get Contexts kubectl config get-contexts Get Pods kubectl get pods Get Pods' Performance kubectl top pods Get specific Pod Performance while true; do echo "=== $(date '+%Y-%m-%d %H:%M:%S') ===" >> pod_metrics.log; kubectl top pod >> pod_metrics.log; sleep 10; done

How to configure nvm on mac to run multiple node versions?

Recently, I had to work on multiple angular apps, one of which is running using angular 10 and other using angular 16.

Hence, I needed different versions of node. After doing somewhat research, I found that the steps are deterministic and are easy to follow.

In this blog, I am going to share the steps on how to configure nvm on mac. Here are the steps:

  1. Uninstall any existing version of node
    1. brew uninstall --ignore-dependencies node
    2. brew uninstall --force node 
  2. Install nvm using brew
    1. brew install nvm
  3. Export nvm directory:
    export NVM_DIR="$HOME/.nvm"
  4. Add nvm to shell:
    Add nvm to your shell profile: To make nvm available every time you open a new terminal window, you will need to add the following line to your shell profile (e.g., ~/.bash_profile or ~/.zshrc):
    source $(brew --prefix nvm)/nvm.sh
  5. Verify by running nvm --version
  6. Yay! nvm is configured.
  7. To install a specific version:
    nvm install <version>
    e.g. nvm install 18.17.0
  8. To switch to a specific version:
    nvm use 18.17.0
  9. To List available versions:
    nvm ls-remote
  10. To list local versions:
    nvm ls