4 ms·
[tyho@localhost immut]$ < $LARGE_FILE split --bytes=1M --filter='curl --verbose --data-binary @- http://immut.io/blobs 2>&1' | dos2unix | awk '/< Location/ {pri
by tyho 12y ago
[tyho@localhost immut]$ < $LARGE_FILE split --bytes=1M --filter='curl --verbose --data-binary @- http://immut.io/blobs 2>&1' | dos2unix | awk '/< Location/ {print "http://immut.io"$3}' > urls
[tyho@localhost immut]$ while read url; do curl -s "$url"; done < urls > $OUTPUT
This will end with a massive bill for you if you are not more careful.
EDIT: something seems wonky
[tyho@localhost immut]$ curl -d @gpl-3.0.txt http://immut.io/blobs
See Other. Redirecting to /blobs/510ac865-3b31-4513-8567-868cd22c256e
[tyho@localhost immut]$ wget http://immut.io/blobs/510ac865-3b31-4513-8567-868cd22c256e
2015-04-19 22:57:59 (328 KB/s) - ‘510ac865-3b31-4513-8567-868cd22c256e’ saved [34473/34473]
[tyho@localhost immut]$ sha1sum gpl-3.0.txt 510ac865-3b31-4513-8567-868cd22c256e
8624bcdae55baeef00cd11d5dfcfa60f68710a02 gpl-3.0.txt
09e3088ce2360bd71d0f200baec058fbe51ac81e 510ac865-3b31-4513-8567-868cd22c256e
Linebreaks are acting up or something.
- tg3 12y agoYeah, something weird is going on, I'm looking into it. You're right that this could end up costing me quite a bit, but I'm still safe right now, with a couple of safeguards to prevent it from running away from me. EDIT: The issue you're seeing might be because `curl -d @filename` strips out newlines before sending it as data
- tyho 12y agoah yes, strange behaviour from curl, example above is fixed.