Skip to content

Instantly share code, notes, and snippets.

@ckalegi
Last active June 22, 2018 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ckalegi/5c43a432d8392b60412b23bc78d1374c to your computer and use it in GitHub Desktop.
Save ckalegi/5c43a432d8392b60412b23bc78d1374c to your computer and use it in GitHub Desktop.
IP + Location from terminal
alias ip="python ~/myip.py"
save myip.py to ~/
add .bash_profile to ~/.bash_profile
import requests
r = requests.get('http://ipinfo.io').json()
print("\033[96m"+r["ip"]+"\033[90m"+"\n"+r["city"]+", "+r["region"]+", "+r["country"]+"\n"+r["loc"]+"\033[0m")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment