Buy Me a Coffee

[Notepad++/Linux] How to install notepad++ on Ubuntu without using Snap

There is a way to use Windows software in Ubuntu platform, which is by using Wine. Notepad++ is one of such softwares. Of course, we also can install with Ubuntu Software store which uses Snap. However, it didn’t work as well as in Windows. So I choose the other way. Let’s kick off by opening the Terminal first. By the way, I’m using Ubuntu 20.04 # Add Wine GPG Key wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - # Add apt repository sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' # Install Wine on Linux sudo apt install --install-recommends winehq-stable # Set prefix export WINEARCH=win32 export WINEPREFIX=~/.wine32 Next, we need to download Notepad++ from https://notepad-plus-plus.org/downloads. Just choose Installer. ...

[VSCode] Golang No definition found

I have been using VS Code to develop Golang program for few years, and recently the issue “no definition found” bothered me a lot. At the beginning, the issue only happens in the mixed project where the go.mod is in the sub-directory under the root path. With this case, I still can use navigation feature to jump the editor among struct definition, function implementation or packages by opening the go.mod path as the root directory with VS Code. However, it even does not work in this way, which pushes me to solve the problem completely. ...

[Nomad] source path must be a file

When I run up a nomad job with the job file “example.nomad” created by nomad job init, the below error showed up Error getting job struct: Error getting jobfile from "example.nomad": source path must be a file The completed commands are: nomad job init # example.nomad is created nomad job run example.nomad # error pops up This issue stuck me for a while as I clearly remember that I successfully ran it up before. And these are very basic commands to play with Nomad set up. ...

Helm Handbook (🚧Continuous Update)

Helm is the package manager for Kubernetes. We can download it from here Take the public repository portainer/k8s as an example 1. Render the helm chart locally Open the terminal under the path github.com/portainer/k8s/charts helm template portainer/ # Render the chart with configurable argument helm template portainer/ --set image.tag="2.6.0" helm template portainer/ --set enterpriseEdition.enabled=true --set enterpriseEdition.image.tag="2.7.0" 2. Install helm chart helm install --create-namespace -n portainer portainer portainer/portainer 3. Install helm chart with local repository helm install --create-namespace -n portainer portainer-local portainer/ \ --values portainer/values.yaml # with argument helm install --set image.tag="2.6.0" --create-namespace \ -n portainer portainer-2-6 portainer/ \ --values portainer/values.yaml 4. helm chart repo # Add repo helm repo add <repo_name> https://portainer.github.io/k8s/ helm repo update # Remove repo helm repo remove <repo_name> 5. Delete helm namespace helm delete -n portainer portainer 6. List helm namespace helm ls --all-namespaces

Minikube Handbook (🚧Continuous Update)

Where to start? https://minikube.sigs.k8s.io/docs/start/ 1. Create kubernetes cluster # Specify the kubernetes version minikube start --kubernetes-version=v1.22.3 # Create second cluster minikube start -p minikube2 --kubernetes-version=v1.22.3 2. Create nginx ingress service kubectl create deployment ingress-nginx --image=k8s.gcr.io/ingress-nginx/controller kubectl expose deployment ingress-nginx --type=LoadBalancer --port=30777 3. General commands kubectl get pods -n portainer kubectl get svc -n portainer kubectl get events -n portainer kubectl logs -n portainer portainer-local-7c9f9d6897-jn97c kubectl get deployment -n portainer -o wide kubectl get --namespace portainer svc -w portainer kubectl port-forward -n portainer service/portainer 7080:9000 kubectl get --namespace portainer -o jsonpath="{.spec.ports[1].nodePort}" services portainer kubectl get nodes --namespace portainer -o jsonpath="{.items[0].status.addresses[0].address}" 4. Install and uninstall minkube cluster sudo dpkg -i minikube_latest_amd64.deb sudo dpkg --purge minikube

[GIMP/Linux] How to highlight on the screenshot with GIMP on Linux

Since I changed my Operating System from Windows to Ubuntu, I have been looking for a tool that can make a screenshot and put a highlight on it. Something like the Snipping Tool on Windows. It is hard to find such tool on Linux. However, I found a way to achieve the goal with two tools. Screenshot (Ubuntu installed software. Open it from Ubuntu Activities) GIMP (GNU Image Manipulation Program. Download from https://www.gimp.org/downloads/) This post will show how to use the above tool to highlight a screenshot step by step. ...

[Slack] no_text error with Slack integration

Recently I had a task to integrate Slack notification in Github Action workflow. Thanks to the repository slack-github-action, the work becomes much easier. The Slack integration works well when the payload only contains text and block. However, an error popped up while I changed the payload only with attachments. (We can add color to attachments which will highlight the message in Slack channel) The error was axios post failed, double check the payload being sent includes the keys Slack expects\n Error: no_text The first reaction after seeing the error is that I should add a text into the payload. But it turned out that the Slack message will only show the text content and ignore the attachment. ...

[Helm] How to check semantic version in helm chart

Helm chart supports the semantic veresion check function. We can find it here 1. Compare semantic version string It is very helpful for some cases. For example, if the helm chart needs to decide the probe port based on the docker image version. Let’s say that a web service started to support HTTPs feature since version 22.5.0, so if the installed docker image is after 22.5.0, the default probe port should be 8443. Otherwise, the default probe port will be 8000 ...

[Git] Unable access xxx: Is a directory

When I run git status, it shows the below error warning: unable to access '/etc/gitconfig': Is a directory warning: unable to access '/etc/gitconfig': Is a directory warning: unable to access '/etc/gitconfig': Is a directory The solution is to remove /etc/gitconfig. The target /etc/gitconfig might be varied from each case. With the below command, all can be solved. sudo rmdir /etc/gitconfig The reason that the problem suddenly pops up is because I ran a experiment docker command something like docker run --rm -v /etc/gitconfig:/etc/gitconfig ..... So the /etc/gitconfig is created. ...

[Git] Error: remote rejected (permission denied)

The error pop up When I pushed the changes on a new branch for the first time. ! [remote rejected] oscar-next -> oscar-next (permission denied) error: failed to push some refs to 'https://github.com/oscarzhou/portainer.git' The solution is to update the git config like below git config --local --list # old config remote.origin.url=https://github.com/oscarzhou/bar.git # update new config with git config remote.origin.url https://foo%40gmail.com@github.com/oscarzhou/bar.git After that, we can run git push --set-upstream origin <branch_name> ...

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