bigbrovar

March 18, 2009

Looking for an easy way to pastebin? Just pastbinit !

Filed under: Linux Admin — Bigbrovar @ 8:00 pm
Tags:

In case you dont know what a pastebin is, here is a brief description.

Pastebin is a web application which allows its users to upload snippets of text, usually samples of source code, for public viewing. It is very popular in IRC channels where pasting large amounts of text is considered bad etiquette. A vast number of pastebins exist on the Internet, suiting a number of different needs and provided features tailored towards the crowd they focus on most.

source http://en.wikipedia.org/wiki/Pastebin

I use Pastebin a lot especially when am in a support irc or IM Chat and i need to paste the debug output / log file of an application that crashed on me or when i need to share a config file.

Recently i found  an easy way to pastebin my text files by using pastebinit a small python script that reads text and sends it to a “pastebin” on the internet, returning the URL to the user. Pastebinit can be installed from the ubuntu repository

sudo apt-get install pastebinit

for those using the Nokia Internet Tablet you can install Pastebinit from here

maemo

Usage

Its a terminal based utility but is very easy to use.   cd to the directory of the text file you want to upload, and

pastebinit name-of-file

pastebin

the man page for pastebinit is quite self explanatory and easy to follow.
Here are some extract from its man page on optional arguments that can be used with pastebinit

Optional arguments
-b [pastebin url] (default: http://pastebin.com)

-a [author] (default: $USER)

-f [format of paste] (used for syntax-highlighting, default: text)

-t [title of paste] (ONLY FOR 1t2.us)

-m [permatag] (ONLY FOR 1t2.us, default: blank)

-u [username] (ONLY FOR 1t2.us)

-p [password] (ONLY FOR 1t2.us)

Pastinit also support the following pastebins

. http://pastebin.com

· http://pastebin.mozilla.org

· http://rafb.net

· http://yourpaste.net

· http://paste.ubuntu.com

· http://paste.stgraber.org

. http://paste.debian.net

The cool thing about pastebinit is that it is very flexible and it can allow the text to be passed through a pipe example

echo "LInux rocks" | pastebinit -a "bigbrovar" -b http://paste.ubuntu.com
would send the words Linux rock to http://www.paste.ubuntu.com under the username bigbrovar (please don’t send Linux rock to pastebin its meant for serious stuff🙂 )

You can also use it with the grep.  Example

grep -r intrepid /etc/apt/sources.list | pastebinit -a "bigbrovar" -b http://paste.ubuntu.com b

and it would pipe the out of grep to paste.ubuntu.com

Hope someone finds this useful

4 Comments »

  1. that’s cool, thanks🙂
    we use this service for work, it’ll be useful.

    Comment by nobu^ — March 21, 2009 @ 12:47 pm | Reply

  2. @nobu^ am glad you like it.🙂

    Comment by Bigbrovar — March 21, 2009 @ 1:03 pm | Reply

  3. well, i wud try it out if it will work

    Comment by abiola adewale — March 23, 2009 @ 7:05 pm | Reply

  4. give it a try abiola and please let me know how it works for you.

    Comment by Bigbrovar — March 24, 2009 @ 6:45 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: