Skip to main content

Thread: Get GPS Location from terminal


you have have curl installed


http://foss-boss.blogspot.com/2010/0...on-street.html

the following code works if:
- run in root shell (ubuntu users do: "sudo -i" paste it)
- connected via wifi access point
- wireless adapter called wlan0 (otherwise replace correct name)
- you're using linux system or similar (i.e. windows won't work here)
enter following in terminal. should tell location
/bin/echo '{"version": "1.1.0","host": "maps.google.com","request_address": true,"address_language": "en_gb", "wifi_towers": [{"mac_address": "' $( iwlist wlan0 scan | grep address | head -1 | awk '{print $5}' | sed -e 's/ //g' ) '","signal_strength": 8,"age": 0}]}' | sed -e 's/" /"/' -e 's/ "/"/g' > /tmp/post.$$ && curl -x post -d @/tmp/post.$$ http://www.google.com/loc/json | sed -e 's/{/\n/g' -e 's/,/\n/g
ps: if returned information wrong, or kind of "unknown" .. consider lucky, lucky! means google not (yet?) know wifi ap is. rest of .. tin-foil way

good heavens, , people this? hello? you're running big blob of obfuscated code root!


Forum The Ubuntu Forum Community Ubuntu Community Discussions The Cafe Get GPS Location from terminal


Ubuntu

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support