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

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}"

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]}
#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

windows issues

In KDE Linux it could happen some issues with windows:

  1. rules not memorized: to fix it check if configurations files (tipically in ./config/ kwinrc and kwinrulesrc) have the right permissions (avoid: non access).
  2. new window below others already active: such as Clementine’s window, called from system tray, going below other windows; to fix this you have to set Focus stealing prevention in Window Behavior (the first tab of Window management in System settings) to none, as you can see in the image

    la regola da impostare.

disk full in linux

It may happen that your partition is almost full. So you can try to see where are too big files: probably as cache files or log ones, in particular in /var.

You can delete useless (f.e. old) cache files and empty log files, these last with this command:

cat /dev/null > filename.log

ricordi del passato (informatico)

Il mio primo PC è stato un Olivetti 086, con 20 mb di disco fisso e meno di 1 mega di ram (non ricordo più esattamente). Con windows 3.1 e una versione di MS Word che non era mica da buttar via, con il suo file che conteneva sia i fogli di stile sia le macro.

Installare windows richiedeva una quindicina di floppy disks. Non c’erano CD, e men che meno DVD.

Fondamentali erano i files di configurazione: config.sys e autoexec.bat, caricati all’avvio. In autoexec.bat alla fine c’era il comando per far partire windows.

E la stampante? Ovviamente ad aghi: lenta e rumorosa, oltre che enorme.

Che tempi!