Skip to content

Instantly share code, notes, and snippets.

@peterhellberg
Created March 8, 2012 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterhellberg/2001873 to your computer and use it in GitHub Desktop.
Save peterhellberg/2001873 to your computer and use it in GitHub Desktop.
Check if all the old blog posts has been transferred to athega.se
require "net/http"
remote_cmd = 'cat /tmp/2012-03-05-blogg.athega.se.sql | grep -E "^20../"'
slugs = `ssh athega.se #{remote_cmd}`.split("\n")
req = Net::HTTP.new('athega.se', 80)
slugs.each do |slug|
response = req.request_head("/blogg/#{slug}")
puts (response.code != "200") ? "Missing: #{slug}" : "OK: #{slug}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment