██╗ ██╗ ██╔╝ ██║ ██╔╝ ██║ █████╗ █████╗ ╚██╗ ╚═╝ ╚════╝ ╚════╝ ╚██╗ ██╗ ╚═╝ ╚═╝ This application is a PasteBin clone written in Rust, powered by Actix-web. It is designed primarily to be used via the `curl` command, although it works from a browser too. Pastes are deleted when they are 30 days old (since last modification). Accepted requests are: POST / Accepts raw data in the body of the request and responds with the View and Edit URLs of the resulting paste. The Edit URL simply includes the edit key as part of the URL (see DELETE and PUT below). - Yields a 403 Bad Request if the paste is not valid UTF-8, or if it is larger than 2 MB. $ echo "hello world" | curl --data-binary @- http://0x3c.net View URL: http://0x3c.net/vxcRz Edit URL: http://0x3c.net/vxcRz/a7772362cf6e2c36 GET // Retrieves the content for the paste associated with . If the optional parameter is supplied, syntax highlighting associated with the file extension is applied to the result (either via HTML or terminal escape codes, depending on whether you accept text/html). - Yields a 404 Not Found if does not exist - Yields a 403 Bad Request if is an unknown file extension. $ curl http://0x3c.net/vxcRz hello world $ curl http://0x3c.net/vxcRz/rs hello world [with Rust syntax highlighting] DELETE // Deletes the paste associated with , provided that is valid. - Yields a 403 Bad Request if the paste does not exist, or if the key is invalid. $ curl -X DELETE http://0x3c.net/vxcRz/a7772362cf6e2c36 Paste Deleted. PUT // Replaces the contents of the paste associated with , provided that is valid. - Yields a 403 Bad Request if the paste does not exist, or if the key is invalid, or is larger than 2 MB. $ echo "other world" | curl -X PUT --data-binary @- \ > http://0x3c.net/vxcRz/a7772362cf6e2c36 http://0x3c.net/vxcRz overwritten. ________________________________________________________________________________ You may find this bash function useful. Put it in your .bashrc and then run it via `pb file.txt` or `cat file.txt | pb` function pb() { local file=${1:-/dev/stdin} curl --data-binary @${file} http://0x3c.net }