Skip to content

Instantly share code, notes, and snippets.

@yamachu
Last active May 25, 2016 15:15
Show Gist options
  • Save yamachu/8714d862531aa69e141fa1a6defe5c65 to your computer and use it in GitHub Desktop.
Save yamachu/8714d862531aa69e141fa1a6defe5c65 to your computer and use it in GitHub Desktop.
某講義の資料のパスワードを解除してSlackに投げ込むやつ
#!/bin/sh
NUM=`cat ~/.myapp/alg_getter`
wget ページのURL/alg16${NUM}.pdf
if [ ! $? -eq 0 ]; then
exit
fi
# qpdfくんが有能
qpdf --password='あのパスワード' --decrypt alg16${NUM}.pdf decrypt_alg16${NUM}.pdf
# 適当に自分でSlackに投げるスクリプト
# python bin/file_send.py decrypt_alg16${NUM}.pdf
if [ ! $? -eq 0 ]; then
exit
fi
printf %02d $((NUM + 1)) > ~/.myapp/alg_getter
rm alg16${NUM}.pdf decrypt_alg16${NUM}.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment