Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Amazon owns more than $2B worth of IPv4 addresses. Parent comment
Netmasks might not always be three characters.
Perhaps something like this:
curl -sf https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[].ip_prefix' | grep -o '/.*' | sort | uniq -c
curl -sf https://ip-ranges.amazonaws.com/ip-ranges.json | jq 'reduce (.prefixes[].ip_prefix | split("/")[1]) as $mask ({}; .[$mask] += 1)'
There are no comments on this comment yet.
Netmasks might not always be three characters.
Perhaps something like this:
If you really wanted to, you could even do the splitting and counting in jq: It's a super handy tool with a real language in there!