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

Network

Download test

curl -4 -o /dev/null http://bouygues.testdebit.info/100M.iso

Upload test

curl -o /tmp/temp.iso https://bouygues.testdebit.info/100M.iso
curl -4 -o /dev/null -F "filecontent=@/tmp/temp.iso" http://bouygues.testdebit.info

Fstab

Install cifs/nfs

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

Install DCP-7055W scan driver

Fail2ban

Get SSH banned IP

fail2ban-client status sshd

AirPlay

Pulse Audio

Installation of Airplay in Ubuntu 22.04 with Pulse Audio

sudo apt-get install paprefs pavucontrol pulseaudio-module-raop pulseaudio-module-zeroconf
cd /usr/lib
#On Ubuntu 22.04
sudo ln -s /usr/lib/pulse-15.99.1+dfsg1/ /usr/lib/pulse-15.99
paprefs

PipeWire

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 }

HandBrake

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

Pi-hole

Upgrade

pihole -up

Files

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 .

Gnome

Move the Dock 'Show Applications' button at top

gsettings set org.gnome.shell.extensions.dash-to-dock 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 !