FIND LINUX BROKEN SYMLINKS

A while ago, I was willing to contribute with a GitHub project, but I found some issues with broken links. This situation led me to a question: how can I recursively find all broken links within a directory?

The command below will print the path to any broken symbolic links found in the specified folder and its subfolders.

find /path/to/folder -type l ! -exec test -e {} \; -print

Let’s explain each part of the command does:

CUSTOM LOGROTATE RULES ALONGSIDE SYSTEM-WIDE CONFIGURATION

We frequently use logrotate to control log rotation on Linux servers. By default, logrotate use the custom configuration files locate in /etc/logrotate.d.

But what if we need a specific log file to be handled separately from the system-wide log rotation?

In this case, we can create a custom logrotate configuration file outside the /etc/logrotate.d directory.

sudo vim /apps/app_name/logrotate/app_name

In this new file, specify the log file, how frequently you want it to rotate, how many rotated versions to keep, and any other specific settings:

CHECK FOR GHOST FILES IN LINUX

Sometimes, after deleting a file some process can hold the file open, causing it to not be properly deleted. This can cause various issues like the OS reading directories sizes bigger than they truly are.

On Linux or Unix systems, deleting a file via rm or through a file manager application will unlink the file from the file system’s directory structure; however, if the file is still open (in use by a running process) it will still be accessible to this process and will continue to occupy space on disk. Therefore, such processes may need to be restarted before that file’s space will be cleared up on the filesystem.

CHECK SSL CERTIFICATE INFO

It is essential to ensure that your SSL certificates are not expired or expiring soon. Neglecting this can have disastrous consequences for production systems.

Certificate files typically have a .pem or .crt extension. You can use openssl commands to explore the details of a certificate. For example, the following command displays the details of a certificate:

openssl x509 -in mycert.pem -text -noout

Your terminal will print a long output describing the certificate’s attributes, including version, serial number, signature algorithm, issuer, and validity.

LOAD SSH KEYS VIA KDE PLASMA KWALLET

This quick tip was tested on openSUSE Tumbleweed. However, it will probably work for other Linux distributions running KDE Plasma.

Using Zypper, install ksshaskpass5

sudo zypper in --details ksshaskpass5

Create the .desktop file that will be automatically parsed at KDE Plasma start-up. Add all the needed keys using ssh-add -q. The “q” here stands for quiet.

RASPBERRY PI 4 + OPENSUSE + SAMBA

Hello, in this article, I’ll explain how to install openSUSE Tumbleweed (however, these instructions would probably work in openSUSE Leap) in Raspberry Pi 4, plus install and configure a basic Samba server to share files from an external HDD.

The first thing to do is install the openSUSE Tumbleweed image on your Raspberry Pi 4. Go to the openSUSE Wiki page for Raspberry Pi 4 and download the image that you like to use.