Command line pastebin for sharing terminal output.
Command line pastebin for sharing terminal output.
Self-explanatory live examples (using public server):
echo just testing! | nc termbin.com 9999cat file.txt | nc termbin.com 9999In case you installed and started fiche on localhost:
ls -la | nc localhost 9999You will get an url to your paste as a response, e.g.:
http://termbin.com/ydxhYou can use our beautification service to get any paste colored and numbered. Just ask for it using l.termbin.com subdomain, e.g.:
http://l.termbin.com/ydxhYou can make your life easier by adding a termbin alias to your rc file. We list some of them here:
Linux/macOS:
alias tb="(exec 3<>/dev/tcp/termbin.com/9999; cat >&3; cat <&3; exec 3<&-)"echo less typing now! | tbtb aliasLinux (Bash):
echo 'alias tb="nc termbin.com 9999"' >> .bashrcecho less typing now! | tbmacOS:
echo 'alias tb="nc termbin.com 9999"' >> .bash_profileecho less typing now! | tbLinux (Bash):
echo 'alias tbc="netcat termbin.com 9999 | xclip -selection c"' >> .bashrcecho less typing now! | tbcmacOS:
echo 'alias tbc="nc termbin.com 9999 | pbcopy"' >> .bash_profileecho less typing now! | tbcRemember to reload the shell with source ~/.bashrc or source ~/.bash_profile after adding any of provided above!
To use fiche you have to have netcat installed. You probably already have it - try typing nc or netcat into your terminal!
Clone:
git clone https://github.com/solusipse/fiche.gitBuild:
makeInstall:
sudo make installTo install the port: cd /usr/ports/net/fiche/ && make install clean. To add the package: pkg install fiche.
See #86 for more info.
usage: fiche [-D6epbsdSolBuw].
[-d domain] [-L listen_addr ] [-p port] [-s slug size]
[-o output directory] [-B buffer size] [-u user name]
[-l log file] [-b banlist] [-w whitelist] [-S]These are command line arguments. You don't have to provide any of them to run the application. Default settings will be used in such case. See section below for more info.
-oRelative or absolute path to the directory where you want to store user-posted pastes.
fiche -o ./codefiche -o /home/www/code/Default value: ./code
-dThis will be used as a prefix for an output received by the client.
Value will be prepended with http.
fiche -d domain.comfiche -d subdomain.domain.comfiche -d subdomain.domain.com/some_directoryDefault value: localhost
-sThis will force slugs to be of required length:
fiche -s 6Output url with default value: http://localhost/xxxx,
where x is a randomized character
Output url with example value 6: http://localhost/xxxxxx,
where x is a randomized character
Default value: 4
-SIf set, fiche returns url with https prefix instead of http
fiche -SOutput url with this parameter: https://localhost/xxxx,
where x is a randomized character
-uFiche will try to switch to the requested user on startup if any is provided.
fiche -u _ficheDefault value: not set
WARNING: This requires that fiche is started as a root.
-BThis parameter defines size of the buffer used for getting data from the user. Maximum size (in bytes) of all input files is defined by this value.
fiche -B 2048Default value: 32768
-lfiche -l /home/www/fiche-log.txtDefault value: not set
WARNING: this file has to be user-writable
-bRelative or absolute path to a file containing IP addresses of banned users.
fiche -b fiche-bans.txtFormat of the file: this file should contain only addresses, one per line.
Default value: not set
WARNING: not implemented yet
-wIf whitelist mode is enabled, only addresses from the list will be able to upload files.
fiche -w fiche-whitelist.txtFormat of the file: this file should contain only addresses, one per line.
Default value: not set
WARNING: not implemented yet
There's a simple systemd example:
[Unit]
Description=FICHE-SERVER
[Service]
ExecStart=/usr/local/bin/fiche -d yourdomain.com -o /path/to/output -l /path/to/log -u youruser
[Install]
WantedBy=multi-user.targetWARNING: In service mode you have to set output directory with -o parameter.
Fiche has no http server built-in, thus you need to setup one if you want to make files available through http.
There's a sample configuration for nginx:
server {
listen 80;
server_name mysite.com www.mysite.com;
charset utf-8;
location / {
root /home/www/code/;
index index.txt index.html;
}
}Fiche is MIT licensed.
No open issues yet, or sync has not completed.