From ArchWiki
Jump to navigation Jump to search

Gnome-colors-add-files-to-archive.pngThis article is being considered for archiving.Gnome-colors-add-files-to-archive.png

Reason: ptpb.pw is shut down. (Discuss in Talk:Pb#Keep Pb)

pb is a lightweight pastebin and URL shortener built, written in Python using Flask. The official instance is https://ptpb.pw/.

Warning: A pastebin should not be used for sharing confidential or private information.
Note: Since 2019-03-08 the official instance is no longer available.



Install the nodejs-gruntAUR and pb-gitAUR packages, and enable pb.service.

To configure the server, edit the /etc/uwsgi/pb.ini file.


Any download manager supporting HTTP POST requests may be used, such as curl. Alternatively, a native client may be used:

A pb client written in C. || pbpst pbpst-gitAUR


Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Add information about server usage/configuration (Discuss in Talk:Pb#)

A paste may be created with a POST request as follows: [1] [2]

curl -F c=@- https://ptpb.pw < file

See https://ptpb.pw and API specification for more information.

Note: pb also provides an HTML form at the /f path, for example https://ptpb.pw/f.


See pbpst(1) and pbpst_db(5) for usage details.

  • When taking standard input from a terminal, press Ctrl+D twice to process the data. [3]
  • The provider may be configured with --provider. (defaults to https://ptpb.pw)
  • By default pbpst only prints the URL at which the paste is available. The full output may be retrieved with --verbose.


Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Not specific to pbpst, duplication with pbpst(1) (Discuss in Talk:Pb#)

By default pastes are created with no expiration time. They'll last as long as the service's operator let them. -x option may be used to set the number of seconds after which a paste should be removed:

$ thePaste="$(cat /dev/urandom | tr -cd [:print:] | head -c 32)"
$ echo "$thePaste"

$ echo "$thePaste" | pbpst -S -m 'A test message that expires after 60s' -x 60

$ date; curl 'https://ptpb.pw/scrubbed'
Tue Apr 12 19:11:41 CEST 2016

$ date; curl 'https://ptpb.pw/scrubbed'
Tue Apr 12 19:13:06 CEST 2016
status: not found

The expired pastes, while no longer available from the remote service, are still listed in the local database:

$ pbpst -Dq expires
deadbeef-dead-beef-dead-1111111111	https://ptpb.pw/scrubbed	A test message that expires after 60s	1460481140

To prune them -Dy should be used:

$ pbpst -Dy
$ pbpst -Dq expires