Many sites giving your public IP address return a web page with a bloat of html. From the command-line, you are usually only interested in the IP-address itself. Few services return exactly that.
Below are command-line examples to provide the public IP address mostly from a *nix perspective. Usually you can get similar commands to work with Windows binaries for wget and Windows binaries for curl.
In the end, I’ve opted for commands in this format, as I think akamai will last longer than the other sites (but does not include an end-of-line in the http result hence the echo on Mac/*nix):
The last two are convenient when you have both IPv4 and IPv6 configured on “the outside”.
You can replace curl with wget -q -O – (which outputs to stdout) for each command. You can even ommit the http:// (as that is the default protocol for both curl and wget).
This page shows common errors that Bash programmers make. These examples are all flawed in some way.
You will save yourself from many of these pitfalls if you simply always use quotes and never use WordSplitting for any reason! Word splitting is a broken legacy misfeature inherited from the Bourne shell that’s stuck on by default if you don’t quote expansions. The vast majority of pitfalls are in some way related to unquoted expansions, and the ensuing word splitting and globbing that result.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
The idea is that you solve a task and learn from that, or learn by seeing how others have solved tasks or draft tasks.
So in a sense it is similar to the Rosetta stone: it has different languages phrasing the same tasks.
There are already a whole bunch of languages on RosettaCode (of which a few are in the categories below), and you can even suggest or add your own languages.
When you want to solve tasks, be sure to look at the list unimplemented tasks by language that leads to automatic reports by language (for instance two of the languages I use most often: C# and Delphi).
curl https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck > bashcheck.sh
less bashcheck.sh # check if there is nothing fishy
chmod +x bashcheck.sh && ./bashcheck.sh
rm bashcheck.sh
Line 1 gets the CFE bootloader version
(1.0.2 and lower boot with 32K of NVRAM, 1.0.3 and up with 64K of RAM; some Firmwares work around the 32k limitation)
Line 2 gets the Firmware model and version
Line 3 gets the CPU speed
Line 4 and 5 get the temperature for eth1 (2.4 Ghz) and eth2 (5 Ghz) in Celsius
It is based on the RMerlinDev (firmware developer) information on temperatures: These are for each radio. Take the returned value, divide by 2, then add 20. Results are in Celcius.
Next to that knowledge, it uses a few tricks on awk calculation, and first parameter in awk (the second parameter would be the hex value of the temperature code in parenthesis) which is easier than shell calculations.
Based on those, I found a few very useful scripts: