Last active
June 3, 2018 20:30
-
-
Save MafiaInc/3c7ac065b3eae3f01b1c to your computer and use it in GitHub Desktop.
Small snippets to remember that I use from time to time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[ "$(ps -o stat= -p $PPID)" = "Ss" ]] && echo "Executed in foreground" || echo "Executed in background" | |
# credit : https://stackoverflow.com/questions/4261876/check-if-bash-script-was-invoked-from-a-shell-or-another-script-application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e "Use%\tAvail:\tMounted on:" ; df -hTP | sort -nr -k6 | grep -P '\d%' | awk '{ printf $6 ; printf "\t" ; printf $5 ; printf "\t" ; print $7 }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `find . -name "*.webm" -print`; | |
do | |
DIR=`dirname $i`; | |
NAME=`basename $i`; | |
ffmpeg -i $i -s 620x348 -ss 00:00:08.435 -vframes 1 ${DIR}/${NAME%.webm}.jpg; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment