Here Documents

So, what’s “Here Docs”? Well, if you don’t know what it is yet, then hopefully by the time you finish reading this post you’ll know what it is. Here docs or here documents is a special block code, of which we can use a form of I/O redirection to feed a command list to an interactive program, e.g. cat or the ex text editor according to [1]. Here is an example where a file basic-ingress.yaml was created using here docs. ...

November 10, 2023 · 2 min · 341 words · kenno

Deleting old LVM devices file PVID <ID> last seen not found

On one of my servers, I used to have a storage device, /dev/sdb, attached to it. That storage was used as an LVM physical volume. It has later been removed, and now I just noticed the following message: [root@banan ~]# lvs Devices file PVID CuDRE3nMN5FMNqYLViHrnE1D7OFDlbX6 last seen on /dev/sdb not found. LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root almalinux -wi-ao---- <28.40g swap almalinux -wi-ao---- 2.01g Based some research found online, there could be outdated device entries in the device files located in /etc/lvm/devices/system.devices. ...

October 26, 2023 · 2 min · 275 words · kenno

Rustup - update and remove Rust toolchain

rustup is a utility used to install and remove rust toolchain. To list the current installed toolchain run: kenno@c2:~$ rustup show Default host: aarch64-unknown-linux-gnu rustup home: /home/kenno/.rustup installed toolchains -------------------- stable-aarch64-unknown-linux-gnu (default) 1.70.0-aarch64-unknown-linux-gnu 1.71.1-aarch64-unknown-linux-gnu 1.72.0-aarch64-unknown-linux-gnu active toolchain ---------------- stable-aarch64-unknown-linux-gnu (default) rustc 1.72.0 (5680fa18f 2023-08-23) To remove a specific version of the toolchain, e.g. 1.70.0-aarch64-unknown-linux-gnu run: kenno@c2:~$ rustup toolchain remove 1.70.0-aarch64-unknown-linux-gnu info: uninstalling toolchain '1.70.0-aarch64-unknown-linux-gnu' info: toolchain '1.70.0-aarch64-unknown-linux-gnu' uninstalled Let’s verify: kenno@c2:~$ rustup show Default host: aarch64-unknown-linux-gnu rustup home: /home/kenno/.rustup installed toolchains -------------------- stable-aarch64-unknown-linux-gnu (default) 1.71.1-aarch64-unknown-linux-gnu 1.72.0-aarch64-unknown-linux-gnu active toolchain ---------------- stable-aarch64-unknown-linux-gnu (default) rustc 1.72.0 (5680fa18f 2023-08-23) To install udpate the new toolchain, run: ...

October 19, 2023 · 2 min · 360 words · Kenno

Array in Bash

I have written a hand full of Bash scripts, but none of those utilized array. Why? It’s because of two main things: 1. I don’t know how to use array in Bash, and 2. I would normally switch to write the script in Python instead. Today, however, I need to update an existing script written in Bash to make use of array. This was a perfect excuse for me to spend some 30 minutes to learn about array in Bash. I found a very good tutorial at the following [1]. ...

October 18, 2023 · 2 min · 221 words · Kenno

Install Guest Tools on XCP-ng

On AlmaLinux, the guest-tool for XCP-ng is provided by a package named xe-guest-utilities-latest, which in turn is available from the epel-release repository. The following list a few steps to get XCP-ng guest-tool installed on a VM running AlmaLinux 9. Enable epel-release repository if not yet enabled by first installing a package called epel-release. In my case, the repo has been already enabled. [root@xoa1 ~]# rpm -q epel-release epel-release-9-7.el9.noarch Install the guest-tool. If you’re unable to remember the full name of the package, just search for xe-guest. [root@xoa1 ~]# dnf search xe-guest Last metadata expiration check: 3:41:49 ago on Mon 16 Oct 2023 16:34:47. =================== Name Matched: xe-guest ================================== xe-guest-utilities-latest.x86_64 : XAPI Virtual Machine Monitoring Scripts [root@xoa1 ~]# dnf install xe-guest-utilities-latest -y ... Installed: xe-guest-utilities-latest-7.30.0-7.el9.x86_64 [root@xoa1 ~]# rpm -q xe-guest-utilities-latest xe-guest-utilities-latest-7.30.0-7.el9.x86_64 Finally, enable and start the xe-linux-distribution service. [root@xoa1 ~]# systemctl enable --now xe-linux-distribution.service Created symlink /etc/systemd/system/multi-user.target.wants/xe-linux-distribution.service → /usr/lib/systemd/system/xe-linux-distribution.service. [root@xoa1 ~]# systemctl status xe-linux-distribution.service ● xe-linux-distribution.service - Linux Guest Agent Loaded: loaded (/usr/lib/systemd/system/xe-linux-distribution.service; enabled; preset: disabled) Active: active (running) since Mon 2023-10-16 20:20:11 AEDT; 12s ago Process: 1714 ExecStartPre=/usr/sbin/sysctl net.ipv4.conf.all.arp_notify=1 (code=exited, status=0/SUCCESS) Process: 1715 ExecStartPre=/usr/sbin/xe-linux-distribution /var/cache/xe-linux-distribution (code=exited, status=0/SUCCESS) Main PID: 1720 (xe-daemon) Tasks: 9 (limit: 23054) Memory: 7.1M CPU: 42ms CGroup: /system.slice/xe-linux-distribution.service ├─1720 /usr/sbin/xe-daemon └─1723 logger -t xe-daemon -p debug Oct 16 20:20:11 xoa1 systemd[1]: Starting Linux Guest Agent... Oct 16 20:20:11 xoa1 sysctl[1714]: net.ipv4.conf.all.arp_notify = 1 Oct 16 20:20:11 xoa1 systemd[1]: Started Linux Guest Agent. The guest-tool for XCP-ng has now been installed on a VM running AlmaLinux (9). ...

October 16, 2023 · 2 min · 253 words · Kenno