Skip to content

gizmo15/paste-py

 
 

Repository files navigation

paste-py

paste-py is a dead simple paste service written in Python. An instance is running at http://paste.awesom.eu.

Using it

Script

The most useful utility is the paste.sh script: save it somewhere in your path and use it as follows:

  • paste.sh foo will paste the content of the file foo and return the URL of the paste
  • paste.sh - will paste what it reads from stdin and the URL of the paste

You can also put the language to highlight with and the user as second and third argument (though the language will be detected from the extension).

You can look at the parameters at the beginning of the script to set a default user or automatically copy the paste URL.

Arguments

With paste-py, everything happens in the arguments you give in the URL. Every argument is prepended by a &. The following arguments can be used:

  • ln: add line numbers to the paste
  • hl=foo: syntax highlight the paste as language foo
  • raw: raw paste, to download it; you can also use the prefix /raw/ to have a shell-friendly URL (eg. http://paste.awesom.eu/raw/HiT)
  • script: used to paste from a script (will only return the URL, no html)

Users

Users are also supported: enter a username (eg. foobar) when pasting something, and you can access all your pastes by browsing http://paste.awesom.eu/user/foobar. Note that you cannot delete your pastes, so think twice before pasting something sensitive. In case you really need to delete a paste, contact me.

Installing

The only dependencies are Tornado and Pygments. If you want to use the script to launch paste-py as a daemon, grizzled is also needed.

$ pip install tornado pygments grizzled

Launching

You can either launch it as a daemon or not: launch daemonize.py or paste.py. Look at the help (--help) if you want to change the listening address. For example:

$ LANG=en_US.UTF-8 python paste.py --addr=0.0.0.0 --port=8080

Design

The design is pretty basic, but some people made improvements to it. If you want a better design, look at http://paste.isomorphis.me/.

License

WTFPL, ie. do what the fuck you want with it.

About

Paste service that uses Pygments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 57.6%
  • Python 39.1%
  • Shell 3.3%