Skip to content

Instantly share code, notes, and snippets.

@jonelf
Created September 24, 2015 15:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonelf/0a0b5a2084c753a0758c to your computer and use it in GitHub Desktop.
Save jonelf/0a0b5a2084c753a0758c to your computer and use it in GitHub Desktop.
Number of IPs owned by DoD
require 'ipaddr'
sum = 0
File.open("us-military-dod.csv").each_line do |line|
ip1, ip2 = line.split(/;/)
sum += IPAddr.new(ip2).to_i - IPAddr.new(ip1).to_i
end
puts sum
@jonelf
Copy link
Author

jonelf commented Sep 24, 2015

71155867

@cisene
Copy link

cisene commented Sep 25, 2015

There is more .. http://b19.se/data/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment