Buy Me a Coffee

[WSL] Could not access the service hosted in WSL from host by IP

If you just started to use WSL, you may encounter the issue that You only can access your service hosted in the WSL from the host by localhost, but not the IP address. For example, you have a web service that listens to port 8080. In your web browser, you can browse the site with http://localhost:8080, but http://127.0.0.1:8080. The reason is that you need to use the WSL IP address. An easy way to find the address is to execute the below command in WSL terminal. ...

[Golang] go get: fatal: could not read Username for 'xxx': terminal prompts disabled

1. Error 1: fatal: could not read Username for 'https://github.com': terminal prompts disabled The issue appears when I tried to download a private golang repository by the command go get github.com/oscarzhou/private-helloworld. The completed error shows as below: % go get github.com/oscarzhou/private-helloworld go: module github.com/oscarzhou/private-helloworld: git ls-remote -q origin in /Users/oscarzhou/go/pkg/mod/cache/vcs/c5fb5660c8bfa54f1b957fc4e651ac76f19b939fc9015bf3bcbc21a34c925af7: exit status 128: fatal: could not read Username for 'https://github.com': terminal prompts disabled Confirm the import path was entered correctly. If this is a private repository, see https://golang.org/doc/faq#git_https for additional information. If you have already googled this issue, you may find that most of the answers tell you to configure your git as shown below: ...

[Wget] Unable to locally verify the issuer's authority

1. Error This issue happens when I run the command wget https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 in my Ubuntu WSL. The completed error looks like below: The extracted error is >> connected. >> ERROR: cannot verify objects.githubusercontent.com's certificate, issued by ‘CN=ospanel’: >> Unable to locally verify the issuer's authority. >> ERROR: certificate common name ‘localhost’ doesn't match requested host name ‘objects.githubusercontent.com’. >> To connect to objects.githubusercontent.com insecurely, use `--no-check-certificate'. You can see there are basically four highlight errors above and many answers for each error if you google them. I had tried the below workarounds in WSL: ...

[Git] How to configure SSH profile for Github account

There are many benefits for using Git with SSH connection. Do not need to type the password every time when pushing the project. Able to configure multiple git accounts in the same machine without using password every time. For Golang projects that reference other Golang private repositories, SSH connection is must thing. This post will show you how to configure SSH profile for your GitHub account from scratch. I assume that you did not ever configure the Git on your host. To check it, you can run git config --global --list. The expected output should be empty. If it is not, don’t worry, leave it there for now. We can figure it out later. ...

[Nginx] Expose specified port for Nginx in Dockerfile

When we build a custom docker image based on nginx docker image, the default lisenting port will be 8080. However, port 8080 is a quite popular, so sometimes I want to give a different port for my service. The below snippet of code is the solution. FROM nginx COPY ./public/ /usr/share/nginx/html EXPOSE 1313 CMD ["/bin/sh", "-c", "sed -i 's/listen .*/listen 1313;/g' /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"]

[LDAP] How to set up local Open LDAP service

This post will show how to host a OpenLDAP service on the localhost step by step. 1. Prerequisites docker-compose installed. 2. Prepare LDAP data We will create some data for LDAP service and populate it when the service runs up. Create a directory, for example openldap, first, and create another sub-directory openldap/data. The structure of the LDAP data can be described by .ldif file. So we can create below file openldap/data/bootstrap.ldif as the LDAP boostrap data. ...

[cfssl] How to generate the custom TLS certificate in 2 mins

Nov 2025 Update ⚡ Generate instantly: OneClickTLS.com - create self-signed TLS/mTLS certificates in seconds, directly in your browser. No uploads, no storage, and no setup needed - just instant generation. If it saves you time, you can ☕ Buy me a coffee to support future tools like this. I originally wrote this post a couple of years ago to document my workflow for creating self-signed certificates. Since then, I’ve built a small online tool called OneClickTLS that lets you generate TLS and mTLS certificates instantly in your browser. Just enter your Common Name (CN) and Subject Alternative Names (SANs), and it will give you ready-to-use certificate and key files. ...

Docker Handbook (🚧Continuous Update)

1. Install docker and docker-compose on Ubuntu sudo apt-get update sudo apt install docker.io sudo apt install docker-compose 2. Configure rootless user to run docker sudo groupadd docker sudo usermod -aG docker $USER # Linux user can run below to activate the changes newgrp docker docker ps https://docs.docker.com/engine/install/linux-postinstall/ 3. List and delete images docker images docker iamge ls docker rmi <image_id_1> <image_id_2> 4. Check if the specific docker image exists IMAGE_ID=$(docker images | grep 'portainer/base' | awk '{ print $3 }') if [[ -n ${IMAGE_ID} ]]; then docker rm -f ${IMAGE_ID}; fi 5. Login remote registry # Default is dockerhub. username is docker hub id docker login # Login the specific registry docker login registry.private.com 6. Build image from Dockerfile docker build -t <user>/<repo>:<tag> -f Dockerfile . 7. Push the local image to remote registry docker image push <user>/<repo>:<tag> # Push to the private registry docker push registry.private.com/<repo>:<tag> 8. Add and view the docker volume # add volume docker volume create <volume_name> # view volume docker volume ls sudo ls /var/lib/docker/volumes 9. Check the volume detail docker volume inspect <volume_name> 10. Test docker container service connection with curl ping the http service ...

Linux Handbook (🚧Continuous Update)

1. Set up permanent alias alais boltbrowser="bb" source .bashrc 2. Mount the external drive permanently See other posts: How to mount the external hard drive permanently External hard drive is read-only 3. Check which process owns the specific port sudo netstat -tulpn sudo netstat -tulpn | grep 80 # or sudo ss -tulpn sudo ss -tulpn | grep 80 # or sudo ps aux sudo ps aux | grep 80 4. Open an url in web browser from Terminal xdg-open https://google.com 5. Delete the installed package with apt # Check the apt installed history gtrep " install " /var/log/apt/history.log # Only remove the package but keep the configuration sudo apt remove <package_name> # Remove both package and configuration sudo apt purge <package_name> 6. List all the block devices lsblk -f Output is like ...

[VSCode] module lookup disabled by GOPROXY

Sometimes when I open the Golang project with VSCode, some import packages are highlighted with error underline and the error message is like below error while importing github.com/jpillora/chisel/client: module lookup disabled by GOPROXY=off If you are sure that the packages are downloaded already, reloading the VSCode window should solve the issue.

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !