Sometimes, I need to share a binary file, such as a screen shot, or a tarball.
For that, I wrote the pbput (and pbget) scripts!
The pbput script works on either standard in, or a file argument, lzma compresses the input, base64 encodes it, and then uses pastebinit to post to pastebin.com.
And the pbget script basically reverses that process, using wget to retrieve the remote data, base64 decoding it, lzma decompressing it, and writing it to standard out.
Try it for yourself!
pbput /tmp/Screenshot.png
http://pastebin.com/c9JtQ4WT
pbget http://pastebin.com/c9JtQ4WT > /tmp/out.png
md5sum /tmp/*png
f7e7ba26a2681c0666ebca022c504594 /tmp/out.png
f7e7ba26a2681c0666ebca022c504594 /tmp/Screenshot.png
If you find this useful, install the bikeshed package from Natty, or from the Bikeshed PPA for other versions of Ubuntu.
:-Dustin

