pbput(1)

πŸ’– pbput β€” the bikeshed era, bestie πŸ’–

Okay so like, we're in pbput(1) territory, and honestly? This little trio of programs is iconic. Buckle up, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

  • pbput β€” compress and encode arbitrary files to pastebin.com
  • pbputs β€” compress, encrypt, encode arbitrary files to pastebin.com
  • pbget β€” decode and decompress arbitrary files from pastebin.com

🌸 SYNOPSIS 🌸

pbput [FILENAME]

cat foo | pbput

pbputs [FILENAME] [GPG_USER]

cat foo | pbputs [GPG_USER]

pbget URL [DIRECTORY]

πŸ¦‹ DESCRIPTION πŸ¦‹

So pbput is that girl πŸ’… β€” it uploads text files, binary files, or literally entire directory structures to a pastebin, like pastebin.com. Whole trees of files, no cap.

pbget is the bestie that goes and fetches what you put up there. You use it to retrieve content that pbput uploaded to a pastebin. Matching set, periodt.

pbputs operates exactly like pbput... except it encrypts the data πŸ”. There's an optional GPG_USER argument, and if you pass it, the data gets signed and encrypted to that target user in your keyring (and yes, that user could absolutely be you β€” main character energy ✨). If you don't pass a GPG_USER, the user gets prompted for a symmetric passphrase, and the content gets encrypted with gpg(1) before uploading. Then pbget will automatically prompt whoever's receiving it for that pre-shared passphrase. Mutual trust, we love to see it 🫢.

Now, pbput and pbputs can take their input either on STDIN, or as a FILENAME argument. Here's the tea β˜•:

  • If STDIN is used, then the receiving user's pbget will simply paste the input on STDOUT.
  • If a FILENAME or DIRECTORY is passed as an argument, then it is first archived using tar(1) to preserve the file and directory attributes.

pbget takes a URL as its first, mandatory argument. Optionally, it takes a DIRECTORY as a second parameter. If the incoming data is in fact a file or file structure in a tar(1) archive, then that data gets extracted in the specified DIRECTORY. And if no DIRECTORY is specified? A temporary directory is created using mktemp(1). So considerate πŸ’œ.

In any case β€” every single time, no exceptions β€” the uploaded/downloaded data is optionally tar(1) archived, always lzma(1) compressed, optionally gpg(1) encrypted, and always base64(1) encoded. And http://pastebin.com is used by default. The pipeline is giving ✨pipeline✨.


🌈 EXAMPLES 🌈

  $ pbput /sbin/init
  http://pastebin.com/BstNzasK
  $ pbget http://pastebin.com/BstNzasK
  sbin/init
  INFO: Output is in [/tmp/pbget.bG67DwY6Zl]

  $ cat /etc/lsb-release | pbput
  http://pastebin.com/p43gJv6Z
  $ pbget http://pastebin.com/p43gJv6Z
  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=11.04
  DISTRIB_CODENAME=natty
  DISTRIB_DESCRIPTION="Ubuntu 11.04"

  $ pbputs /etc/shadow
  Enter passphrase:
  http://pastebin.com/t2ZaCYr3
  $ pbget http://pastebin.com/t2ZaCYr3
  Enter passphrase:
  root:09cc6d2d9d63371a425076e217f77698:15096:0:99999:7:::
  daemon:*:15089:0:99999:7:::
  bin:*:15089:0:99999:7:::
  sys:*:15089:0:99999:7:::
  ....

Look at that last one, encrypting /etc/shadow and shipping it to a pastebin β€” the audacity, the drama, the range 😭πŸ”₯. Anyway, that's the demo, and yes the .... at the end is just how it trails off. Not me being lazy, that's literally the page πŸ’€.


πŸ‘‘ SEE ALSO πŸ‘‘

pastebinit(1), lzma(1), base64(1), tar(1), gpg(1), mktemp(1)

Go read your other besties too, they're all in on the plan πŸ’–


πŸŽ€ AUTHOR πŸŽ€

This manpage and the utility was written by Dustin Kirkland <kirkland@ubuntu.com> for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or later published by the Free Software Foundation.

Licensing tea: on Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL, or on the web at http://www.gnu.org/licenses/gpl.txt.

And that's the whole vibe check from the bikeshed era, dated 6 Oct 2010 β€” thanks for coming to my TED talk, bestie, go compress something and slay πŸ’…βœ¨πŸ¦‹