The Linux Page

Help other users realize that everything is possible, especially avoiding Windows for their own personal use.

Welcome to The Linux Page


Fox Trot by Bill Amend. Click to enlarge.
Click to enlarge

This site is a collection of my own work with Linux. Certain things are easy, others take time to decipher and if I ever need to repeat the work (which usually happens!), then I need to remember everything by memory or... have a site with all the steps taken and to take again.

The following are my most recent posts:

Endless Pier, Endless Possibilities with less

Adding More Support for Binaries

The less tool does a lot more than just show plain text files now a day.

This is done by piping the output of one or more commands run against the input, instead of directly showing said file contents.

The extension works through a set of variables named LESSOPEN and LESSCLOSE.

The LESSOPEN has a pipe at the start, end the name "lesspipe" for the script doing the heavy lifting:

| /usr/bin/lesspipe %s

The idea is for that script to write the results you want less to display to stdout.

So for example that script could do:

echo ...

Iconic Chess Pieces

Changing a Virtual Machine (VM) Icon

By default, VirtualBox assigns a default icon to your VMs. That icon appears in your bar of icons (usually on the left side of the screen) and also in the VirtualBox interface.

If you just have one or two VMs, that's certainly not a huge issue. When you have 50 to 100, it becomes tedious to know what's what since all the icons will look alike (by default, they select the icon based on the operating system defined for that VM).

The solution is to assign a new icon to your VMs.

First, make sure that your icon is a square such as 48x48, 96x96, ...

Colors in Hexadecimal

See Binary File Contents

The Linux system comes with a tool named xxd, which is very useful to print binary files to a list of hexadecimal bytes.

It is pretty well thought of. I had my own atype command, but I now tend to use xxd because it's by default on most Linux systems, so no need to compile & install my own tool.

The most interesting feature, which I found out today, is that the tool is capable of doing the inverse (see the -r option): it can read its own output and generate a binary file again. It actually doesn't need to be output from xxd, just hexadecimal codes.

Rusty lock... when a deadlock happens, locks tend to rust over time.

Once in a while, in rather complicated application, I end up with a deadlock.

Looking for what is happening can be tedious since a deadlock doesn't tell you anything other than: this thread is waiting on a mutex (or possibly even a condition on a mutex).

In case of a deadlock, though, the mutex is already locked by another mutex and it is easy to find out which other thread locked the mutex.

In many cases, when a deadlock occurs, the two threads use the same two (or more) mutexes and at some point both are trying to lock those two mutexes out of order (A then B for one and B then A ...

Horse Eye Close Up

In the last two days, my Thunderbird installation was complaining about my GPG encryption key saying it was expired.

Error while saving draft - The key Alexis Wilke <alexis@m2osw.com> (key ID 0x123123123) has expired.

The interesting fact is that I created that key a long time ago so I guess even if you create a key for like 10 years, it still can expire... indecision

I found this page by Henning Koch with very simple list of steps on how to update the key. Here I have an updated copy. His page has a few other options you may also be interested in.

On my end, I have Thunderbird and the error ...

Upgrading PostgreSQL between OS upgrades

The following probably works with other versions of Linux, but I ran those commands on Ubuntu, so if you have a different OS, you may want to verify each step closely first.

The idea when you upgrade to a new OS is that the new version is available in that OS and the old version is now obsolete, so the best is to upgrade to the new database and make sure that the new database work. Then you can get rid of the old cluster.

The following are the steps I used:

sudo su -
su - postgresql
pg_dropcluster --stop 12 main
pg_upgradecluster 10 main

Once the transfer is done AND THE NEW ...

Forest Trail

Introduction

The CMake search algorithms are fairely simple, but it feels like each time I try to use them I make a small mistake and something goes wrong.

First there are three very important variables that are used in the search. Note that there are many other variables that can be used in the search which are listed on this page. But 99.9% of the time, these three are enough:

  1. CMAKE_MODULE_PATH

    This variable defines where to search for modules, but only if the prefix matches. Without a matching prefix, it somehow gets ignored.
     
  2. CMAKE_PREFIX_PATH

    ...

Broken Clock when Internet is not Available

I had an issue on a system which could be started in a complete standalone manner. In other words, without an Internet connection.

That system runs 10 computers, 9 of which are slaves as far as NTP is concerned and these computers must have their clocked set as close as possible to the controller's clock or the system won't work as expected.

So the main issue was that by default NTP is setup to listen to a few NTP servers on the Internet and if it can't connect to the Internet, it pretty much shuts down. In other words, the ability of the server to allow the slaves to get time ...

Adjusting to your preference

When trying to setup the Ubuntu environment automatically by installing a package so it works as expected, I have to use the gsettings command. Only, in most cases, the posts you find online tell you to tweak such and such value and these are wrong about 50% of the time. (Or to be more correct, they changed over time and now those old posts give you the wrong answer each time).

In order to find out what you need to change, one way is to use the GUI to make the changes and compare the settings from before and after. Here are the steps to do exactly that:

1. Open the GUI preferences allowing ...

My new TP-Link and what I think about it...

TP-Link AC1900 (click to find it on Amazon.com where I'm an affiliate)

Introduction

As my old Belkin WiFi device was not able to properly support UDP packets that it was not even concerned about, I looked into a new system and selected the TP-Link AC 1900 also known as the Archer 9.

It works. But...

Setup

First I edited the settings. One reason I selected this (opposed to say a Google Nest thingy), is that this device has a normal web interface to edit the settings. I find that much better than the concept of the Google Nest WiFi router requires voice activation. I just ...

Unfreeze your Mouse when it Froze

Thank you for visiting my website.