Basti’s Buggy Blog

Poking at software.

TIL - Today I Learned

Random useful commands and notes.

H264 Encoding for Maximum Compatibility

  • Pixel format yuv420p should be used
  • Video dimensions need to be divisible by 2 for that -> Crop
ffmpeg -i input.mp4 -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -pix_fmt yuv420p output.mp4

Check Full Path Permissions

source

namei -m /path/to/really/long/directory/with/file/in

Rename Files Efficiently

rename match_this replace_with_this *.png

Pacman Temporary Package Installation

If you want to try out a package without forgetting to remove it later, install it as a dependency.

sudo pacman -S --asdeps <package>

Remove all orphaned packages later with:

sudo pacman -Rns $(pacman -Qtdq)

(Arch) Linux Installation Directories

source Where to install programs to? TL;DR

  • Monolithic: /opt
  • Manual installation: /usr/local/{bin,share}
  • Automatic installation (pacman, yay, …): /usr/{bin,share}

All executables go to …/bin, resources go to …/share

Strip Metadata

Only for images (imagemagick):

mogrify -strip <images>

For all files (mat2):

mat2 <file>

Connect to a STARTTLS IMAP Server

openssl s_client -showcerts -connect <hostname>:143 -starttls imap