51 lines
1.1 KiB
Docker
51 lines
1.1 KiB
Docker
# Docker function definitions
|
||
|
||
function speedtest() {
|
||
docker run --rm tianon/speedtest
|
||
}
|
||
|
||
function docker-imagecheck() {
|
||
created=$(date -d $(docker inspect "$1" | jshon -e 0 -e Created -u) "+%s")
|
||
now=$(date "+%s")
|
||
if [ "$((created + (5*24*60*60)))" -lt "$now" ];then
|
||
echo "$1 is older than 5 days, pulling…"
|
||
docker pull $1
|
||
else
|
||
echo "$1 is up to date, skipping…"
|
||
fi
|
||
}
|
||
|
||
# gimp on host is very broken, so this is my (temporary) workaround
|
||
function docker-gimp() {
|
||
docker run --rm -it \
|
||
-e DISPLAY \
|
||
-e HOME=/home/gimp \
|
||
-u $(id -u) \
|
||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||
-v $PWD:/home/gimp/data/ \
|
||
-v /tmp/:/home/gimp/tmp/ \
|
||
-v ~/.local/share/gegl-0.4:/home/gimp/.local/share/gegl-0.4 \
|
||
-v ~/.config/GIMP/:/home/gimp/.config/GIMP/ \
|
||
jess/gimp $@
|
||
}
|
||
|
||
function vobsub2srt() {
|
||
docker run \
|
||
--rm \
|
||
-v $PWD:/data \
|
||
-u $(id -u) \
|
||
sbruder/vobsub2srt \
|
||
--blacklist '„“”|’/\`_~<>' \
|
||
$@
|
||
}
|
||
|
||
function aucdtect() {
|
||
docker run \
|
||
--rm \
|
||
-v "$PWD:/home/aucdtect/:ro" \
|
||
-e uid=$(id -u) \
|
||
-e gid=$(id -g) \
|
||
sbruder/aucdtect \
|
||
$@
|
||
}
|