Skip to content

2014

Changing IP Octets with Bash

I have program at work which needs to create a UDP multicast address from a server's IP address. This process basically just entails replacing the first IP octet with “239”. In order to be able to do this I wrote the following. There is probably a much neater and more efficient way of doing this and I would love to hear it:

MCAST_IP=$(echo ${SERVER_IP} | cut -d. -f2-4)
MCAST_IP=$(echo "239."${META_MCAST_IP})

Showing Bash script execution time in seconds

Sometimes you want to know how long your bash script takes to run in seconds and you want to show that at the end of the script. The following is what I currently use to display this. There may well be a much nicer and shorter way of doing this and I'd love to hear it but this works perfectly!

An old man with a bike

My dad is retiring tomorrow and to celebrate his retirement he has decided that he is going to go on one almighty bike ride! It's taking him to all corners of the UK and is going to take several weeks. So that he can keep a diary of his ride, and so people can keep up with how he is getting on, he has set-up a blog: www.anoldmanandhisbike.com.

If you want to keep up with his ride then feel free to head over there and subscribe to his updates!