Vista won’t turn off the monitor

I run Vista at home primarily for gaming purposes (and I like uTorrent). One of the problems I had with it lately was it not turning off the monitor when the power saving plan was supposed to. I would watch it try and turn off, but usually wouldn’t quite succeed. Eventually I determined the problem was having the screen saver set to activate at the same time the monitor was supposed to turn off. I set the screen saver to activate 1 minute earlier and everything is now working correctly.

OpenDNS kills Google

Yesterday I was having problems getting to Google. The rest of the internet worked fine, but I couldn’t connect to Google. It struck me as unlikely that Google would be down and check with Down for Everyone confirmed that it was just me.

After much digging and a bit of thinking, I discovered google.com was not actually resolving to google.com. It was resolving to an OpenDNS service. Apparently they do some proxying of Google to make sure some of their advanced features keep working. To fix the problem, I just had to turn of the proxy and everything was golden.

To turn of the proxy:

  1. Login to OpenDNS
  2. Go to Settings
  3. Go to Advanced Settings (the link is on the left)
  4. Turn of the proxy
  5. Enjoy

Adobe Air in Jaunty (Ubuntu 9.04)

I just finished reinstalling Ubuntu 9.04 and was trying to install my air applications. Not terribly difficult…

  1. Download the installer from: http://get.adobe.com/air/
  2. Install ia32-libs
  3. Install lib32nss-mdns (from http://tr.im/jCFs )
  4. Install your apps

I got stuck on the third step when I was going through things. I could install Adobe Air applications, but they had no network access. Installing that library corrected the problem.

PHP Script for Deleting Orphaned Images

The title for this sucks. But that is because it isn’t easy to concisely describe (in a title fashion) what the script does. Imagine you have a lot of pictures from a photo shoot in both tif and jpg formats. You pick out the jpgs you want to keep and delete the rest. You still have all the tifs and want to delete the ones without a corresponding jpg. This script will do that. It takes three arguments: directory to delete from, directory to base that on, and an optional backup directory to move instead of deleting.

If you want it to handle different extensions, edit the code where it says jpg and tif

#!/usr/bin/php

< ?php

$deleteFromDir = rtrim($argv[1], '/');
$basedOnDir = rtrim($argv[2], '/');
$backupDir = rtrim($argv[3], '/');

if(!empty($backupDir) && !file_exists($backupDir)){
	if(!mkdir($backupDir)){
		dir("Unable to create backup directory. Quitting\n");
	}
}

$dh = opendir($deleteFromDir);
if($dh){
	while(false !== ($file = readdir($dh))){
		if($file[0] != '.' && !empty($file)){
			$info = pathinfo($deleteFromDir . '/' . $file);
			if($info['extension'] == 'tif' && !file_exists($basedOnDir . '/'. $info['filename'] . '.jpg')){
				echo $file . "\n";
				if(!empty($backupDir)){
					rename($deleteFromDir . '/' . $file, $backupDir . '/' . $file);
				}else{
					unlink($deleteFromDir . '/' . $file);
				}
			}
		}
	}
}else{
	echo "Unable to open $dir\n";
}