Using curl to view the HTTP headers of a file

We’ve started using Cloudflare on a big eCommerce site that I’ve been helping to upgrade the infrastructure for. Using curl (on OSX, Linux, etc.) is a really handy way to quickly view the http headers of a file such as an image to see if it’s been cached on a CDN, etc.

For example…

curl http://static.tumblr.com/n0dztf0/Eqmlsc4m3/ichilogo2-trans.png -vso /dev/null

Gives the result…

* Adding handle: conn: 0x7fc8cb80d600
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fc8cb80d600) send_pipe: 1, recv_pipe: 0
* About to connect() to static.tumblr.com port 80 (#0)
*   Trying
* Connected to static.tumblr.com ( port 80 (#0)
> GET /n0dztf0/Eqmlsc4m3/ichilogo2-trans.png HTTP/1.1
> User-Agent: curl/7.30.0
> Host: static.tumblr.com
> Accept: */*
< HTTP/1.1 200 OK
< Content-Type: image/png
< Content-Length: 6563
< Connection: keep-alive
< Date: Thu, 16 Oct 2014 19:24:24 GMT
< Last-Modified: Fri, 30 Sep 2011 12:13:16 GMT
< ETag: "ef6f678ddf7c455c7e56b4835d606f49"
< Accept-Ranges: bytes
* Server AmazonS3 is not blacklisted
< Server: AmazonS3
< Age: 34
< X-Cache: Hit from cloudfront
< Via: 1.1 d396c8f77f4715faf8da981158d9c756.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: CPZo73OEN3vXvqnWDibEUmPni3erJ8F7zZsQENGhiwcDi0H9Yw_QFQ==
{ [data not shown]
* Connection #0 to host static.tumblr.com left intact

OS X Contacts app error and unable to restore .abbu backup

I kept getting an error popping up in my Contacts.app saying:

"The operation could not be completed."

"No other information is available about the problem."

I figured I’d try to remove all my contacts and reimport them, so I exported an .abbu file of all of them and then delete them all. I then turned off iCloud, before reimport them, thinking if I turned it on again after doing so it’d re-sync them up to iCloud. What happened however was that it re-enabled the iCloud account straight after reimporting the .abbu file and then deleted all the local contacts straight away as it synced with my empty iCloud contacts. The solution was this..

  • Firstly remove your network cable or turn off your wifi to disconnect from the internet.
  • Import the .abbu file to restore all your contacts, which will no longer disappear again as it can’t connect to iCloud.
  • Now select all your contacts (select one and then press cmd+A) and drag them out to your desktop, which will create one .vcf file with all your contacts in.
  • Reconnect to the internet and your contacts should disappear again as it re-syncs with iCloud.
  • Next, just drag the .vcf file from your desktop back into the Contacts.app and it will reimport them all and then sync them up to iCloud. 
  • All your contacts on your iPhone, iPad, other Macs that are synced with iCloud should now have all your contacts back

Hope that helps someone else.

Migrating a physical Windows 2003 Server to VMware (P2V) error code: 2147549183

Tried to migrate a physical Windows 2003 server into a VMware VM using vCenter Converter tonight and was giving me the following error at about 91% both times I tried…

"FAILED: Unable to create a VSS snapshot of the source volume(s).Error code:2147549183 (0x8000FFFF)"

Turned out to be caused by a corrupt registry key on the source server, which can be manually fixed however Microsoft have handy a fix-it app that solved the problem for me straight away… Download and run it from here

Hope that helps someone else. :)

Chrome stuck in Full Screen mode on OSX 10.9 Mavericks

I’ve had this a couple of times now and it’s pretty annoying. Chrome seems to get stuck on desktop 2, in full screen presentation mode. Pressing the exit full screen button on the right of the menu bar doesn’t do anything and nor does F11 or Shift-CMD-F, the Exit Presentation Mode option in the View menu is also greyed out. I have multiple monitors and I’m not quite sure what’s triggered it, but there is a bug report for it here. I haven’t restarted to trigger the issue, it’s been something else both times. When it’s happened to me I’ve managed to fix it by resetting Chrome’s settings. Hopefully the issue will be resolved in the next update, as it’s rather annoying.

Adding A Static Route On A Technicolor TG582n

Needed to add a static route to a Technicolor TG582n modem/router tonight that is being used for a fibre upgrade. There isn’t anyway to add it in the web interface I could find, however a little look in the docs I found it can easily be added via telnet. First telnet to your router:

Username : Administrator
Password : *******
{Administrator}=>:ip rtadd dst= gateway= intf=lan1

There are several more options available if you need them. It will ask you for each one if you do something like…

{Administrator}=>:ip rtadd
dst =
[dstmsk] =
[label] =
[gateway] =
[intf] =
[srcintf] =
[static] =
[status] =
[metric] =
:ip rtadd dst= gateway=

Then just do a “saveall” and you should be good. If you make a mistake or want to delete your route, you can do that with something like…

ip rtdelete dst= gateway=

Hope that helps someone. :)

IIS 7.x “404 - File or directory not found” for .iso image files

If you get the following message when trying to download an .iso disc image from IIS 7/7.5…

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

You just need to add the MIMI type. To do this, open IIS Manager, select the server on the left, open MIME Types…

Then on the top right click Add > File name extension: .iso
MIME Type: application/octet-stream

The file should now download properly.