cat /dev/brain

The Context

I use on the rare occasion that I need to paste something for someone else to see. It's simple to use, written in python and open source. The chief example when you visit the website uses curl (and I love using the command line for as much as possible).

What annoyed me was that I often messed up the syntax because of how infrequently I used the site. So I would often run:

$ curl

<style> a { text-decoration: none } </style>
sprunge(1)                          SPRUNGE

    sprunge: command line pastebin:

    &lt;command&gt; | curl -F 'sprunge=&lt;-'

    add <a href=''>?&lt;lang&gt;</a> to
    resulting url for line numbers and syntax highlighting

    ~$ cat bin/ching | curl -F 'sprunge=&lt;-'
    ~$ firefox



My problem was remembering the form syntax for curl, specifically, form-identifier<- where the <- was the crucial part. This allows you to do:

$ cat file.txt | curl -F 'sprunge<-'
$ curl -F 'sprunge<-' < file.txt
$ curl -F 'sprunge@file.txt'
$ echo 'file.txt' | curl -F 'sprunge@-'

all of which are equivalent. But frankly, I'm a bit too lazy to do all that typing, so I wrote myself a nice little python script to do the work for me. To make it easy to remember, I named it

All this requires is requests which is released by Kenneth Reitz and contributed to by plenty. You can download it here or from PyPi using pip install