Home
Benjamin's Blog
Cancel

Notes on ZFS

I've recently upgraded my NAS to a HP N54L microserver and I decided it was time to migrate to ZFS. Luckily enough, ZFS on Linux became stable enough with version 0.6.3 to be used in production so ...

Find the longest filename in a directory tree

Ever wondered what the longest filename is in a directory tree? This command will tell you: ben@xyz:/srv/blog$ ls -R | awk '{ print length, $0 }' | sort -rn | head -1 73 reorganising_large_directo...

Moving large directories

I had a need to move a large directory tree on my Linux server. For this there are a number of options: Using 'mv' Of course you can just issue 'mv /sourcedir /destinationdir' and be done with it...

Two git tricks

Two tricks I needed today and definitely want to save for future reference :) Trick 1: How to reset a 'master' branch to a different branch and push it to the remote repository Nice instructions ...

Reorganising large directories with efficient remote rsync update

I've recently ran into a scenario where I wanted to re-organise my photo collection (basically move some files around). This folder is mirrored to a remote server with rsync for backup purposes. Rs...

Diff the output of two processes

This is a small but useful bash trick to apply ‘diff’ to the output of two separate commands: laptop-ben:~ benjamin$ diff <(echo a) <(echo b) 1c1 < a --- > b

Listing methods of an Objective-C class

One of the nicer things about Objective-C is that reflection is actually pretty easy to do. This code sample lists the methods of a class: #include <objc/runtime.h> // List the methods of t...

Welcome to my new blog

After 4 years of using sphpblog (which is now very much unmaintained and looks a bit outdated) I've decided to move to a new blogging solution. After lots of experimenting I ended up with Tinkerer,...

Excellent guide to troubleshooting iowait in Linux

Recently my Sheevaplug was experiencing high load caused mostly by iowait. This excellent guide shows you exactly how to troubleshoot this kind of problem using tools that are usually available on ...

More file renaming fun

One tool that made my life easier when I recently discovered it: 'rename'. It allows you to specify a sed-like command line to easily search/replace part of file names like this: rename s/"SEARCH"...