drevil c51e53bd89 | ||
---|---|---|
.gitignore | ||
Makefile | ||
README.md | ||
tb.sh | ||
tildebin.c | ||
utilities.h |
README.md
tildebin
tildebin
creates customizable pastebin pages from plain text commands received via a unix sockets. It sets up a socket within your filesystem to which users can connect to with tools like nc
and send their requests. Requests are then applied to a template and saved to disk.
Usage
Usage: tildebin [OPTIONS]
Takes user's copy/paste requests from a socket and
saves them onto disk based on a user defined template
None of the options below are mandatory
-s socket path sets socket path
-t template path sets template path
-o output dir sets output directory
-n output filename sets user's output filename
-c enables html curation (set to true if no template is provided)
-h prints this message
Default socket path is set to /tmp/tildebin.socket and default output
file name is set to index.html. The user requests will be saved under /tmp/tildebin/.
In order to start the server, just run tildebin
. While no arguments are strictly needed, it's recommended that you at least set the output directory and socket path. Using a template file and enabling html curation is also encouraged.
./tildebin -o [output dir] -s [socket path] -tc [template file]
All of the processed user requests will be stored under [output dir]/[username]
. tildebin
is also signal-aware, so you can safely terminate it using Ctrl-C or kill
.
In order to manually send a request to the server, you can use nc
.
# Assuming tildebin.sock is in /tmp...
echo "my tildebin!" | nc -U /tmp/tildebin.sock
# You can also set a title for your tildebin. This will save your tildebin under [your username]/my first title
echo ".name.my first title.ename..EOH.my tildebin with a title!" | nc -U /tmp/tildebin.sock
If you'd like to use the integrated script, tb.sh, just set the environment variable TILDEBIN_SOCK
in your shell
# Assuming tildebin.sock is in ~/...
echo "my tildebin" | TILDEBIN_SOCK="~/tildebin.sock" tb.sh
# You can also set a title for your tildebin. This will save your tildebin under [your username]/my first title
echo "my tildebin" | TILDEBIN_SOCK="~/tildebin.sock" tb.sh "my first title"