Python: Get HTTP headers from urllib2.urlopen call?

Use the response.info() method to get the headers. From the urllib2 docs: urllib2.urlopen(url[, data][, timeout]) … This function returns a file-like object with two additional methods: geturl() — return the URL of the resource retrieved, commonly used to determine if a redirect was followed info() — return the meta-information of the page, such as headers, … Read more

How to use ssh agent forwarding with “vagrant ssh”?

I’m using vagrant 2 on OS X Mountain Lion. Vagrant.configure(“2”) do |config| config.ssh.private_key_path = “~/.ssh/id_rsa” config.ssh.forward_agent = true end config.ssh.private_key_path is your local private key Your private key must be available to the local ssh-agent. You can check with ssh-add -L, if it’s not listed add it with ssh-add ~/.ssh/id_rsa Don’t forget to add you … Read more