Skip to content

Instantly share code, notes, and snippets.

@chrismay
Created May 6, 2011 08:46
Show Gist options
  • Save chrismay/958645 to your computer and use it in GitHub Desktop.
Save chrismay/958645 to your computer and use it in GitHub Desktop.
cloudfront_warmer_oneline.rb
url_to_ips = cloudfront_urls.collect{|url|[url,dns_servers.collect{|server| dns.resolve(server,url.host)}.flatten]}.collect{|(url,ips)| ips.collect{|ip|
[url.to_s,ip,Net::HTTP::start(ip,80){ |http| http.get(url.path,{"Host"=>url.host}).code}]
}}.flatten(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment