Linux lost and found, pt.0

Let me open up with a question, bear with me - why oh why do we enjoy linux so much? Is it because we enjoy fixing stuff, or is it because we have soo much free time that we can spend another sleepless night re-learning how to build curl with newer openssl from source, configure neovim, make acers firmware trust canonicals CA so we don't see a oneline error message that lasts 0.5 seconds on boot and what not.

Lets put some theatrical lights on that "re-learning", does that sound familiar? Don't we all have bunch of repositories where we saved what we've done, million of bookmarks, thoughts, logics, but when/if we need it again, guess what, it dissapeared, thus why "Linux lost and found" is born.


Login screen has different resolution (big, blurry screen) - Gnome

I've faced this inconvenience recently - upon upgrading to Fedora 41, but this can be an issue on fresh gnome-desktop/gdm installs as well.

You have your screen resolution right, but on boot - login screen is all big and blurry.

cp ~/.config/monitors.xml /var/lib/gdm/.config/
chown gdm:gdm /var/lib/gdm/.config/monitors.xml

You'll have to run these as super user

Visual studio code updates

If you don't like having microsofts repositories imported to manage vscode via dnf/yum/apt, like i don't, here is another way to do it.

wget 'https://code.visualstudio.com/sha/download?build=stable&os=linux-rpm-x64' -O /tmp/code-latest.rpm
sudo dnf install /tmp/code-latest.rpm

Save it as a updatevscode.sh and run once update is out (vscode will yell at you, you'll know)

Use "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" for debian downstream..

Renaming multiple files at once

Did you ever have bunch of project files structured in such a way, that it would be awesome if you could append or prepend something to them for whatever reason?

for F in *2024*; do mv "$F" prefix."$F"; done

Readonly file?

You want to write to it, you have needed permissions, you or your group owns it, but you can't change/remove it? There is a high probability that it has immutable attribute flag set.

lsattr;lsattr -R for recurs inside dirs; chattr +-

Be carefull making changes inside files that have immutable flag set by default as there is almost 100% probability that it is there for a reason and is not meant to be reconfigured or tampered with.

Base conversions in bash

If you want to hex->ascii/decimal you can use echo:

SSH login drops after successful authentication

sshd log: fatal: Access denied for user x by PAM account configuration [preauth]

If you are not working with AD joined endpoint, then it could be that your user you're trying to login with, does not have /home directory and you'll have to create it utilizing adduser command with -m flag.

If endpoint is AD joined, you have to check its /etc/sssd/sssd.conf, for me, there was a line simple_allow_groups = $adgroups, and i was not member of that group, just changed it to a group i was a member of or remove that line entirely if you don't need it.

If for some odd reason you're still on <V6.4 RHEL, inside domain section of sssd.conf you should add:

krb5_canonicalize = false
and/or
ldap_force_upper_case_realm = true

You'll have to restart sssd after those changes for them to take effect.


Until next linux lost and found session, stay healthy, God bless y'all.