Last active
August 29, 2015 14:09
-
-
Save gaving/900f31dad54266b48b46 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
q() { | |
/bin/mysql --unbuffered --skip-column-names --raw -A -B -e "$@" | |
} | |
images() { | |
( | |
for i in {1..$(q "select MAX(photoid) from photos")}; \ | |
echo -n $i && q "select photo from photos where photoid=${i}" | magick - info:- | |
) | sort -h -k 7 | tail -n 10 | |
} | |
# wishlist, get 'magick' to pipe | |
# http://stackoverflow.com/questions/12594364/can-i-output-multiple-files-to-stdout-and-process-them-individually | |
# http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=18320 | |
# http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=26276 | |
# e.g. q "select photo from photos where photoid=1" | magick - info:- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment