To content | To menu | To search


Set bepo keyboard layout in terminal

Mettre le clavier en bépo dans un terminal

X session: setxkbmap fr bepo
True console:
apt install keyboard-configuration console-setup
dpkg-reconfigure keyboard-configuration
dpkg-reconfigure console-setup


Colors in the console

Couleurs dans le terminal

alias ls='ls --color=auto'
alias grep='grep --color'
alias diff='colordiff'
alias tail='colortail'
alias make='colormake'

All at once and even more :



Find what directories are using your disk space

Trouver quels sont les dossiers qui occupent l'espace de votre disque

du -h
du --max-depth=1 . | sort -nr [1]
ncdu [2]


[1] List size of immediat sub-folders

[2] NCurses Disk Usage : apt install ncdu


Replace a text in all buffers/files opened in vim

Remplacer un texte dans tous les fichiers ouverts dans vim

:argdo %s/foo/bar/g | wq


Download a .deb package and its dependencies

Télécharger un paquet Debian et ses dépendances

./ <package-name> [<wanted-architecture>]

Source available here :

arch=$2 || 'amd64'

for dep in `apt-rdepends "$pkg_name" | grep -v "^ "`; do
    apt-get download "$dep":"$arch"

apt-get download "$pkg_name":"$arch"


Convert translated .po file into virgin .pot template

Convertir un fichier de traduction .po plein en modèle .pot vide / vierge

:%s/msgid\_.\{-}msgstr \(\(".*"\_.\)*\)/msgid \1msgstr ""\r/ [1]


[1] This is a practical usage example of the replace statements of vim explained here


Protect your eyes from screen's blue light

''Protéger vos yeux de la lumière bleue des écrans'

apt install redshift-gtk
man redshift [1]


[1] You need to set a config file with your GPS coord, and red levels for day and night.


Replace all occurrences of a text via vim (various forms)

Remplacer toutes les occurences d'un texte dans vim

  • :%s/foo/bar/g [1]
  • :%s+/foo+/bar+g [2]
  • :%s/\Cfoo/bar/g [3]
  • :s/f\(o\)\{-}/ba\1/ [4]
  • :s/\(.*\)\_./\1/ [5]


[1] % to treat all lines, foo is replaced by bar, g to treat all the occurrences in treated lines

[2] If target text contains a slash (/) use any other delimiter letter, here it's +

[3] \C for case sensitivity

[4] \{-} non-greedy search ; \1 will be replaced by the first captured text in parenthesis, so the 1st o found : fol -> baol

[5] \_. match every characters including new line ones ; so this concatenates 2 lines


List process with network activity

Lister les processus ayant une activité réseau

netstat -ptu [1]
nethogs [2]


[1] Single shot

[2] Continuous scrutation, top/htop-like

Configure CUPS

Configurer CUPS

http://localhost:631 [1] [2]


[1] I never remember this one… its the IPP Internet Printing Protocol port number : grep ipp /etc/services

[2] To modify configurations you need to enter your user or root password ; the user needs to be in the lpadmin group


Check if your Linux kernel is vulnerable to Spectre or Meltdown attacks

Vérifier si votre noyau Linux est vulnérable à Spectre ou Meltdown

curl | bash [1] [2]


[1] This is a perfect example of what you should avoid to do as a root user without having read and understood the sources, or really trust the author

[2] Mozilla mentionned Spectre & Meltdown mitigation in Firefox starting from version : 57.0.4

Mount an iPod

Monter un iPod

modprobe hfs
mount -t hfsplus /dev/sdb3 /media/ipod/


Recompress FLAC music at max compression and keep original ID3 metadata

Recompresser des musiques FLAC au niveau max en gardant les métadonnées originale au format ID3

reflac --best folder/ [1]


[1] reflac from chungy/reflac Github repository.


Restore lost files from disc, cdrom or camera with photorec

Récupérer des fichiers supprimés de tout support avec photorec

photorec /dev/sdc [1]


[1] Follow terminal's instructions

Test and restore lost partitions with testdisk

Vérifier et restaurer des partitions perdues avec testdisk

testdisk /dev/sdc [1]


[1] Follow terminal's instructions…

- page 1 of 4