9 February 2021

There is a website at ifconfig.co which can be used to get your public IP address. This is a reasonably nice service, and a nice alternative to Googling what is my IP address”.

One nice thing about this service is that it also works on the command line. When calling it with curl, it will return a plain-text response, making it possible to use in scripts.

curl -4 ifconfig.co
10.20.30.40

I’m guessing that it’s using the User-Agent header to detect whether the response is coming from curl. Setting it to something else will return the response as HTML:

curl -H 'User-Agent: Mozilla and stuff' ifconfig.co
<see all the angle brackets fly>

Even so, this is a very nice touch with this service.


Techniques


Previous post
AWS Console Access and API Keys If someone has access to the AWS console, should it be right for them to also have access to the AWS API? What would be a suitable use-case for them
Next post
Twitter, Subscriptions and Tweetdeck So, Twitter is now considering subscriptions and charging apps like Tweetdeck. I’m guessing the competition between Twitter and the juggernauts of