Running autossh with OSX automator
On my work OSX laptop I have a need to have some ports forwarded to my NAS at home, until now I've been manually running the ssh command (using a script) but this becomes very annoying when connect...
On my work OSX laptop I have a need to have some ports forwarded to my NAS at home, until now I've been manually running the ssh command (using a script) but this becomes very annoying when connect...
On my headless Linux NAS I'm running a VNC server to run the occasional X11 program remotely. Because I don't need a full desktop environment, I used XFCE. However, when using a terminal session I ...
I needed to clean up a bunch of files recently that contained both a common and unique part, something like this: Show_Episode1-ID_12345.mp4 Show_Episode1-ID_67890.mp4 Note that there are two co...
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 ...
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...
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 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 ...
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...
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
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...