How-to: pipe console output to Paste-Post
some-command | pp uploads console output and prints the paste URL on a single
line. Five steps to install the pp function - or skip straight to the manual
one-liners in step 5 if you do not want to install anything.
-
1. Bootstrap (one line)
Run this once. The URL in the command is the instance
ppwill later upload to - it is baked into the installer response.curl -fsSL https://222-167-216-60.nip.io/install.sh | bash
-
2. What the installer checks
curl(pp pipes through it; if missing you get the apt/dnf/pacman install hint),bashorzsh, a writable$HOME, and your rc file (~/.bashrc/~/.zshrc, following$SHELL; with both shells installed you are asked which ones). The installer never reads its stdin - that is the curl pipe - so it is safe undercurl | bash; prompts use/dev/tty. Without a terminal (CI, scripts) it proceeds non-interactively with the$SHELLdefault. -
3. What it writes to your rc file
A managed marker block (
# >>> paste-post pp (do not edit) >>>...# <<< paste-post pp <<<) holding onePP_URL="..."line plus theppfunction. Your rc is backed up once to<rc>.pp-bak-<epoch>before the first modification. Re-running the installer replaces the block in place - never duplicated - so the last install wins, including a newPP_URLwhen you re-run from another host. -
4. Activate it
The installer prints these for your shell; pick one:
source ~/.bashrc # bash exec zsh -l # zsh # or simply open a new terminal / re-login
-
5. Use it
dmesg | pp # pipe output -> prints the paste URL (one line) dmesg | pp "expiry=1h&burn=1" # flags as a URL-encoded query-string argument cat err.log | pp "lang=python" # language flag; visibility defaults to unlisted # JSON mode (returns slug + title + the one-time delete token): echo hi | curl -sS --data-binary @- -H 'Accept: application/json' \ "https://222-167-216-60.nip.io/api/v1/pastes/raw" # No install? Manual alternatives: echo hi | bash /path/to/pp.sh # execute pp.sh as a pipe filter echo hi | curl -sS --data-binary @- "https://222-167-216-60.nip.io/api/v1/pastes/raw" # raw curl # Point pp at another instance for one call: PP_URL=https://pp.example.org sh -c 'dmesg | pp'The raw endpoint is
POST /api/v1/pastes/rawwith the body as raw bytes; optional query flags:lang=,expiry=(10min/1h/1day/1week/1month/6months/1year/never),visibility=(default unlisted),burn=1,title=. To pointppat another instance permanently, re-run the installer from that host's/install.shor edit thePP_URLline inside the marked block in your rc file.
Uninstall: delete the marked paste-post pp block from your rc file(s)
(and open a new shell). The function file itself is served raw at
/pp.sh; the installer at /install.sh.