This file contains 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
# Phase 1 Retrieves directories, creates hierarcy from current working directory. | |
mfind -t d ~~/stor/winfoo | sed "s,/$MANTA_USER/stor/,," | xargs -I {} mkdir -p "{}" | |
# This retrieves object paths, splits into download file and target local directory file | |
# Phase 2 retrieves objects, splits into source/target directories, calls mget | |
mfind -t o ~~/stor/winfoo | tee dnldfiles.txt | sed -e "s,/$MANTA_USER/stor/,," | xargs -I {} dirname "{}" > dnlddirs.txt | |
# the dnlddirs.txt file can be prepended with a target directory or windows-ified | |
cat dnldfiles.txt | xargs -I {} basename "{}" > dnldnames.txt |
This file contains 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
mfind -t o ~~/stor/winfoo | xargs -I {} mrm "{}" | |
mfind -t d ~~/stor/winfoo | sort -r | xargs -I {} mrmdir "{}" |
This file contains 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
echo /${MANTA_USER}/${USER_PATH}/${USER_ORIGINALS}/input_list.txt | \ | |
mjob create ${MJOB_ARGS} "xargs mcat" -m "${CONVERT_JOB} && ${MPIPE_STR} < ${PDIR_STR}" |
This file contains 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
mjob create -w -r "mfind /${MANTA_USER}/${USER_PATH}/${USER_ORIGINALS} -n 'jpg$' > /var/tmp/out.txt && \ | |
mput -f /var/tmp/out.txt /${MANTA_USER}/${USER_PATH}/${USER_ORIGINALS}/input_list.txt" < /dev/null |
This file contains 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
# install.packages(c("RCurl","RJSONIO"), dependencies = TRUE) | |
require(RCurl); require(RJSONIO); | |
ACTION="/cwvhogue/stor" | |
MANTA_USER<-Sys.getenv("MANTA_USER"); | |
MANTA_KEY_ID<-Sys.getenv("MANTA_KEY_ID"); | |
MANTA_URL<-Sys.getenv("MANTA_URL"); | |
USER_HOME<-Sys.getenv("HOME"); | |
USER_KEY<-"/.ssh/id_rsa"; | |
key_location<-paste(USER_HOME,USER_KEY,sep=""); | |
openssl_cmd="openssl"; |
This file contains 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
mfind ~~/public/originals | mjob create 'mrm $MANTA_INPUT_OBJECT' |
This file contains 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
#!/bin/bash | |
SITE="https://us-east.manta.joyent.com/mantademo/public/images/getty-open/" | |
DEST="/$MANTA_USER/public/" | |
# For more files change "-20" below to a larger number. | |
# For the complete download, remove "head -20 |" below | |
mmkdir -p ${DEST}/originals | |
curl -ksL ${SITE}/filelist.txt | head -20 | mput ${DEST}/filelist.txt | |
echo ${DEST}/filelist.txt | mjob create -m "xargs -I {} sh -c 'curl -ksL ${SITE}/originals/{} | mput ${DEST}/originals/{}'" |
This file contains 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
#!/bin/bash | |
curl -k https://us-east.manta.joyent.com/mantademo/public/images/getty-open/filelist.txt > filelist.txt | |
cat filelist.txt | xargs -I {} curl -k https://us-east.manta.joyent.com/mantademo/public/images/getty-open/originals/{} -o {} |
This file contains 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
time mfind /$MANTA_USER/public/art -n '1.jpg$' | mjob create --memory 2048 -w -m 'convert $MANTA_INPUT_FILE -colorspace RGB -resize 250000@ -colorspace sRGB -quality 80 /var/tmp/out.jpg && mpipe ${MANTA_INPUT_OBJECT%.*}_s.jpg < /var/tmp/out.jpg' |
This file contains 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
find . -name '*.jpg' -exec sh -c 'convert "{}" -colorspace RGB -resize 250000@ -colorspace sRGB -quality 80 `basename "{}" .jpg`_250.jpg' ';' |
NewerOlder