Introducing the Linux info script
Daniel Nashed – 20 August 2021 00:52:26
There are interesting and also scary services out there.
If you ever wondered how websites can figure out almost about your exact location, take a look at this website https://ipinfo.io/.
They run a freemium model and provide some of their services for free.
You can request information about your current IP and other services.
This can be quite useful in own scripts where you need to determine your real IP.
For the IP itself there would be turn servers which are used by Sametime and other applications with the requirement to map IP addresses behind a NAT.
But in this case I am using an url http://ipinfo.io/json providing JSON output.
In combination with a small script, you get interesting information about your IP.
And I added a couple of other information queried from my Linux box.
The script requires another quite useful tool JQ to work with JSON files --> https://stedolan.github.io/jq/.
The script is now part of the extra directory of my start script and you can run it directly via curl piped to bash.
You see this style more and more and you should be really careful about it!
It very conventient to install docker, k3s and other applications this way.
But you need to watch very carefully from where you download which type of script!!!
You should at least take care that the site uses https:// and you should not use any switch preventing certificate checks!
Another way would be to first use curl -sfLO to download the script, have a look into it first before making it executable!
Also the -L option to follow redirects can be problematic! In this case it is needed because Git redirects those type of requests.
Running this command in my WSL2 Linux container:
curl -sfL https://raw.githubusercontent.com/IBM/domino-docker/develop/start_script/extra/nshinfo.sh | bash -
resulted in quite interesting output. The ZIP code is almost correct!
I left my original info in the output. You will get most of it from my website anyway. And the IP is dynamic ..
-- Daniel
--------------------------------------------------------------------------------
Linux OS : openSUSE Leap 15.2
Linux Version : 15.2
Kernel : 5.4.72-microsoft-standard-WSL2
CPU Model : Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
CPU MHz : 2903.999
CPU Cache : 8192 KB
Uptime : 8 day, 14 hour 55 min
Load Average : 0.33 0.25 0.35
--------------------------------------------------------------------------------
Hostname : nsh-t470p
External Host : p57b0b078.dip0.t-ipconnect.de
External IP : 87.176.176.120
Organisation : AS3320 Deutsche Telekom AG
City : Hilden
ZIP : 40721
Region : North Rhine-Westphalia
Timezone : Europe/Berlin
Location : 51.1682,6.9309
- Comments [0]