[GH-ISSUE #51] Document: How to paste from stdin #41

Closed
opened 2026-02-27 10:15:26 +03:00 by kerem · 2 comments
Owner

Originally created by @pinpox on GitHub (Apr 8, 2024).
Original GitHub issue: https://github.com/matze/wastebin/issues/51

Hey 👋

I mostly use pastebins when debugging sysemtems to quickly paste logs somewhere to share with coworkers. I used to have a different pastebin which allowed to do something like this:

cat error.log | pastebin-script

Which would paste that text from stdin and print a url with the created past. Is it possible to create such a command for wastebin with curl?

I saw the example for clipboards at https://github.com/matze/wastebin?tab=readme-ov-file#paste-from-clipboard but that is exactly what I need and I have not yet figured out how to make it work.

Maybe you already know how to create an alias or script for this and could document it.

Originally created by @pinpox on GitHub (Apr 8, 2024). Original GitHub issue: https://github.com/matze/wastebin/issues/51 Hey :wave: I mostly use pastebins when debugging sysemtems to quickly paste logs somewhere to share with coworkers. I used to have a different pastebin which allowed to do something like this: ``` cat error.log | pastebin-script ``` Which would paste that text from stdin and print a url with the created past. Is it possible to create such a command for wastebin with curl? I saw the example for clipboards at https://github.com/matze/wastebin?tab=readme-ov-file#paste-from-clipboard but that is exactly what I need and I have not yet figured out how to make it work. Maybe you already know how to create an alias or script for this and could document it.
kerem closed this issue 2026-02-27 10:15:26 +03:00
Author
Owner

@pinpox commented on GitHub (Apr 8, 2024):

Answering my own question:
This bash function allows pasting by doing cat file.txt | paste:

paste() {
	jq -Rns '{text: inputs}' | curl  -s -H 'Content-Type: application/json' \
		--data-binary @- https://wastebin.tld | jq -r '. | "wastebin.tld\(.path)"'
	}

<!-- gh-comment-id:2042797433 --> @pinpox commented on GitHub (Apr 8, 2024): Answering my own question: This bash function allows pasting by doing `cat file.txt | paste`: ```bash paste() { jq -Rns '{text: inputs}' | curl -s -H 'Content-Type: application/json' \ --data-binary @- https://wastebin.tld | jq -r '. | "wastebin.tld\(.path)"' } ```
Author
Owner

@mokurin000 commented on GitHub (Apr 5, 2025):

Answering my own question: This bash function allows pasting by doing cat file.txt | paste:

paste() {
jq -Rns '{text: inputs}' | curl -s -H 'Content-Type: application/json'
--data-binary @- https://wastebin.tld | jq -r '. | "wastebin.tld(.path)"'
}

This would result a strange HTML response contains wrong size on 3.0.0
my command was:

echo hello world  |  jq -Rns '{text: inputs}' | curl -s -H 'Content-Type: application/json' --data-binary @- http://127.0.0.1:8088/api
<!-- gh-comment-id:2780639769 --> @mokurin000 commented on GitHub (Apr 5, 2025): > Answering my own question: This bash function allows pasting by doing `cat file.txt | paste`: > > paste() { > jq -Rns '{text: inputs}' | curl -s -H 'Content-Type: application/json' \ > --data-binary @- https://wastebin.tld | jq -r '. | "wastebin.tld\(.path)"' > } This would result a strange HTML response contains `wrong size` on 3.0.0 my command was: ```bash echo hello world | jq -Rns '{text: inputs}' | curl -s -H 'Content-Type: application/json' --data-binary @- http://127.0.0.1:8088/api ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wastebin-matze#41
No description provided.