Buy Me a Coffee

[Nomad] How to mount the host path to docker task

Recently I came across a problem where I need to share the host path to Nomad docker task. I have to say that the official document about this part does not explain very clear. I spent quite long time to find the solution. Note that this is not about mounting the host volume to Nomad docker task. Just mount pure folder in host filesystem to Nomad docker task. It is equivalent to the docker command like ...

[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. ...

[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> ...

[Git] Fatal: this operation must be run in a work tree

fatal: this operation must be run in a work tree The error pop up while running git status. The solution is to change the repository not bare mode git config core.bare false

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