Pasteosaurus
17th of June, 2007
Finding a nice simple pastebin for use on your own server isn’t easy. There’s plenty of hosted options - Pastie being my favourite. All I wanted was something small to paste IRC quotes. The Ruby on Rails app Rebbin looked perfect but it turns out it’s quite difficult to get a Rails app running if you know nothing about Rails. Thanks to Mr Paul Dixon, creator or pastebin.com, who released the PHP source under the GPL, I was able to find a solution… Eventually.
Still, the pastebin.com application was much more than I needed. It has support for editing, sub-domains, private pastebins, different paste lifespans, diffing and so on. It even did some crazy virtual host thing that I didn’t understand at all. So I tore it to shreds, ripping just about everything out and changing the file structure.
The GPL license enforces the re-release of modified code and being the good open source citizen that I am, here’s Pasteosaurus, available for use and download in the footer of that page. I chose the name as a bit of a contradiction to the app’s nature, simple app, complicated name and everyone likes dinosaurs.
Even if I wasn’t forced to re-release it, I would have, it feels like it fills a serious gap, it did for me. So what have I done to it? Well, that’s a good question.
- It’s now much simpler to install: upload files, create DB, run SQL, enter MySQL creditials and you’re running. It takes about 2 minutes. I couldn’t get it to work out of the box from the unmodified source.
- I’ve taken out the user option to set the paste’s lifespan. They store forever and there’s nothing you can do about it.
- Scrapped subdomains
- Scrapped the PHP and MySQL manual stuff
- Scrapped the feedback form
- Changed the author field to a title field and scrapped the remembering option
- Prettied things up, although I’m not happy with the current colour scheme, I might change it tonight and add some pretty icons.
- Cleaned up core PHP files with lavish tabbing and separation
- Complete markup and stylesheet overhall
One thing I’ve noticed whenever I’ve worked with OS code or just other people’s code in general is that the tabbing is horrible. Good tabbing makes for eye pleasing code. If you open PHP and start a new line, tab. I can’t stand code sitting right up against the left document edge.
It’s unpolished but it does the job well. Nearly all the features I removed were removed on a cosmetic level and still exist in the core PHP files. Eventually I will take it all out and clean up the code further.
There’s many obvious extensions for an app like this, ability to list all pastes, paste voting, searching, user accounts, pretty URLs, pretty URLs should have been easy to implement but they still won’t work for unknown reasons. I plan to continue work on Pasteosaurus.
