This more of a
self.note here, about programmatically accessing network interface.
Well, nothing can really beat
ip addr show but here we go with few programming languages I like to paw at.
In Ruby 2.1:
1 2 3 4 5
Here I played with
sockets but many python veterans suggest to use something like
netifaces so did a
pip install netifaces and then...
1 2 3 4
Similarly had to use
1 2 3 4 5 6 7 8
Last but not the least, my current fav!
Well, there might always be better ways to do this, do share your way.