Bash builtin -e and symlinks

26 Jan 2015 | Read more... | 0 comments

Just a quick reminder that bashs builtin -e test returns false for symlinks whose destination doesn’t exist: [11:11:52][blindcoder@flora:~]$ bash --version GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <> This is free software; you are free to change...

Read more... | 0 comments

Shared and exclusive locks

20 Jan 2015 | Read more... | 0 comments

Here’s a few snippets to get and release shared and exclusive filesystem locks. I don’t remember where I first found these, but enjoy them anyway: stalelock_exclusive () { # Check if exclusive locks are stale, ie the process they point to no # longer exists # returns 0 if lock...

Read more... | 0 comments

I hate you, OpenSSH!

13 Jan 2015 | Read more... | 4 comments

Sometimes, but just sometimes, I really, really hate OpenSSH. Consider the following code: #!/bin/bash while read hostname; do ssh -o PasswordAuthentication=no -i secret.key "${hostname}" \ "echo \$(hostname): \$(date -u)" done < listofhosts.txt The file listofhosts.txt contains - surprise - a list of hostnames, one per line. The expected output of...

Read more... | 4 comments

Post-vacation re-entry

07 Jan 2015 | Read more... | 0 comments

This years’ post-vacation re-entry is really hard. After sleeping in until somewhen between 8 and 10, I gotta get up on Monday mornings at 04:30 again to travel halfway across the country to the customers site, then spend 32 hours on its premises over 4 days and travel back home,...

Read more... | 0 comments

Sorry if I disappointed you this year

31 Dec 2014 | Read more... | 0 comments

Addendum to below post: after proof-reading it, I noticed that it sounds a lot whinier than it was intended to be. No, I’m not depressed, no, everything is not fine, but yes, everything that matters is fine, thanks :-) Sorry if I disappointed you this year. This means, if I...

Read more... | 0 comments