Skip to content

Instantly share code, notes, and snippets.

@ilkarman
Last active December 1, 2019 10:44
Show Gist options
  • Save ilkarman/8db47e1d43ce736824d9e318d1b27e02 to your computer and use it in GitHub Desktop.
Save ilkarman/8db47e1d43ce736824d9e318d1b27e02 to your computer and use it in GitHub Desktop.
Useful Linux Commands
# Kill all processes in nvidia-smi
kill -9 $(nvidia-smi | sed -n 's/|\s*[0-9]*\s*\([0-9]*\)\s*.*/\1/p' | sort | uniq | sed '/^$/d'
# Resize param for ffmpeg: 171 width, 128 height & pad (without stretching)
-vf "scale=iw*min(171/iw\,128/ih):ih*min(171/iw\,128/ih),pad=171:128:(171-iw)/2:(128-ih)/2"
# Stop/remove all docker containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
# Count all files in (sub)folder(s)
find . -type f | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment