Posts about:

bash
  • Find your IP

    2012-02-12

    A colleague just asked me how do I get the IP address of the server this script is running on?, which a great question. You can do it in Python but it's a bit of a hassle and as is often the case, it's really easy to do this in bash. I came up with this off the top of my head. It's not the best way to do it but it works nicely and it's very clear so I figured it would be a nice example to show. (I have a few alternative implementation as well but if you have a neat one I'd love to see it in the comments)

  • Über PS1 - with added Git

    2011-11-22

    I spend alot of time in a terminal working with git. If you're like me then you can save typing by customising your command-line prompt. I'm going to chat for a bit about why I built this, you may want to jump straight to the PS1 samples at the bottom.