website tracking
Logo
Japan
 
My Photo
Name: James Pearce
Location: Perth, WA, Australia

Powered by Blogger

What No resolv.conf?

In Mac OS X, although it has a /etc/resolv.conf, it doesn't seem to use it. So although I have a local network, and a local DNS to resolve my local hosts, I was not able to ping anyone!

See, when I do a dig on "spanky" it resolves correctly using the local DNS. But when I ping (or use any other application that does an nslookup) it fails. I believe this is because dig goes straight to the DNS, while other applications attempt to use multicast. This bypasses resolv.conf completely.

To make Mac OS X use the search domains and DNS that are in resolv.conf, I had to add them in the Network control panel. Look in TCP/IP for the DNS and Search domains sections, and this should do the same trick you used to use resolv.conf for!
I think my phone makes a lot of electro-magenetic radiation. Every time I put my USB key (attached to my keys) in the same pocket as my phone for more than about 30 minutes, the data on the key becomes corrupt. I can format it and put data on it again, and it works fine...but when it is near my phone for long enough, it corrupts again. Sigh. Interesting though :)
EditDNS Fun
Friday, January 11, 2008
Ok this one took me a little while to figure out, and I'm pretty sure some mail was lost in the process (I saw it bounce in the logs).

I use a paid EditDNS subscription to manage my DNS. They're usually very reliable, and the interface is the best I've come accross. I recently shifted a bunch of domains for my clients that expired into the EditDNS system. This enlarged my name database enough that I needed some system to keep track of what was going to point where. I decided to minimise the amount of administrative overhead by using CNAME records when I knew the IP's were dynamically dependent on the IP of another record.

For instance, I like to map the domain record to the www record like this:

;; QUESTION SECTION:
;test.com.au. IN A

;; ANSWER SECTION:
test.com.au. 84644 IN CNAME www.test.com.au.
www.test.com.au. 84644 IN CNAME client.sirtech.com.au.
client.sirtech.com.au. 270 IN A 208.78.99.104

But for some reason I found that using a CNAME for the domain record actually breaks the MX resolution. I mean, when I do an MX lookup, I get this:

;; QUESTION SECTION:
;test.com.au. IN MX

;; ANSWER SECTION:
test.com.au. 84578 IN CNAME www.test.com.au.
www.test.com.au. 84578 IN CNAME client.sirtech.com.au.

Now, I would expect this to cause sending mail to test.com.au to fail. It doesn't. What it does is when I send to user@test.com.au, it rewrites the address to user@www.test.com.au, connects to the correct MX record, and attempts to process!
So that fails usually because I don't map users to www.test.com.au, I map them to test.com.au.

As soon as I change the domain record back to an A record, it works. I still don't know why this is, I guess I will have to read more about DNS sigh.
Text Wrapping In GMail

I use GMail as my everyday email program. Unfortunately, when someone sends me an email with a long image in it, GMail wraps the text in line with the image. So if I have to scroll to see the image, then I will have to scroll way to the right to see the text too. It's most annoying. Also, GMail to not provide a way to force the text to wrap to 100 characters (for instance) like most native-OS email programs do.

To get around this, I installed the Web Developer Tools toolbar for Firefox, and used it to hard wrap my text. The option is in Miscelaneous::Linearize Page. I use it when I view the prinatable version of the page (because I like to print the page). Works well :)
Logitech QuickCam for Notebooks
...With Debian Linux! (and 2.6.12)

Logitech use a bunch of different chips depending on your camera. This is a recent (2007) camera, and the USB ID is  046d:08ae (from lsusb in usbutils.deb). I tried qc-linux and pwc (or the fork of it anyway) with no success.

I found that the GSPCA driver works. Just build it as a module and go :)
From http://mxhaard.free.fr/download.html. The link on the top for the SPCA5xx gives a list of supported cameras and USB ID's.

Then I'm using FSWebCam for images: http://www.firestorm.cx/fswebcam/

I had to install libgd-noxpm-dev (.deb) to get fswebcam to compile. The XPM version requires a whole bunch of X libraries which is the whole reason for avoiding most of the other webcam utilities!

My actual command is:

fswebcam -l 5 -r 640x480 --font "/usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib/fonts/LucidaBrightRegular.ttf" --deinterlace --no-overlay --title "Hilton Front" --timestamp "`date`" --jpeg 70 --set depth=8 /var/www/webcam/1.jpg

And I'll add -b to background it when I'm satisfied with it. 

As you can see, it needs the location of a TrueType font to be able to do the writing on the banner on the bottom. Otherwise you just get an opaque purple bar on the bottom and an error about not being able to find / open the font on the console. 

Oh by the way, it's not a very good webcam for security monitoring (the focus is really limited). But at least it works, and it probably works really well if you actually use it on your notebook ;)