List Block Devices on FreeBSD

Recently, I found out that the ZFS pool on a FreeBSD is running out of space. There is no option to clean up this storage, but there are spare disks. So the next logical thing to do is to add 2 extra disks to the existing (mirror) ZFS pool. This FreeBSD server is a virtual machine (VM), and after attaching 2 physical disks to this VM, I had difficulty identifying these disks....

July 14, 2021 · 3 min · 567 words · kenno

How to remove old kernels on Void linux

I have a Void linux VM which only gets turned on once in every month. Today, when I booted up and updated the packages on this VM, I noticed that there are many old kernels installed. As a seasonal Void user, I had no clue on how to remove older kernels. Fortunately, a quick Google search pointed me to a video: VOID Linux: Removing old kernels with vkpurge. Basically, Void comes with a pre-installed utility program called vkpurge....

July 10, 2021 · 1 min · 196 words · kenno

Check Exit Status Code for Kerberos Ticket Validity

If you’re familiar with Kerberos, one way to check if a ticket is valid is to run klist command. ❯ klist Ticket cache: FILE:/tmp/krb5cc_1001 Default principal: username@UNIVERSITY.EDU.AU Valid starting Expires Service principal 02/07/21 11:26:50 02/07/21 21:26:50 krbtgt/UNIVERSITY.EDU.AU@UNIVERSITY.EDU.AU renew until 03/07/21 11:26:50 02/07/21 12:24:07 02/07/21 21:26:50 cifs/server1.UNIVERSITY.edu.au@UNIVERSITY.EDU.AU 02/07/21 12:24:07 02/07/21 21:26:50 cifs/server1.UNIVERSITY.edu.au@UNIVERSITY.EDU.AU ❯ date Mon 05 Jul 2021 16:01:59 AEST From the above output, the principal ticket expired since 2 Jul. So how do we find out if the Kerberos (principal) ticket expires programmatically?...

July 5, 2021 · 2 min · 284 words · kenno

How to Scan for IPs of Connected Devices

Suppose you just connect a Raspberry Pi to your home network using ethernet interface, and the Pi is not connected to a display device. How would you find an IP of that Raspberry Pi? Well, you’re right…whatever you say. There are a few ways to do this - looking at DHCP log, router log, …etc. But here is an even easier way to achieve this - using a command line tool called nmap....

July 3, 2021 · 1 min · 170 words · kenno

Service unavailable ERF64-6496 - There are migrations pending in the system.

I just updated my Foreman server and reboot, then this happened when I accessed the web console: Service unavailable ERF64-6496 [Foreman::MaintenanceException]: There are migrations pending in the system. This was the first time I’ve seen this message, and possibly because I haven’t done the update frequently enough. Fortunately, according to this blog post, it should be relatively easy to fix. [root@foreman ~]# sudo foreman-rake db:migrate API controllers newer than Apipie cache!...

June 29, 2021 · 2 min · 342 words · kenno

LVM Device Blah Excluded by Filter

If you use LVM frequently enough, especially when re-using existing disks, you might come a cross a problem when you’re unable to create a physical volume from that disk. For example, here is what I encountered today when I tried to create a physical volume on a device called /dev/sdb. [root@db3 ~]# pvcreate /dev/sdb Device /dev/sdb excluded by a filter. I’m sure I haven’t had any filters in /etc/lvm/lvm.conf. To fix this, I needed to wipe the signature from this device with wipefs command....

June 18, 2021 · 1 min · 169 words · kenno

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