linux

an Adélie penguin keeping her young warm. Scottish Geographical Magazine (1885)
Adélie. Scottish Geographical Magazine

packages

# install
sudo apt install package

# install .deb
sudo dpkg -i file.deb

# update
sudo apt update && sudo apt dist-upgrade

# purge orphans
sudo apt purge `deborphan`

# view installed packages
sudo apt list --installed

# view upgradable packages
sudo apt list --upgradable

imagemagick

# resize image to 400px width
mogrify -resize 400x img.jpg

# desaturate image
convert img.jpg -colorspace Gray img.jpg

# dithering
convert img.jpg -dither FloydSteinberg -colors 8 dithered.jpg

ffmpeg

# clip a video (works on audio too)
ffmpeg -i video.mp4 -ss 00:01:10 -to 00:01:30 -c copy clipped.mp4

random

See the most used commands from history

history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head

Find duplicate files

fdupes -r ./

Remove metadata

mat2 --inplace image.png
exiftool -all= document.pdf
exiftool -all= -overwrite_original document.pdf

resources