OpenVPN keeps disconnecting with an inactivity timeout
I’ve used openvpn on Mac (using Tunnelblick) for a few years for a home->work VPN connection with no issues, and suddenly today, it would disconnect me every two minutes. This…
Posting Slack message on Google Docs spreadsheet cell update
We’ve been using a bit of a google doc recently for logging stuff, and sometimes cells get missed. I wanted to just test out a bit of google doc and…
Whats my IP from command line
I often need to check my WAN IP address – so this little command will do it for you in a terminal window dig +short myip.opendns.com @resolver1.opendns.com If you alias…
Rename a branch in SVN
If you made a typo or a similar mistake when naming your new branch, and you want to rename it, is very simple: svn move http://svn.domain.com/project/branches/old/ http://svn.domain.com/project/branches/new Remember to switch…
Mac OSX – Can’t eject disk (in use)
So you get that annoying “The volume can’t be ejected because it’s currently in use.” message trying to unmount your disk, well, to find out what is using the disk,…
svnX – Use DiffMerge as diff tool
So, I use svnX on MacOSX and I find DiffMerge a much nicer application than the default FileMerge, but I couldn’t get it to load. I was getting some spurious…
Plex – External FAT32 USB drive
So, trying to use a Linux Mint laptop and Plex for a lower power consumption server seemed a good idea, until I realised the disk in the laptop was only…
Mysqldump all databases and gzip
So, quick and simple MySQL backup in a CRON. #!/bin/bash _hour=`date '+%H'`; _user="root"; _pass="thepassword"; _dest="/srv/backups/daily/"; mysqldump -u $_user -p$_pass --all-databases --ignore-table=mysql.event | gzip > $_dest_$_hour.sql.gz I’ve used this in an…
Grep duplicate JSON keys
If you have large JSON files with application settings in, you need to be sure that the settings only appear once. Not a problem until you get to the stage…
Case insensitive PHP in_array()
Simple function for using in_array() with case insensitive querying. function i_in_array($needle, $haystack) { return in_array(strtolower($needle), array_map("strtolower", $haystack)); }