Monthly Archive for May, 2004

Page 2 of 2

Engineering for the ego

I impressed my daughter today! The CD-ROM drive in her computer was stuck halfway and wouldn’t move anymore.

I opened up the case, took out the drive, removed the casing and peeked into the interior with a completely fake ‘I know what I’m doing’ look on my face. I saw a piece of plastic that was twisted, I removed it (silently praying), I put everything back together (actually I did that twice, I forgot some parts the first time) and voila: it worked! Elementary, my dear Watson. And I probably made the same impression on Clemence as my father used to make on me: my dad can fix anything!

Actually, for some reason this technique works quite often: you reverse-engineer a gizmo, optionally you actually fix something, you put everything back together and it works. The trick is then to put an expensive label on it: “Presumably a bad contact”, “Undoubtedly a rogue device driver”. In this case: an acute mechanical encumbrance.

[Listening to: "So What" - Miles Davis - Kind of Blue]

A Pentium 4 is not necessarily a Pentium 4

I was throwing my DAW system together, first time I actually ‘built’ my own PC, and I thought it went kind of smooth. But my PC did not want to boot every other time. It just started beeping ee-oo-ee-oo, which indicated a CPU problem. I upgraded to the newest BIOS posted on the Aopen site, and then I got the real culprit:

This motherboard does not support Prescott CPU, turn off power to prevent damage.

As if I should know the difference between a Prescott and a Northwood processor… I didn’t even know I bought a Prescott.
Anyway, this Anandtech article made it clear: both use Socket 478, but my i865G motherboard only accepts the older ones. Well, I’m learning and that was the purpose. I’ll change my Pentium4 for a Pentium 4.

[Listening to: "Finally [the Sting Reprise]” – Julie McKnight – Yoshiesque, Vol. 2 Disc 2]

No life without CURLs

If you’re a web server administrator – as I am – every now and then, someone yells at you “The site is down, fix it!”.
A tool you should always keep handy is CURL. It’s a command-line web client (multi-platform – I use it on Win2K), that allows you to see the conversation between a web server and a client (like e.g. your browser).
Let’s say if you check out a page like this: curl -I http://someserver.com/whatever, you could get

  • curl: (6) Couldn't resolve host someserver.com'
       can you CURL www.google.com? => you’re using a wrong domain name (DNS record does not exist)
       you can’t CURL anything => your DNS settings are wrong, or your DNS server does not work as expected
  • curl: (7) Connect failed
       there is no web server answering on that port
       => is the server down? does site run on other port? does a restart help?
  • HTTP/1.1 401 Access Denied [WWW-Authenticate: Basic realm="someserver.com"]
       you have to log in to this page – your browser would pop up a username/password screen
  • HTTP/1.1 403 Access Forbidden
       there is no ‘default’ document in the folder you are requesting
       => option 1: there should be a document index.html, default.htm, … in each folder
       => option 2: you want the folder to be browsable, so you have to configure this on the server
  • HTTP/1.1 404 Object Not Found
       the document you ask for does not exist.
       => are you asking for the right document (typo)? on the right server?
  • HTTP/1.1 500 Server Error
       typically only for dynamic pages (asp/php/cgi), where the program code contains an error and there is no HTML result that can be shown.
       => go look into the web server or program logs in order to find the bug.
  • HTTP/1.1 302 Found [Location: http://someotherserver.com/somepath]
       the site is redirecting you to some other URL, which itself might give an error 404/403/connect failed/…
       302 codes are not errors, it’s a common way of sending browser to the right location.
       (for example: if this 302 redirects you to a wrong port http://someserver.com:88/whatever and nothing responds on that port, in your IE browser it looks like someserver.com is failing, whereas it really is someserver.com:88)
  • HTTP/1.1 200 OK
       This is the ‘normal’ result of asking a web page.

For SSL/HTTPS problems, you better use curl -Ivk, because it gives you “* Connected to someserver.com port 443 * SSL connection using RC4-MD5 * Server certificate: (certificate content) …” information.

Have CURL installed on all your machines, Linux or Windows. Actually, add unxutils.sourceforge.net to your Windows machine, so you can work with gawk and wget too.

CURL is not the same as a real browser (especially when working with cookies/sessions), but it can help you solve 90% of typical web server problems. If the problem is browser-related, and you want to see the actual conversation between your browser and the web server, use the Ethereal network protocol analyzer.