Collection of commands and utilities for quick look-up
Cleaning resources in kubernetes namespace:
kubectl get pods -n mynamespace --no-headers=true | awk '/pattern1|pattern2/{print $1}' | xargs kubectl delete -n mynamespace pod
Yes/no prompt in bash.
This snippet will give a yes/no prompt if
INPUT_PATH
variable is a directory.if [ -d "$INPUT_PATH" ]; then read -r -p "Given path is a directory. Continue? [Y/n] " input case $input in [yY][eE][sS]|[yY]) echo "Yes" # add commands that you want to run when user says yes here ;; [nN][oO]|[nN]) echo "No" echo "Aborting" exit 0 ;; *) echo "Invalid input..." exit 1 ;; esac fi
Convert an image from
HEIC
format toJPG
format.Use
convert
command from imagemagick.magick convert foo.HEIC foo.jpg
Add more here