I'm quite proud to say that the pbput and pbget utilities have graduated from their incubating home in the bikeshed package and have made it into the more ubiquitous pastebinit package. A huge thanks to Stéphane Graber for merging these useful utilities!
As of Ubuntu 12.04 LTS (precise), anywhere you have the pastebinit command, you'll also have the ability to pbput and pbget data.
"And so what does that mean?" you ask :-)
- Have you ever wanted to just download some raw data, maybe some code or text, from a pastebin?
- Or have you ever needed to pass someone some raw data, perhaps binary, perhaps text, perhaps an entire directory tree, and just wanted to give them a URL?
- And have you ever wanted to do that totally securely?
Try this on an up-to-date Ubuntu 12.04 system:
$ pbget http://pastebin.com/ut6MHMWJ usr/bin/pbput INFO: Output is in [/tmp/pbget.60RezTX8QF]
$ bzr branch lp:pastebinit Branched 150 revisions. $ pbput pastebinit http://pastebin.com/8ReP9QLV
Note that you (the poster) might have to visit that url once manually and enter a captcha, to convince pastebin.com that you're not a bot.
But you can now:
$ pbputs supersecret.txt email@example.com
You can try downloading that one, but it's encrypted with Stephan's public key, so he's the only one who can make any sense out of it!
It's really quite simple, actually... pbput, pbget, and pbputs are all symlinks to a single shell script that at /usr/bin/pbput, which is only 74 lines of code!
When you pbput data, it's bundled into an archive using tar, optionally encrypted with gpg, compressed using lzma, encoded using base64, and then posted to a pastebin using pastebinit.
And a pbget is just unwrapping each of those, retrieving it from the pastebin using wget, decoding, decompressing it, optionally decrypting it, and exploding the archive.
If the data was posted using standard in, the output comes back in standard out. And if the data was posted as a file or directory, it gets dumped to a new temporary directory created by mktemp.
Slick, huh? :-) Give it a try and let me know what you think!!!