From 509836d26fdb3abdeba85fd6f120b8d0010a07ab Mon Sep 17 00:00:00 2001 From: alf Date: Thu, 23 Apr 2026 20:33:25 +0000 Subject: [PATCH] =?UTF-8?q?README.md=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7236c8 --- /dev/null +++ b/README.md @@ -0,0 +1,97 @@ +# Paste Scripts + +Zwei Bash-Scripts zum Hoch- und Runterladen von Dateien über eine selbst gehostete [Pinnwand](https://github.com/supakeen/pinnwand)-Instanz. + +## Voraussetzungen + +- `curl` +- `python3` +- Laufende Pinnwand-Instanz (siehe [docker-compose.yaml](docker-compose.yaml)) + +## Installation + +```bash +chmod +x paste_senden.sh paste_holen.sh +``` + +--- + +## paste_senden.sh + +Lädt eine Datei zu Pinnwand hoch und gibt die URL sowie die Paste-ID aus. + +### Verwendung + +```bash +./paste_senden.sh [host] +``` + +| Argument | Beschreibung | Standard | +|---|---|---| +| `datei` | Pfad zur hochzuladenden Datei | – (Pflichtfeld) | +| `host` | URL der Pinnwand-Instanz | `http://localhost:8000` | + +### Beispiele + +```bash +# Mit Standard-Host +./paste_senden.sh meincode.py + +# Mit eigenem Host +./paste_senden.sh meincode.py http://meinserver:8000 +``` + +### Ausgabe + +``` +Paste URL: http://meinserver:8000/MM +Paste-ID: MM +``` + +--- + +## paste_holen.sh + +Ruft den Inhalt eines Pastes anhand seiner ID ab und gibt ihn auf der Standardausgabe aus. + +### Verwendung + +```bash +./paste_holen.sh [host] +``` + +| Argument | Beschreibung | Standard | +|---|---|---| +| `paste-id` | ID des Pastes (letzter Teil der URL) | – (Pflichtfeld) | +| `host` | URL der Pinnwand-Instanz | `http://localhost:8000` | + +### Beispiele + +```bash +# Inhalt anzeigen +./paste_holen.sh MM + +# Inhalt in Datei speichern +./paste_holen.sh MM > ausgabe.py + +# Mit eigenem Host +./paste_holen.sh MM http://meinserver:8000 +``` + +--- + +## Tipps + +Paste direkt aus einem Script heraus erstellen: + +```bash +./mein_script.sh | tee /tmp/out.txt && ./paste_senden.sh /tmp/out.txt +``` + +Logdatei schnell teilen: + +```bash +./paste_senden.sh /var/log/syslog +``` + +Paste-Ablaufzeit ist standardmäßig auf **1 Tag** gesetzt. Dies lässt sich in `paste_senden.sh` über den Wert `"expiry"` anpassen (`1day`, `1week`, `1month`). \ No newline at end of file