Was poking around ServerFault this morning and came across a great one-liner command using curl which will tell you the device’s external facing IP address. This probably isn’t anything new but it was something that I just haven’t thought of until now.

curl icanhazip.com

Icanhazip.com is just a simple output of the IP address of the accessor, so it is really clean and simple, just how I like it. It is really easy to set up by yourself if you have a domain not doing anything. In index.php, place:

$ip=@$REMOTE_ADDR;  
echo "$ip";

 

You May Also Like

A note on fonts…

Considering that I plan on using a lot code on this site,…

Sensor Graphing via Wireless Sensor Network to a Mobile Internet Device

I wrote this paper during this past spring semester at West Chester…

Small 16×16 icons for websites

Looking for some small 16 by 16 icons for your website or…

Linux: Find text in a large number of files

If you need to find a string in a file, you would…