Installation issues with asdf in new linux (ubuntu) installation

Problem

You want to install asdf in a new (k)ubuntu installation but some of the plugins are not installed (python).

Solution

Make sure you install the dependencies first

sudo apt install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git

Latest ruby installation in asdf fails

Problem

You are trying to install the latest ruby version using asdf version manager with

asdf plugin-add ruby
asdf install ruby latest

but that fails with messages like

*** Following extensions are not compiled:
psych:
       Could not be configured. It will not be installed.
       Check /tmp/ruby-build.20250826161307.2841030.HGJPXU/ruby-3.4.5/ext/psych/mkmf.log for more details.
zlib:
       Could not be configured. It will not be installed.
       Check /tmp/ruby-build.20250826161307.2841030.HGJPXU/ruby-3.4.5/ext/zlib/mkmf.log for more details.

BUILD FAILED (Ubuntu 24.04 on x86_64 using ruby-build 20250724)

Solution

Try to install the missing packages with:

sudo apt-get install libyaml-dev

Managing print jobs in linux command line

Some useful commands to manage print jobs

lpstat -p -dTo get a list of available printers, along with their status
lpstat -aTo check the status of all connected printers, including job numbers
cancel job-id or lprm job-idTo cancel a print job
lpmove job-id newprinterTo move a print job to new printer

Taken from Introduction to Linux course (LFS101) from Linux Foundation here

ldapsearch on a json attribute.

Problem

You have an LDAP entry with an attribute that consists of json entries, and you would like to use ldapsearch to filter on a json item condition.

So having the attribute

mobileIDAuthenticator: {“creationDateTime”:”2023-08-28T14:53:29.061Z”,”state”:”ENABLED”,”mobileNumber”:”+411111111″,”mobileSerialNumber”:”AAAAAAAAAAAAA”}

you would like to filter on the state item.


Solution

you can use the following syntax:

ldapsearch -LLL -H "ldaps://domain.com:1636" -D "cn=Directory Manager" -w $LDP -o ldif_wrap=no -c -vvvv -b "ou=persons,dc=domain,dc=com" -s sub "(mobileIdAuthenticator=state eq 'ENABLED')"  uid mobileIDAuthenticator 

Return results from LDAP without a line wrap (attribute)

Problem

You have an attribute in LDAP that might be a long line (ie a json array that contains many records like logins for example)

loginHistory: [{"lastLoginDate":"20250107094531.782Z","loginModule":"1"},{"lastLoginDate":"20241202075005.298Z","loginModule":"1"},{"lastLoginDate":"20241129143412.785Z","loginModule":"1"},{"lastLoginDate":"20241129103347.029Z","loginModule":"1"},{"lastLoginDate":"20240920105718.171Z","loginModule":"2"}]

But you want to return it in one line for further processing (ie counting the number of times in a year).

Solution

You can use the -o ldif_wrap=no option in your ldapsearch like

ldapsearch -LLL -H "ldaps://ldap.com:1636" -o ldif_wrap=no -D "cn=User" -w $LDP -b "ou=people,dc=domain,dc=com" -s sub "(mail=usernname@domain.com)" uid loginHistory 

PITR recovery fails when there are no transactions (pgbackrest)

Prolem

You are trying to do PITR recovery for a specific time, but the restore fails with something similar to the following message

FATAL:  recovery ended before configured recovery target was reached

Solution

This seems to be caused by a feature/bug that causes this error when there are no transactions between the backups, as explained in more detail here