What is my ip?

2010-03-14 1 min read Bash

$ alias whatismyip="wget -q -O - <a href="http://whatismyip.com/automation/n09230945.asp"">http://whatismyip.com/automation/n09230945.asp" The preferred way for scripts (and easier to parse)

  • <a href="http://www.commandlinefu.com/commands/view/3943/what-is-my-ip">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/gibboris">View all commands by <a href="http://feeds2.feedburner.com/commands/by/gibboris">gibboris

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="" align="bottom" />

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/0/di" alt="" align="bottom" />
<a href="http://feedads.g.doubleclick.net/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/1/di" alt="" align="bottom" />

<img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/O6l8r0uDeTc" alt="" width="1" height="1" align="bottom" />

URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/O6l8r0uDeTc/what-is-my-ip">http://feedproxy.google.com/~r/Command-line-fu/~3/O6l8r0uDeTc/what-is-my-ip

Get your external IP address

2009-11-04 1 min read Bash Linux

$ echo -e "GET /automation/n09230945.asp HTTP/1.0rnHost: whatismyip.comrn" | nc whatismyip.com 80 | tail -n1

  • <a href="http://www.commandlinefu.com/commands/view/3962/get-your-external-ip-address">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/Marko">View all commands by <a href="http://feeds2.feedburner.com/commands/by/Marko">Marko

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="" align="bottom" />

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/0/di" alt="" align="bottom" />
<a href="http://feedads.g.doubleclick.net/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/1/di" alt="" align="bottom" />

<img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/7xln2n56mnk" alt="" width="1" height="1" align="bottom" />

URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/7xln2n56mnk/get-your-external-ip-address">http://feedproxy.google.com/~r/Command-line-fu/~3/7xln2n56mnk/get-your-external-ip-address<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.computer-realm.net/how-find-computers-ip/">How to Find Out Your Computer&#8217;s IP (computer-realm.net) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/42c8d78f-7105-47fc-9f21-6df9065a21a3/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e29.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

Continue reading

Get you ip address like whatismyip.com

2008-11-30 2 min read Bash Uncategorized

For last couple of days, I was thinking of putting this. I was thinking of some way to get the IP address of the client directly rather than going through some site or parsing the content. So <a href="http://amit-agarwal.co.in/mystuff/getip.php" target="_blank">here it is.

Now the trick here is simple. There are two ways to get the IP address of the client in the php script and thus a simple script like the below would capture both of them.

Continue reading