Portainer on WSL2

I’ve been using WSL2 for developping for both personal and Professional use cases. To manage and quick deploy the containers, i’ve been using Portainer. As much as i love to use Terminal, i’m mostly lazy.

I’m assuming you’ve already WSL2 installed and docker is up and running.

First create a volume with following.

$ docker volume create portainer_data

Now, install portainer

$ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Here, Port 9000 is used for serving UI and API. Port 8000 is for running SSH tunnel between portainer instance and the agent.

Now, set a admin password

Now, Select Docker as Environment and click Connect

Here it is,

To pull images from Dockerhub go to images on left menu, type in the name of the container and tag e.g node:current-alpine3.10. click on Pull the Image.

you can import of your own container and spin off the containers.

Fix git ‘Permission Denied (publickey)’ error

When you try to git push it throws Permission Denied(publickey) error.

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

When this keeps happening and you think you’ve already added the public key in the GitLab or BitBucket or any other. You might’ve added key in Pageant which comes with putty but git doen’t use the key from there. To solve this open git bash as Administator. (Don’t use windows terminal or default CMD, better use *nix cli)

  • Type cd ~/.ssh It will take you to %userprofile%/.ssh or C:/users/username/.ssh
  • Run ls, there should be two file id_rsa and id_rsa.pub
  • If those files are alredy there, then copy the content of id_rsa.pub file and paste it in the key section of git service provider.
  • if not continue bellow steps.
  • To create SSH key type the following ssh-keygen -t rsa -C “[email protected]
  • replace [email protected] with your email address. If you wish set a keyphrase for the key add it when it prompts.
  • Now do the ls, both files should be created by now. Open the directory and copy the contents of id_rsa.pub file to the key section of your git provides.
  • Now try pushing the git repo with git push, it should work by now.

8GB RAM Raspberry Pi 4 Released

Our favorite ATM card sized Raspberry Pi 4 from The Raspberry Pi Foundation just released 8 GB RAM variant with 75 USD price tag.

It is now available for pre-order on thingbits for around ₹6000 in India. It more expensive than 2GB and 4GB models but it packs more memory in the same form factor and packs more punch where more is needed.

Pi Foundation slipped 8GB varient in the beginners guide of the Pi 4 released last year along with Pi 4 B+ 1GB, 2GB and 4GB.

BCM2711 Chip used in the Pi 4 supports upto 16 GB of LPDD4 Memory but to install it in the board, there where was no 8GB memory available as a single package and Micron somes to rescue and supplied pi foundation with 8GB LPPDR4 Memory in the single package need for pi 4 as explained in official blog post.

How to Launch Windows terminal from cmd

Microsoft recently launched Windows terminal in the Microsoft Store as the preview. I’m already loving it. With continious updates and it’s already my default terminal app. It allows you to run PowerShell, PowerShell Core and even WAL (Windows Subsystem for Linux).

To open Windows Terminal from run Press Win+R and type

> wt