Created
July 20, 2016 19:15
-
-
Save rhenning/b0828cd763e9c5ea43676662d9054bac to your computer and use it in GitHub Desktop.
Check for an address in MaxCDN's address space
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 'netaddr' | |
require 'open-uri' | |
MAXCDN_IPS = | |
open('https://www.maxcdn.com/one/assets/ips.txt').map(&:chomp).map do |range| | |
NetAddr::CIDR.create(range).enumerate | |
end.flatten | |
puts MAXCDN_IPS.include?(ARGV.first) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment