Created
September 24, 2015 15:44
-
-
Save jonelf/0a0b5a2084c753a0758c to your computer and use it in GitHub Desktop.
Number of IPs owned by DoD
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is more .. http://b19.se/data/