From the Canyon Edge -- :-Dustin

Monday, October 18, 2010

bikeshed: pbput and pbget (pastebin binary files)

I absolutely love the pastebinit tool, from Stephane Graber. Genius, I tell you. I must use it 20 times per day, to share source code and configuration files.

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

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

pbget > /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.



  1. I love pastebinit as well. My only gripe is that it uses by default. I prefer as it's much cleaner.

    I've filed a bug for it, so hopefully Stephane will take it into consideration (

  2. This is really cool! However, I was really hoping for an easter egg.

  3. Sweet!
    How are you dealing with size-limited pastebins ?
    If I remember well, a lot of them don't let you post something longer than x hundreds of lines.

  4. stgraber-

    It only supports right now, which has a ~1MB limit. I could make that configurable, I suppose.

    BTW, would you be interested in taking this (or implementing this concept) in pastebinit? My scripts are shell, and pastebinit is python, which is the only reason I haven't sent it to you yet...


  5. Brian,

    Here you go:


  6. Hey Mario,

    Yeah, I agree. I have had this in my .bashrc for the last few years:

    alias pastebinit='pastebinit -b'

    Unfortunately, I can't use for pbput/pbget because the raw download is behind an openid auth.



Please do not use blog comments for support requests! Blog comments do not scale well to this effect.

Instead, please use Launchpad for Bugs and StackExchange for Questions.