Scripts

# extract audio from video file
IFS=$(echo -en "\n\b")
for i in $(ls /media/${USER}/*/*); do
avconv -i $i -vn -c:a copy /tmp/${i##*/}.mp3
done

# join multiple PDF files
cd /media/*/Linux-Magazin*/pdf
for DIR in $(ls); do
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/tmp/lm2013-${DIR}.pdf ./${DIR}/*.pdf
done

# lm
for i in $(ls *.jpg); do
convert -page A4 -density 72 $i $i.pdf
done

rm /tmp/lm20*.pdf
for x in {01..12}; do
pdftk lm13/c/cover-${x}-*.pdf lm13/pdf/${x}/*.pdf cat output /tmp/lm2013-${x}.pdf
done