Hax by Jaku

Tag: curl

Posting data to Pastebin with cURL

by Jaku on Sep.20, 2009, under Code, Haxs

I needed to get a bunch of text up on pastebin and I’ve used my own cURL script to get it up there before. But then I started to think that others might want to be able to just post to pastebin directly from their bash shell. What started off as a simple one-liner then started to grow into a bit more.

With pastebin you are able to post to a sub-domain, as well as put a name along with the post and even set how long the data should stay up. So I’ve made it possible for you to edit those settings in the script so that if you want to post as “bob” and keep the data up there for a day you can do all of that.

The easiest way to install this would be the following 2 commands

sudo curl haxbyjaku.com/pastebin -o /usr/bin/pastebin
sudo chmod +x /usr/bin/pastebin

I know that you won’t run sudo on commands that download code from my server, but you can trust it since you get to see everything. :P

After it is installed I suggest editing the file as well so that you can set your own settings such as username or pastebin URL. Once that is all set simple run a command like "echo test | pastebin" in your terminal and you’ll get the URL that pastebin posted it to. You can even do something like "echo /etc/passwd | pastebin" and it will work exactly as you expect it to.

I’ve pasted the code after the break as well.

(continue reading…)

Leave a Comment :, , , , , , more...


Picture Hax

    Bowmanville, Feb 10, 2009

Don't search for anything!

Don't tell them what not to do!:

Other Haxs!

Archives

All entries, chronologically...