Skip to content

Instantly share code, notes, and snippets.

@guyhughes
Last active August 29, 2015 13:59
Show Gist options
  • Save guyhughes/10568797 to your computer and use it in GitHub Desktop.
Save guyhughes/10568797 to your computer and use it in GitHub Desktop.
Determine host's IP address with DuckDuckGo and curl
#!/usr/bin/env sh
curl -fs --include --request GET \
'https://api.duckduckgo.com/?q=ip&l=1&no_redirect=1&skip_disambig=1&format=json' \
| grep -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment