ezpaste
-------
A public pastebin service by Dash Eclipse
A fiche instance with source code highlighting and social preview
netcat-based command line pastebin
Telegram Bot: https://t.me/ezpastebot
Try out
-------
$ echo foo | ncat ezup.dev 9999
$ cat file.txt | ncat ezup.dev 9999
Note: use -N option with BSD netcat, or just use ncat (nmap).
https://github.com/solusipse/fiche/issues/66#issuecomment-730558672
Pure bash/zsh
-------------
The pure bash/zsh approach is slow than {openbsd,libressl}-bsd with -N or ncat (nmap),
because it waits for timeout (5s) to close connection.
bash
alias tb="(exec 3<>/dev/tcp/ezup.dev/9999; cat >&3; cat <&3; exec 3<&-)"
zsh
tb() { zmodload zsh/net/tcp; ztcp ezup.dev 9999; cat >&$REPLY; cat <&$REPLY; ztcp -c $REPLY }
zsh, copy link to clipboard
tb() { zmodload zsh/net/tcp; ztcp ezup.dev 9999; cat >&$REPLY; cat <&$REPLY | tee >(xclip -selection clipboard); ztcp -c $REPLY }
/etc/cron.daily/fiche
---------------------
Life span of single paste is one month, older pastes are deleted. IP Addresses are logged and logs are deleted daily.
#!/bin/sh
: >/var/log/fiche/log
OLD_PASTES=$(find /var/data/fiche/ -mindepth 1 -maxdepth 1 -type d -ctime +30)
if [ ! -z "${OLD_PASTES}" ]; then
stat -c "%y" $OLD_PASTES | cut -d' ' -f1 | sort -h >>/var/data/fiche-dates.txt
rm -rf $OLD_PASTES
NUM=$(echo "$OLD_PASTES" | wc -l)
echo "Removed $NUM pastes"
else
echo "Nothing to remove"
fi