Short URLs

Not wanting to miss anything on this short urls business, I’ve implemented something similar in nanoblogger. How? With a shell script and symlinks, my dear Watson. As with all shell scripting this is probably something you can do drunk. First I need to get a list of all my articles so that I can link to them. Next I take this permalink address, pipe it through sha1sum, take the last 10 characters and make a symlink from the permalink path and presto: short urls
Read more →

Related articles in nanoblogger

All these wordpress blogs have a related articles line below the blog entries. Sadly nanoblogger does not have such a capability, so I wrote my own. It’s not a plugin in the nanoblogger sense of the word, it may be possible to rewrite it as a regular plugin, but I do not now how… So for now a simple shell script, which you can find here. Usage within a template In your templates you should include the following:
Read more →

A ‘more…’ link in nanoblogger

Update (200911-08): I’ve stopped using this, because it made the archive generating fail in mysterious ways… As you might have seen I have now these nice (opinions may vary) “more…” links in my blog. This is done with some JavaScript and shell foo and in this entry I will explain how I did it. The setup also works with text browsers and people who disable JavaScript. In the latter case you will get the normal nb behavior where you see the entire article.
Read more →

Nanoblogger comments (update)

Basicly these blog items serve as a personal reminder and documentation. Also the code needs to be refactored a bit and some html tags need to be removed from it. Files needed The following files are needed for this comment system: comment.php, this is the PHP file the implements everything nbadmin, a small shell script that implemented the comment moderation (just a mv of the comment to the correct directory)
Read more →

NB comments

I’ve implemented a simple comment system in which there are no user accounts has a preview function once a comment is submitted you cannot edit it anymore all comments are moderated a small set of BB tags are allowed implemented as one PHP file the PHP script has some html in it needs a writeable directory in your document root You need this file: comment.php. The first few lines allow for some customization:
Read more →

Nanoblogger comments

I’ve been thinking about comments on my blog ever since I started using nanoblogger. While nb is great (with VIM and markdown) I’m starting to miss the comment stuff. Comment systems for nb I’ve been searching for a good comment system that I want to use for nb. It should meet the following criteria: Simple moderation system. With all the spam nowadays every comment made should be moderated. Should not require a database, the filesystem is enough of a database to handle these tasks.
Read more →

Bash loadable modules

Or how to create new builtins for use in bash. Short answer: you can, but it is not enabled by default (at least on my distribution, Ubuntu) This is also something that is done much better in zsh. Why do want this? SPEED! Shell scripting is a very easy way to program, but forking all these helper programs takes a lot of time. So one way to speed up your shell program is to load these programs into the shell and making them a builtin.
Read more →

gallery plugin

I’m using the gallery plugin for the photos on this site. This plugin works great and easy, but there wasn’t an easy way to create a slide show. So that you can click ’next’ and go to the next photo. So I’ve added this functionality to the script. I’m putting this up for download, so that other people may use this too. gallery.sh If you want to regenerate the slides, you can just remove the html and slides directories.
Read more →