From a34e3752a26257c8e8660af1c7d5571da6f1c957 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 20 Sep 2024 10:38:26 +0200 Subject: [PATCH] Add paste documentation in jungle website MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Aleix Boné --- web/content/paste/_index.md | 68 +++++++++++++++++++++++++++++++++++++ web/hugo.toml | 8 ++++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 web/content/paste/_index.md diff --git a/web/content/paste/_index.md b/web/content/paste/_index.md new file mode 100644 index 0000000..e4ebd61 --- /dev/null +++ b/web/content/paste/_index.md @@ -0,0 +1,68 @@ +--- +title: "Paste" +description: "Paste service" +author: "Rodrigo Arias Mallo" +date: 2024-09-20 +--- + +The hut machine provides a paste service using the program `p` (as in paste). + +You can use it directly from the hut machine or remotely if you have [SSH +access](/access) to hut using the following alias: + +``` +alias p="ssh hut p" +``` + +You can add it to bashrc or zshrc for persistent installation. + +## Usage + +The `p` command reads from the standard input, uploads the content to a file +in the ceph filesystem and prints the URL to access it. It only accepts an +optional argument, which is the extension of the file that will be stored on +disk (without the dot). By default it uses the `txt` extension, so plain text +can be read in the browser directly. + +``` +p [extension] +``` + +To remove files, go to `/ceph/p/$USER` and remove them manually. + +## Examples + +Share a text file, in this case the source of p itself: + +``` +hut% p < m/hut/p.nix +https://jungle.bsc.es/p/rarias/okbtG130.txt +``` + +Paste the last dmesg lines directly from a pipe: + +``` +hut% dmesg | tail -5 | p +https://jungle.bsc.es/p/rarias/luX4STm9.txt +``` + +Upload a PNG picture from a file: + +``` +hop% p png < mark-api-cpu.png +https://jungle.bsc.es/p/rarias/oSRAMVsE.png +``` + +Take an screenshot and upload it as a PNG file: + +``` +hop% scrot -s - | p png +https://jungle.bsc.es/p/rarias/SOgK5EV0.png +``` + +Upload a directory by creating a tar.gz file on the fly: + +``` +hop% tar c ovni | gzip | p tar.gz +https://jungle.bsc.es/p/rarias/tkwROcTR.tar.gz +``` diff --git a/web/hugo.toml b/web/hugo.toml index 7458aeb..91e6ba5 100644 --- a/web/hugo.toml +++ b/web/hugo.toml @@ -21,8 +21,14 @@ name = "Lists" url = "/lists/" weight = 30 +[[menu.main]] +identifier = "Paste" +name = "Paste" +url = "/paste/" +weight = 40 + [[menu.main]] identifier = "Posts" name = "Posts" url = "/posts/" -weight = 40 +weight = 50