Where is which in PowerShell

As the title says, an easy way to find out the path of a program/command on Windows using PowerShell can be done with Get-Command cmdlet. For example, I want to find out where I had installed nvim (Neovim) on a rarely use Windows machine. To do this, I can execute the following command: ❯ Gt-Command nvim CommandType Name Version Source ----------- ---- ------- ------ Application nvim.exe 0.0.0.0 C:\Program Files\Neovim\bin\nvim.exe With PowerShell, we can also just print a specific attribute (?...

June 16, 2021 · 1 min · 114 words · kenno

How to Remove ZFS Meta Data on FreeBSD

It’s been quite a while since I last posted something here. It’s not that I haven’t come across many issues in tech, it’s just that I haven’t had enough time to write anything. So I’m going to share how to easily clear the ZFS metadata on a disk previously used in a ZFS pool. Here is an example - I have an external drive, and it is detected as /dev/da0 when plugged into a FreeBSD server....

May 26, 2021 · 2 min · 348 words · kenno

Vim Replace String 256 with <T_CO>

What was your first text editor when you started using Linux/Unix? Mine was pico. It was very easy to get started with and quite similar to nano. Then I moved to emacs and sticked with it for a long while. Eventually, I’ve switched to vim (or neovim), and that’s what I have been using until now. Well, the thing about text editor or may be this also applies to many other things, you’re only familiar with features that you constantly use....

May 9, 2021 · 2 min · 320 words · kenno

Enable a Repo the Ansible Way

Recently I need to install a package called Lmod on a Red Hat 8 server. Lmod is available from RHEL 8 EPEL8 repository, however it has a dependency called lua-filesystem which is only available from codeready-builder repository. On my RHEL 8 server, the codeready-builder repository is not enabled by default. Here is how I’ve got Lmod installed manually: # subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms # dnf install Lmod Looking at the above commands, I needed to enable the codeready-builder-for-rhel-8-x86_64-rpms first before installing Lmod....

April 24, 2021 · 2 min · 245 words · kenno

Looping Through Line in a File in Bash

I wanted to install vim package on FreeBSD 13.0, and did so without realizing that there were over 86 additional dependency packages installed. This was done with pkg install -y vim command. Anyway, I wanted to clean up by removing vim and those dependencies after all this is a headless server. Removing vim package doesn’t remove the installed dependencies. Fortunately, I was able to copy and paste the names of dependency packages and save it to a file....

April 17, 2021 · 2 min · 226 words · kenno