ssd slow (in Linux)

If your SSD has become slow, it could depend from the swap file: f.e. in fstab the ssd swap UUID could be wrong (after some partitions changes in your SSD).

You can fix this by giving to the swap partition the correct UUID.

radial gradient in new KDE

The new KDE Plasma releases require a slight change in your svg files, if you have a radiant gradient (no problems instead with the linear ones).

You have to specify the radialGradient cx, cy and r, like in the following example:

<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <radialGradient id="gradient" cx="0.50" cy="0.50" r="0.45">
      <stop offset="0%" stop-color="#fbfbf0"></stop>
      <stop offset="80%" stop-color="#bc5a1f"></stop>
    </radialGradient>
  </defs>
  <g>
    <path fill="url(#gradient)" d="M11 .008l3.4 6.888L22 8l-5.5 5.361 1.298 7.57L11 17.357l-6.798 3.574 1.298-7.57L0 8l7.6-1.104z" />
  </g>
</svg>

Because a svg with this other following code won’t work (will be invisible)

<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <radialGradient id="gradient">
      <stop offset="0%" stop-color="#fbfbf0"></stop>
      <stop offset="80%" stop-color="#bc5a1f"></stop>
    </radialGradient>
  </defs>
  <g>
    <path fill="url(#gradient)" d="M11 .008l3.4 6.888L22 8l-5.5 5.361 1.298 7.57L11 17.357l-6.798 3.574 1.298-7.57L0 8l7.6-1.104z" />
  </g>
</svg>

linux remove old kernels

Recently Ubuntu-based linux SO doesn’t remove automatically old kernels, with the command

sudo apt-get autoremove --purge

This because kernels, even automatically installed, are considered manually installed, and so they are not automatically removed.

To solve this, you should do beforehand this command

sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")

With this command you say that all kernels are automatically installed, and therefore the previuous command (sudo apt-get autoremove –purge) will work.

nvidia grafical card and linux kernel

It could happen that a new kernel doesn’t work with your nvidia (geforce) grafical card. The problem could de the linux-modules, such as linux-modules-nvidia-460-5.8.0-53-generic.

You can check it by the following command

dpkg --list | egrep -i --color 'linux-image|linux-headers|linux-modules' | awk '{ print $2 }'

To solve this, if you find that the last kernel does’t have a matchintg nvidia module, you have to install manually that module

sudo apt-get install linux-modules-nvidia-460-5.8.0-53-generic

quick type special characters

In Linux you can use ComposeKey, setting it for example (in System settings) as RightCtrl (the right-Ctrl key). RightCtrl is better than AltGr in Italian keyboard, to keep AltGr for some characters like ‘[‘, or ‘]’, or ‘@’, or ‘#’, otherwise unaccessible.

In that way, when you type 1) first RightCtrl 2) then ^ 3) then o, you will get ô. You don’t need to press simultaneously all the keys.

To sum up, the main simbols :

  • RightCtrl+^+o = ô
  • RightCtrl+”+o = ö
  • RightCtrl+’+o = ó

linux black desktop

It’s a bug which affects only one user and not the whole graphical desktop, but only the “desktop” in a narrow sense.

A workaround can be to rename the .config folder (to something like .config.old) so that you can get anew your whole graphical desktop and then maybe you could copy (prudently) one by one your config files (from .config.old to the new .config folder).

rename identical files (with different names) in different devices

You can use a zsh script (let we call “rename-identical-files.bash”) with a code like the following

#! /bin/zsh -
zmodload zsh/stat || exit
typeset -A size_to_name
model_folder=${1?}

CDPATH= cd -P -- "$model_folder" || exit
for f in *(ND.); do
  stat -LA size +size -- $f &&
    size_to_name[$size]=$f &&
    print -r "# File of size $size should be named ${(q)f}"
done

cd $OLDPWD || exit
for f in *(ND.); do
  stat -LA size +size -- $f &&
    (($+size_to_name[$size])) &&
    [[ $f != $size_to_name[$size] ]] &&
    print -r mv -i -- ${(qq)f} ${(qq)size_to_name[$size]}
done
#usage:  that-script /model-folder-path

then you can go to the folder where you want rename the files and do this terminal command:

~/rename-identical-files.bash /path/to/model/folder

in this way, before executing the command, you can see what could happen afterwards. If it’s all ok, do the command:

~/rename-identical-files.bash /path/to/model/folder | sh

cfr. https://unix.stackexchange.com/questions/627319/avoid-spaces-and-apostrophes-problems-with-ls-in-a-awk-script#627328