| 1 | # send the output of any command as a paste and print its URL |
| 2 | paste() { |
| 3 | curl -s --data-urlencode "content@-" -d "title=$1" https://pasteguru.com/api/create | sed -n 's/.*"url":"\([^"]*\)".*/\1/p' |
| 4 | } |
| 5 | |
| 6 | df -h | paste "disk usage" |
| 7 | journalctl -u myservice --since '1 hour ago' | paste "myservice log" |
| 8 | |
| 9 | # expire after a day instead of keeping it forever |
| 10 | curl -s -d 'content=temporary note' -d 'expiry=1D' https://pasteguru.com/api/create |
| 11 |