Created
August 17, 2020 18:10
-
-
Save jsteenb2/183e8dd92980cbc6ba03346e604e7e3e to your computer and use it in GitHub Desktop.
helper dotfile
This file contains 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
alias srcz='source ~/.zshrc' | |
alias vimz='vim ~/.zshrc' | |
alias gitcop='git co master && git fap && git pull' | |
alias ggui='git gui' | |
alias poof='git poof' | |
whoseport () { | |
lsof -i ":$1" | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} LISTEN | |
} | |
ls () { | |
command ls -lh $2 | |
} | |
shrink () { | |
FILE=$(basename -- "$1") | |
local mp4="${FILE%%.*}.mp4" | |
ffmpeg -i $1 ${2:-$HOME/Desktop/mp4ed/$mp4} | |
} | |
speedch () { | |
while (( $# )) do | |
case $1 in | |
--pts) | |
pts=$2 | |
shift | |
;; | |
-i|--input) | |
input="$2" | |
shift | |
;; | |
-o|--output) | |
output="$2" | |
shift | |
;; | |
*) echo "invalid argument provided: $1" | |
return 1 | |
esac | |
shift | |
done | |
[[ ! $input ]] && echo "no input file provided" && return 1 | |
[[ ! $output ]] && echo "no output file provide" && return 1 | |
[[ ! $pts ]] && echo "no point set opt provided" && return 1 | |
ffmpeg -i $input -filter:v "setpts=${pts}*PTS" $output | |
} | |
gifit () { | |
while (( $# )) do | |
case $1 in | |
--fps) | |
fps=$2 | |
shift | |
;; | |
--scale) | |
scale="$2" | |
shift | |
;; | |
--loop) | |
loop="$2" | |
shift | |
;; | |
-i|--input) | |
input="$2" | |
shift | |
;; | |
-o|--output) | |
output="$2" | |
shift | |
;; | |
*) echo "invalid argument provided: $1" | |
return 1 | |
esac | |
shift | |
done | |
[[ ! $input ]] && echo "no input file provided" && return 1 | |
[[ ! $output ]] && echo "no output file provide" && return 1 | |
ffmpeg -i $input -vf "fps=${fps:-30},scale=${scale:-640}:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop ${loop:-0} $output | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment