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:
I could not agree more with Christoph Haas.
I’ve tried KDE briefly during the last 6 months or so, but it never really stuck.
Some observations. I’ve bought an EeeBox (Dual Atom, with 1 GB of ram), boy, how slow is KDE. Do I really need a Vista capable machine to run KDE?
I like my current (XFCE) desktop. Why? Because it’s nice and clean. I have no use for desktop icons.
I want to grow my RAID1 array from 2x250GB to 2x500GB. The following resource has helped my a lot.
Update
It all worked, allthough the kernel decided to crash during the offline ext4 resize. But I finally have my extra disk space
% df -h | grep md6
before: /dev/md6 77G 67G 6.7G 91% /vol
after: /dev/md6 306G 67G 224G 23% /vol
Now to my problem/solution:
On Linux you often have the following problem: You are looking or touching some piece of hardware and you are asking yourself: “is this card eth0 or eth1?
I’ve always kept my first Linux CDs as a reminder of that great time when I was first exploring this unexplored territory.
These are two (bad) shots of the actual CD, maybe I should put the content of them online again? Kernel version 1.2.8, gcc version old, non working X on the default install, that kind of stuff… I was hooked forever to this stuff.
1995!
Having the day off, playing with my new DM500 and fixing our cellar
Fri Apr 24 09:44:45 +0000 2009
All systems up to Jaunty, now just watching snooker
Fri Apr 24 18:18:46 +0000 2009
I’ve never like (Open)Solaris. Maybe the kernel rules, but the userland completely sucks, something like apt should have been implemented in (Open)Solaris years ago.
Now that Oracle owns SUN and thus Solaris they should rebrand it. Maybe OpenSoracle or even OpenSorry.
Found this very nice howto, which I almost followed to the letter, except I did it in Ubuntu and currently more stuff is working out of the box, so you don’t need to do all the steps.
I’m working on an USB stick which is /dev/sdb1 in my system.
Steps I did take:
apt-get install cryptsetup hashalot cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb1 cryptsetup luksOpen /dev/sdb1 funnydiskname mkfs.ext4 -O extents,uninit_bg,dir_index /dev/mapper/funnydiskname cryptsetup luksClose /dev/mapper/funnydiskname Now pull out your disk and re-insert.
For the past year or so I’ve been trying to learn a new language called Erlang.
I’ve found this nice document, which can be used when learning the language. So here I am on Saturday evening doing some Erlang exercises :-)
Anyhow, I was doing exercise 3.4:
Erlang provides a function lists:append which joins two lists together, implement you own function append that performs the append operation. (Do NOT peek; the answer is given in figure 3.
In kernel version 2.6.29.1:
# /bin/echo -n 40000 > /proc/sys/kernel/pid_max /bin/echo: write error: Invalid argument In one older kernel I tried it still worked, so I’ve submitted a bug.
OpenLDAP uses a cn=config DIT to configure the server since version 2.4. I’m always into new stuff, but I must admit that I rather liked editing /etc/ldap/slapd.conf to configure the server. Anyhow being able to store ACLs in the tree is a big plus, but for configuring minor stuff (like indexes) it makes live more difficult.
The following site was an excellent tool in helping me configure OpenLDAP. For a list of current attributes names, see for instance here
Well, today I was looking into using LVM snapshots to allow a client OCN use Linux as a Netapp replacement…. Boy was I in for a disappointment.
LVM an sich is working great, but the moment you turn on snapshots the (in this case) write performance goes to hell. Using LVM is easy enough. The system I was on has 32 GB ram and 2 disk arrays with hardware RAID.
See this?
bond0: Warning: failed to get speed and duplix from eth* Do this:
insmod bonding miimon=100 why? When using Linux network bonding the kernel may be to quick to enslave the interfaces. When an interface is too slow to report it capabilities it will be set to 100Mbit and Full Duplex. Which is a bit sad when you have 6 Gigabit network cards…
For a few weeks months now I’m learnings how to use VIM text-objects. There is an extended help wth help text-objects in VIM. I’m trying to condense the VIM help in a smaller blog entry here.
What are a text-objects in vim? Text-objects are things like a ‘paragraph’ or the text between braces or something like a word. Text-objects can be used with the normal vim commands y, d and c.
As I’m on an upgrade roll I decided to upgrade my new server too. It is configured with kerberos and ldap… and this is were the trouble.
ldap When a service is upgraded in Ubuntu/Debian it is first stopped and than later restarted when the new files are there. When all your user information is kept in ldap, the following sucks:
Preparing to replace slapd 2.4.11-0ubuntu6.1 (using .../slapd_2.4.15-1ubuntu3_i386.deb) ... Stopping OpenLDAP: slapd.
A short guide on how to build the new notification system, which is scheduled for Jaunty, for Intrepid.
First download the source packages from: http://packages.ubuntu.com/source/jaunty/notify-osd
You will need the .dsc and the .tar.gz files, then you need to follow the Debian way of building the package.
dpkg-source -x notify-osd_0.9ubuntu2.dsc cd notify-osd-0.9ubuntu2/ One important tweak, otherwise it will not install in Intrepid and will complain about an human-icon-theme that is tool old
Today if removed two annoyances I had with VIM.
Command mistyping I often mistype the following:
:w! becomes :W!
or
:q! becomes :Q!
Which is annoying because W and Q do not mean anything, and I don’t write or VIM does not quit. VIM has a nifty feature called commands which you can (re)define or add new commands.
Lets try some to fix this, in a running vi:
:com -bang W write!
The following might be helpful to others too. I was trying to setup a new raid1 device from two partitions /dev/sda4 and /dev/sdb4. I wanted to do this the “right way” and use UUID everywhere, i.e. in /etc/mdadm/mdadm.conf and in /etc/fstab.
I hit a few snags along the way.
create the array # mdadm --create --verbose /dev/md6 --level=1 --raid-devices=2 \ /dev/sda4 /dev/sdb4 Get the uuid mdadm uses:
# mdadm --detail /dev/md6 | grep UUID UUID : dc9aba5e:ed1a70d4:770765d8:b0f56d86 (local to host elektron2) Check.
In bash (and other shells) you can use the [[ construct
From the bash manpage:
[[ expression ]] Return a status of 0 or 1 depending on the evaluation of the conditional expression expression. Expressions are composed of the primaries described below under CONDITIONAL EXPRESSIONS. Word splitting and pathname expansion are not performed on the words between the [[ and ]]; tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal are performed.
A colleague of mine had some nice improvements to gitvi.
Right now gitvi can be edited by itself, because the magic sequence $Hash$ is escaped like this
sed -i -e 's/\$[H]ash:.*\$/$H''ash$/' "$base" (This was Ton’s idea)
Some other improvements like a -m MSG switch which allows you to enter a commit message for all files you are editing.
And of course it then also needs to have a -h switch.
Re-selection of a visual When you use control-v or shift-v in vim to do a visual selection and then use (for instance) y to copy the selected text, you loose the selection.
More often than not you want to do another thing with the selection you just had. How?
gv Copy to clipboard
Make a selection and use
"*yy Now the selection is ‘under your mouse’. If think I’m going to bind this sequence to something more easy, like *Y.
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.
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)
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:
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.
You are using the ControlMaster feature of ssh and you are having problems remembering which shell is the master?
That’s why I’ve made zsh display this in the prompt. You get a m@ when a connection is a master connection and an @ if it is a slave.
setting up The check if we are a master works by creating a file which has $SSH_CLIENT as the name, as the following snippet shows.
The script in using git and vi together was a little bit borked, as too many git repo’s were created. Hence a new and improved version. This one will look up the directory tree to spot an existing git repository - is nothing found a new one will be created in $PWD.
code #!/bin/zsh # a wrapper around git and vi # expands $Hash$ to $Hash: file short_hash epoch committer $ # git checkout HEAD $file?
A long while back I used vi together with rcs to manage files in /etc. This worked, but I found rcs to be clunky. So welcome to the 21st century and my git + vi script.
It is a wrapper around git, which will create a new git repository, add the file and commit it when changed.
The script will also expand $Hash$ to
$Hash: basename-of-file short-commit-hash epoch committer` a typical example is