adding another ssd for log and cache

Just added another 60GB SSD to my ZFS pool. Has been a little nightmare – Not because of ZFS. I messed up sgdisk which does not follow the usual $source $target ordering… (so yeah, I removed my partition table.. recreating, grub-install, update-grub and everything was fine).
Continue Reading

Replacing a broken disc in ZFS (on linux)

I knew that this would happen. One of the discs in my NAS died. Sadly it was one of those discs I just bought as in lets-give-it-a-try. A Toshiba DT01ACA200. This disc died just after 10 months (and I did not use my NAS 24/7 nor do I have high iops or many writes).

Continue Reading

First steps with phar archives

While phar archives in PHP are nothing new I never had time nor interest in taking a look at them. Actually I think it is pretty nice to just deploy a single file if you are using PHP to do cli-based stuff. Not saying thats the only useful case for it. Let us take a look…
Continue Reading

the state pattern

The state pattern becomes useful if your object needs to react differently to different states. Let us assume you are writing an SMTP Proxy. SMTP works in sequences (connection establishment, ehlo/helo, mail, rcpt, data(, …), quit). Each sequence can have different error/success codes which are not available in another. For example you would only return 220 on connection establishment, not 250. And you would return 221 on quit, not 250. So if you are writing a server which works like this, you will most likely use an if then else or switch. The state-pattern would be another method to solve this. However, a more simple example which shows the pros and cons of the state pattern is an activity-based-sleep.
Continue Reading

undeletable folders using IMAP?

subfolders need the same permissions as their parent folders. The following might help you:

find -type d -print0 | xargs -r0 chmod --reference .

from within a mail directory on your server