Skip to main content

Posts

Python - FAQ

How to find the version of Python installed in Ubuntu? python --version - Ho to upgrade python version? sudo apt update sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.10 python3.10 --version // Python 3.10.1 - python version is not installed but python3. How to change python3 to python rm /usr/bin/python3 ln -s /usr/bin/python3.10 /usr/bin/python python --version // Python 3.10.1 - How to install pip in Ubuntu? sudo apt-get install python3-pip - How to fix the error 'ModuleNotFoundError: No module named 'distutils.util'' while installing pip? sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update sudo apt install python3.10-distutils pip --version // pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) - How to install PyCharm in Ubuntu? sudo snap install pycharm-community --classic

How to RDP an EC2 instance in a private subnet?

The answer is Bastion Host . Create a VPC Create two subnets (they can be in same AZ or different) Name them public-subnet and private-subnet. Technically, both are private now. Linking them with an Internet Gateway via a Route table makes them public Associate a Route table with public-subnet with the following routes That means, if a request is made from an instance in this subnet to an IP in the CIDR range of 172.31.0.0/16, the traffic should be redirected to VPC's default route i.e., it is a complete local communication within VPC. If the request destination is Anywhere (0.0.0.0/0), the traffic should be redirected to the Internet Gateway. Now, the public-subnet is PUBLIC in all senses (as it is connected to Internet Gateway) Add Web servers (EC2 instances) in this public-subnet (recommended) Add a NAT Gateway in this public-subnet Associate a Route table with private-subnet with the following routes That means, if a request is made from an instance in this subnet to an IP in t...

How to install/upgrade/downgrade kubectl in Linux (Ubuntu)?

To install the latest version: curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" echo "$(<kubectl.sha256) kubectl" | sha256sum --check sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl kubectl version --client kubectl version To install a specific (v1.19.0) version: curl -LO "https://dl.k8s.io/release/v1.19.0/bin/linux/amd64/kubectl" curl -LO "https://dl.k8s.io/v1.19.0/bin/linux/amd64/kubectl.sha256" echo "$(<kubectl.sha256) kubectl" | sha256sum --check sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl kubectl version --client kubectl version This will install kubectl client. Run minikube start to install kubectl server.

How to install/upgrade/downgrade minikube in Linux (Ubuntu)?

To install the latest version: wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo cp minikube-linux-amd64 /usr/local/bin/minikube sudo chmod 755 /usr/local/bin/minikube minikube version To install a specific (v1.11.0) version: wget https://storage.googleapis.com/minikube/releases/v1.11.0/minikube-linux-amd64 sudo cp minikube-linux-amd64 /usr/local/bin/minikube sudo chmod 755 /usr/local/bin/minikube minikube version