In de.comp.os.unix.linux.misc fragte jemand nach einem Host-uebergreifenden
Clipboard mit Shell-Integration.
Ich fand die Idee interessant und hab das implementiert, zumal ich dafuer
auf vorhandene Software zurueckgreifen konnte und nur noch wenig neu
programmieren musste.
Internet clipboards gibts zwar diverse, aber keines davon ist in der Shell
brauchbar. Mein LAN Clipboard kann Dateien+Verzeichnisse (tar) und
STDIN/STDOUT (pipe) verarbeiten und erkennt automatisch den Inhalt
(text/binary/files). Die Ablage ist organisiert ueber versionierte
Clipboards, von denen es beliebig viele in beliebiger Groesse geben kann.
Damit ist zB ein Austausch von pipe-data oder directory-trees mit Kollegen
moeglich, ohne aufwaendige Authorisierung, login, etcpipapo.
Der Zugriff erfolgt entweder ueber freigegebene IPs bzw Netze oder
alternativ ueber Authorisierungs-Token. Dazu gibt es ein Client-Programm
(yy, siehe "examples" unten.) und curl/bash-Funktionen.
Sobald sich ein paar Tester finden, veroeffentliche ich den LCB Servercode
(50 kB). Die Clients stehen jetzt schon zum Testen zur Verfuegung, ebenso
ein Testserver mit Dokumentation:
https://fextest.rus.uni-stuttgart.de/lcb
Ich muss dazu nur die IP-Adressen wissen, von wo aus zugegriffen werden
soll. Notfalls kann ich auch Authorisierungs-Token vergeben.
Wens interessiert, soll sich bitte bei mir melden.
Feature requests werden auch noch angenommen :-)
Zusaetzlich gibts auch noch Webbrowser-Zugriff fuer
upload/download/listing.
https://fextest.rus.uni-stuttgart.de/lcb/yy
usage:
yy [CLIPBOARD:] FILE [...] # copy file(s) as tar archive
yy [CLIPBOARD:] DIRECTORY # copy directory recursivly
yy [CLIPBOARD:] - # copy STDIN
yy [CLIPBOARD:] - FILE # copy file
... | yy [CLIPBOARD:] # copy STDOUT from pipe
yy :: # list known clipboards
yy [CLIPBOARD]:[ITEM] # paste file(s) or STDOUT
yy [CLIPBOARD]:[ITEM:]q # query for meta data
yy [CLIPBOARD]:[ITEM:]f # fex clipboard item
yy [CLIPBOARD]:[ITEM:]d # delete clipboard item
yy CLIPBOARD:D # delete clipboard
yy CLIPBOARD:p # toggle public mode (rename clipboard)
yy -t [-p] ANYTHING... # copy ANYTHING... as tar archive (-p = public)
yy -q # query configuration
CLIPBOARD may consist of characters a-z A-Z 0-9 . _ + - (default is "_")
ITEM may consist of number 1-9 (default is 1) and is rotated by copy
examples:
uname -a | yy # copy pipe data into clipboard
yy *jpg # copy all JPGs into clipboard
yy - # copy text from keyboard into clipboard
yy ABC: project/ # copy directory project into clipboard "ABC"
yy -tp project/ # copy directory project into clipboard "public_project"
yy # paste data from default clipboard
yy :3 # paste data version 3 from default clipboard
yy ABC: # paste data from clipboard "ABC"
yy ABC:d # delete last item from clipboard "ABC"
yy ABC:0:d # delete dangling upload from clipboard "ABC"
To update yy execute:
curl -sS
https://fex.rus.uni-stuttgart.de/lcb/yy.pl > $(which yy)
environment variables (optional, with examples):
export LCB_USER=framstag@fex:MYTOKEN # for non-ip authorization
export LCB_SERVER=
fex.rus.uni-stuttgart.de:443 # use https port
export LCB_CLIPBOARD=framstag # replace default clipboard "_"
export LCB_EXCLUDE=".*" # exclude files matching shell pattern .*
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart E-Mail:
horl...@tik.uni-stuttgart.de
Allmandring 30a Tel:
++49-711-68565868
70569 Stuttgart (Germany) WWW:
https://www.tik.uni-stuttgart.de/