Add p service for pastes

Reviewed-by: Aleix Boné <abonerib@bsc.es>
Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
This commit is contained in:
Rodrigo Arias 2025-06-13 12:53:58 +02:00
parent e374bed96b
commit 2a66d7dc99

View File

@ -5,13 +5,13 @@ author: "Rodrigo Arias Mallo"
date: 2024-09-20 date: 2024-09-20
--- ---
The hut machine provides a paste service using the program `p` (as in paste). The tent 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 You can use it directly from the tent machine or remotely if you have [SSH
access](/access) to hut using the following alias: access](/access) to tent using the following alias:
``` ```
alias p="ssh hut p" alias p="ssh tent p"
``` ```
You can add it to bashrc or zshrc for persistent installation. You can add it to bashrc or zshrc for persistent installation.
@ -19,7 +19,7 @@ You can add it to bashrc or zshrc for persistent installation.
## Usage ## Usage
The `p` command reads from the standard input, uploads the content to a file 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 in the local 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 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 disk (without the dot). By default it uses the `txt` extension, so plain text
can be read in the browser directly. can be read in the browser directly.
@ -28,21 +28,21 @@ can be read in the browser directly.
p [extension] p [extension]
``` ```
To remove files, go to `/ceph/p/$USER` and remove them manually. To remove files, go to `/var/lib/p/$USER` and remove them manually.
## Examples ## Examples
Share a text file, in this case the source of p itself: Share a text file, in this case the source of p itself:
``` ```
hut% p < m/hut/p.nix tent% p < m/tent/p.nix
https://jungle.bsc.es/p/rarias/okbtG130.txt https://jungle.bsc.es/p/rarias/okbtG130.txt
``` ```
Paste the last dmesg lines directly from a pipe: Paste the last dmesg lines directly from a pipe:
``` ```
hut% dmesg | tail -5 | p tent% dmesg | tail -5 | p
https://jungle.bsc.es/p/rarias/luX4STm9.txt https://jungle.bsc.es/p/rarias/luX4STm9.txt
``` ```