2018-12-27 22:40:35 +00:00
|
|
|
plugins=(
|
2019-10-27 02:47:42 +00:00
|
|
|
cp
|
2018-12-27 22:40:35 +00:00
|
|
|
docker
|
|
|
|
docker-compose
|
|
|
|
git
|
|
|
|
golang
|
|
|
|
history
|
|
|
|
perms
|
|
|
|
sudo
|
|
|
|
systemadmin
|
|
|
|
systemd
|
|
|
|
)
|
2019-02-09 15:58:23 +00:00
|
|
|
case $(uname -rv) in
|
2019-10-27 02:47:42 +00:00
|
|
|
*Ubuntu*)
|
|
|
|
plugins+=(
|
|
|
|
ubuntu
|
|
|
|
)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
plugins+=(
|
|
|
|
archlinux
|
|
|
|
)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
function docker-all {
|
|
|
|
for ((i=0;i<=4;i++)); do
|
|
|
|
docker -H ssh://fra-n${i} $@
|
|
|
|
done
|
|
|
|
}
|
|
|
|
function build-n-push {
|
|
|
|
docker build ${1} --tag=localhost:5000/${2} && docker push localhost:5000/${2}
|
|
|
|
}
|
|
|
|
function manpdf {
|
|
|
|
man -Tpdf $1 | okular - &
|
|
|
|
disown
|
|
|
|
}
|
|
|
|
function gitsubrepo {
|
|
|
|
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;
|
|
|
|
}
|
|
|
|
function gitcom {
|
|
|
|
git add -A && git commit -am "$1" && git push
|
|
|
|
# git diff HEAD^ --compact-summary | while read LINE; do echo "$LINE"; done
|
|
|
|
}
|
|
|
|
function osutab {
|
|
|
|
xinput set-prop 'UGTABLET 6 inch PenTablet Pen (0)' --type=float 153 3.5 0 -0.5 0 2.9 0 0 0 1
|
|
|
|
}
|
|
|
|
function ignorekate {
|
|
|
|
printf ".*~\n*.kate-swp" >> .gitignore
|
|
|
|
}
|
|
|
|
function tonullpointer {
|
|
|
|
if [ -z ${1} ]; then
|
|
|
|
RANDFN=${RANDOM}
|
|
|
|
> /tmp/${RANDFN}
|
|
|
|
curl -F"file=@/tmp/${RANDFN}" http://0x0.st
|
|
|
|
rm /tmp/${RANDFN}
|
|
|
|
else
|
|
|
|
curl -F"file=@${1}" http://0x0.st
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function convert2gif {
|
|
|
|
ffmpeg -hwaccel vdpau -i $1 -r 60 -vf "scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 ${1%.*}.gif
|
|
|
|
}
|
|
|
|
function youtube2gif {
|
|
|
|
if [ -z ${1} ] || [ -z ${2} ] || [ -z ${3} ]; then
|
|
|
|
echo "Usage: youtube2gif <url> <start position> <lenght> [resolution] [framerate] [bitrate]";
|
|
|
|
else
|
|
|
|
ffmpeg -ss ${2} -t ${3} -hwaccel vdpau -i $(youtube-dl -gf "bestvideo[height<=${4-360}]" ${1}) -r ${5-60} -vf "scale=${4-360}:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -b:v ${6-1000} -loop 0 -f gif -;
|
|
|
|
fi
|
|
|
|
}
|