A dev oriented pastebin like container for sharing code and text. A lot more usefull though, thanking John Crepezzi Paste your stuff however :)
docker run --name pastebin -p 80:80 mkodockx/docker-pastebin
pastebin:
image: mkodockx/docker-pastebin
host
- the host the server runs on (default localhost)port
- the port the server runs on (default 7777)keyLength
- the length of the keys to user (default 10)maxLength
- maximum length of a paste (default none)staticMaxAge
- max age for static assets (86400)recompressStatisAssets
- whether or not to compile static js assets (true)documents
- static documents to serve (ex: http://hastebin.com/about.com) in addition to static assets. These will never expire.storage
- storage options (see below)logging
- logging preferenceskeyGenerator
- key generator options (see below)
For easy use the details are almost equal to the originals. You can find original configuration documentation at John's github page
Attempts to generate phonetic keys, similar to pwgen
{
"type": "phonetic"
}
Generates a random key
{
"type": "random",
"keyspace": "abcdef"
}
The optional keySpace argument is a string of acceptable characters for the key.
To use file storage (the default) change the storage section in config.js
to
something like:
{
"path": "./data",
"type": "file"
}
Where path
represents where you want the files stored
To use redis storage you must install the redis package in npm
npm install redis
Once you've done that, your config section should look like:
{
"type": "redis",
"host": "localhost",
"port": 6379,
"db": 2
}
You can also set an expire
option to the number of seconds to expire keys in.
This is off by default, but will constantly kick back expirations on each view
or post.
All of which are optional except type
with very logical default values.
To use memcached storage you must install the memcache
package via npm
npm install memcache
Once you've done that, your config section should look like:
{
"type": "memcached",
"host": "127.0.0.1",
"port": 11211
}
You can also set an expire
option to the number of seconds to expire keys in.
This behaves just like the redis expirations, but does not push expirations
forward on GETs.
All of which are optional except type
with very logical default values.
After starting the container you can navigate to 'targethost:targetport' and start using the bin via your browser.
Usually ruby is provided by OSX basic installation.
If your Linux Distro doesn't have ruby, you may want to install it. You should include the dev variant, as several games depend on them e.g.
apt-get install ruby-dev
yum install ruby-dev
After you ensure to have ruby installed use the following instruction.
gem install haste
cat file | haste
haste file
For those who don't like great ruby stuff - you may use following script as an alternative.
haste() { a=$(cat); curl -X POST -s -d "$a" http://hastebin.com/documents | awk -F '"' '{print "http://hastebin.com/"$4}'; }
If you want to acces via Windows have a look at Aidan Ryan's WinHaste
For issues please stick to github's issue tracker.