1
0
Fork 0
mirror of https://github.com/sbrl/bin.git synced 2018-01-10 21:33:46 +00:00

Add hastebin

This commit is contained in:
Starbeamrainbowlabs 2016-07-05 18:49:21 +01:00
parent bf06e88d83
commit 96bc93b9b8
2 changed files with 23 additions and 0 deletions

View file

@ -30,6 +30,7 @@ Here's a list of the most interesting ones, along with what they do and where th
- [dtach](http://dtach.sourceforge.net/) - A minimal alternative to `screen` and `tmux`. - [dtach](http://dtach.sourceforge.net/) - A minimal alternative to `screen` and `tmux`.
- [commacd](https://github.com/shyiko/commacd) - A faster way to move around. - [commacd](https://github.com/shyiko/commacd) - A faster way to move around.
- drop_pagecache - A quick script I wrote to drop the linux page cache. - drop_pagecache - A quick script I wrote to drop the linux page cache.
- [hastebin](https://gist.github.com/flores/3670953) - A [hastebin](http://hastebin.com/) CLI.
## Disclaimer ## Disclaimer
I don't own many of the tools in this repository. If you are an owner of one of these tools and I haven't linked to you, please let me know as I probably forgot. I don't own many of the tools in this repository. If you are an owner of one of these tools and I haven't linked to you, please let me know as I probably forgot.

22
hastebin Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
server='hastebin.com';
usage="$0 pastes into $server
usage: $0 something
example: '$0 pie' or 'ps aufx |$0'"
if [ -z $1 ]; then
str=`cat /dev/stdin`;
else
str=$1;
fi
if [ -z "$str" ]; then
echo $usage;
exit 1;
fi
output=`curl -s -X POST -d "$str" $server/documents |perl -pi -e 's|.+:\"(.+)\"}|$1|'`
echo $server/$output