logo

sshpaste

Simple paste script to a server having SSH+HTTP daemons git clone https://hacktivis.me/git/sshpaste.git

README.md (1927B)


  1. # sshpaste
  2. A POSIX shell script (with some non-POSIX dependencies) inspired by wgetpaste but for pushing to your own server.
  3. ## Usage
  4. Please modify ``target_ssh`` and ``target_www`` into ``sshpaste`` to the appropriate servers and paths for your usage.
  5. ```
  6. Usage: sshpaste [options] [file(s)]
  7. Options:
  8. -c COMMAND paste COMMAND and the output of COMMAND
  9. Can be used only once, not compatible with -x
  10. -h show this help
  11. -x read input from clipboard (requires xclip)
  12. Can be used only once, not compatible with -c
  13. When no options or files are given, sshpaste reads from stdin, it assumes plain text is given and so puts a .txt extension
  14. ```
  15. ## Intended differences with wgetpaste
  16. * The URL in standard output shows only the URL without any message, allowing more easy piping
  17. * ``emerge --info`` options will not be added (gentoo-specific, can easily be done via ``-c``)
  18. * URL will not go to tinyurl or X Clipboard, can easily be done by piping the output
  19. * I use the PS4 environment variable with ``sh -x``/``set -x`` instead of a custom PS1, it allows the separation of the commands as they are executed at the expense of broken oneliner display
  20. ## Dependencies
  21. * POSIX system: required
  22. * scp(1): required; tested with OpenSSH
  23. * mktemp(1): needed for -x and -c; tested with coreutils and OpenBSD
  24. * xclip(1): optionnal; needed for -x option
  25. Note: Your server needs a ssh daemon for the uploads and a web server for hosting the files. You can also replace the web server with one for Gopher, FTP (but let it die) or maybe even something else.
  26. ## Packages
  27. * Source tarballs are available at https://hacktivis.me/git/sshpaste/archives/ and https://github.com/lanodan/sshpaste/releases
  28. * It is in my gentoo overlay, here is theorically how to install sshpaste from a clean gentoo:
  29. ```
  30. emerge layman
  31. layman -a lanodanOverlay
  32. emerge sshpaste
  33. ```