How-tos (Linux tips)

Multimedias - Conversions

Convert Wav to Flac

Convert all wav files to flac files in a folder

for i in *.wav; do ffmpeg -i "$i" "$i".flac ; done

Convert Flac to Mp3 files

for f in *.flac; do flac -cd "$f" | lame -b 320 - "${f%.*}".mp3; done

Compress all mp4 videos in a folder

for i in *.mp4; do ffmpeg -i "$i" -vcodec libx265 -crf 28 "${i%.*}_compressed.mp4"; done

Compress all mov videos in a folder

for i in *.mov; do ffmpeg -i "$i" -vcodec libx265 -crf 28 "${i%.*}_compressed.mp4"; done

Convert HEIC images to jpg

sudo apt install libheif-examples
for file in *.heic; do heif-convert "$file" "${file/%.heic/.jpg}"; done

Pick a random file with Totem

totem "$(ls -R | shuf -n1)"

If Totem can't read some mkv or mp4 vidéo

After upgrading to Ubuntu 22.04 I had some issue to read some video files (Totem crash at startup, display the error “The specified movie could not be found” or open the video with a strange format. I did install the Intel non-free drivers to solve this issue:

sudo apt install intel-media-va-driver-non-free ubuntu-restricted-extras


Download test

curl -4 -o /dev/null

Upload test

curl -o /tmp/temp.iso
curl -4 -o /dev/null -F "filecontent=@/tmp/temp.iso"

Display public IP address



Install cifs/nfs

sudo apt install nfs-common
sudo apt install cifs-utils

Install DCP-7055W scan driver


Get SSH banned IP

fail2ban-client status sshd


Pulse Audio

Installation of Airplay in Ubuntu 22.04 with Pulse Audio

# Airplay ability 
sudo apt install pulseaudio build-essential paprefs git pulseaudio-module-raop intltool libjack0 pavucontrol pulseaudio-module-zeroconf
#bug pulseaudio 
sudo ln -s /usr/lib/pulse-16.1+dfsg1/ /usr/lib/pulse-16.1
pactl load-module module-raop-discover


Discover Airplay in Ubuntu 22.10 with PipeWire

sudo vi /etc/pipewire/pipewire.conf

Add the following line to load module inside the context.modules = [ section

{ name = libpipewire-module-raop-discover }


sudo apt install libdvdnav4 libdvdread4 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg
sudo dpkg-reconfigure libdvd-pkg
sudo apt install ubuntu-restricted-extras



pihole -up


Remove files recursively

# remove lrc files
find -type f -name "*.lrc" -delete
# remove .DS_Store files
find -type f -name ".DS_Store" -delete

Remove duplicate files

fdupes -rdN .

Search .Mp3 files

find . -iname "*.mp3" -print


Move the Dock 'Show Applications' button at top

gsettings set show-apps-at-top true

Move the windows control button to the left

gsettings set  org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'

Nice projects

Vous aussi
participez au projet !