Not strictly a curl hack, but you can quickly get your IP geolocation details with curl and <a href="http://ipinfo.io" rel="nofollow">http://ipinfo.io</a> (full disclosure, it's my service):<p><pre><code> $ curl ipinfo.io
{
"ip": "208.54.39.206",
"hostname": "mce2736d0.tmodns.net",
"city": "Los Angeles",
"region": "California",
"country": "US",
"loc": "34.0522,-118.2437",
"org": "AS21928 T-Mobile USA, Inc.",
"postal": "90013",
"phone": 213
}
</code></pre>
Or just your IP<p><pre><code> $ curl ipinfo.io/ip
208.54.39.206
</code></pre>
Or any other field (eg. city)<p><pre><code> $ curl ipinfo.io/city
Los Angeles
</code></pre>
Or lookup another IP<p><pre><code> $ curl ipinfo.io/8.8.8.8
{
"ip": "8.8.8.8",
"hostname": "google-public-dns-a.google.com",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.3860,-122.0838",
"org": "AS15169 Google Inc.",
"postal": "94040",
"phone": 650
}
</code></pre>
Or a specific field for that IP:<p><pre><code> $ curl ipinfo.io/8.8.8.8/org
AS15169 Google Inc.</code></pre>
Slightly offtopic, but I highly recommend using httpie for command line http:<p><a href="https://github.com/jkbrzt/httpie" rel="nofollow">https://github.com/jkbrzt/httpie</a><p>No cheatsheeet needed, the syntax is a lot friendler.
Confessions. I know I should use curl but I never do and just use wget and think curl is just a one year newer wget :(<p>curl is better tool than wget but I used wget first and never changed. I do use aria2c more now for downloading but I know curl is a great tool I don't use.