How To: Install Command Line Pastebin Utility Pastebinit FreeBSD (Pastebin It)
When working with linux it is common to have to grab text and error messages out of the console, sometime this is a big process when it comes to debugging software. The text errors can be over 1000 lines, doing that by copying and pasting takes a long time. I found a tool recently called Pastebin It, which will take output in the form of a text file and post it up on different pastebin sites. Using this out of the box on FreeBSD was a litte tricky and took me a little while to figure it out. There is a old version in the ports collection which can be found here /usr/ports/misc/pastebinit/ but I wanted to use the new version 1.1 so I installed it from source.
Here is the project page for Pastebin It, https://launchpad.net/pastebinit. To install and use on FreeBSD use my instructions below.
1. First there are a couple of pre-requisites to be installed before pastebin it can be used. Python and a python module, install these with the below commands.
cd /usr/ports/devel/py-configobj/ make install clean cd /usr/ports/lang/python make install clean rehash
2. Next download PastebinIt, latest version at the time of writing was 1.1 on the project page.
cd /usr/src/ wget http://launchpad.net/pastebinit/trunk/1.1/+download/pastebinit-1.1.tar.gz tar zxf pastebinit-1.1.tar.gz cd /usr/src/pastebinit-1.1 chmod 755 pastebinit
3. Now it is almost ready to use, the last step is to modify the pastebinit script to look for python in the correct place. Open /usr/src/pastebinit-1.1/pastebinit with your favorite text editor, nano, vi, emacs, then edit the following line, which should be the first line.
Change it to:
4. Now the script file will work and just pass it a text file or something else and it will return a pastebin url.
cd /usr/src/pastebinit-1.1 ./pastebinit -i /usr/src/core_dump.txt