Files and Settings Transfer Wizard

Haven’t had to do this in a while…

Reference: http://www.microsoft.com/windowsxp/using/setup/getstarted/bott_fstw.mspx

They neglected the crucial, counter-intuitive rule: You must run the wizard on the new PC first. Follow the wizard’s instructions, choosing the option to create a new Wizard Disk, use an existing Wizard Disk, or use the wizard from the Windows XP CD. When you click Next, you’ll be rewarded with the screen shown in Figure 2.

Figure 2: After you see this screen, you can safely run the wizard on your old PC.
You can now go to your old PC and run the wizard. This time, the Home or Small Office Network option should be available. You’ll be prompted to enter a random password, after which you can use the speedy network connection

Using .htaccess to restrict by IP on Rackspace Cloud Servers

On the Rackspace Cloud you sometimes have to do things a little differently. For example, restricting a directory by IP address in your .htaccess file should look like this:

SetEnvIf X-Cluster-Client-Ip XXX.XXX.XXX.XXX allowclient
order deny,allow
deny from all
allow from env=allowclient

You can repeat line 1 repeatedly to allow multiple IPs.

Found here: http://www.switchonthecode.com/other/mosso-cloud-and-htaccess-issues

CakePHP Scaffolding and NULL fields

Scaffolding Null fields that render to a select, like date fields, should have a blank option

https://trac.cakephp.org/ticket/5702#comment:5

**For me it’s line 528 in libs > view > helpers > form.php
FROM
$options = array();
TO
$options = array('empty' => $this->fieldset['fields'][$name]['null']);

the whole chunk is:
if (is_numeric($name) && !is_array($options)) {
$name = $options;
$options = array('empty' => $this->fieldset['fields'][$name]['null']);
}

Capture More Error info in ADDT

Adobe Dreamweaver Developer Toolkit has a nice error – to – email class. It’s nice to sometimes capture more info than what it gives by default. For example, I like to log user info in the bug report so I know WHO is trying to do something that isn’t working, then at least I can let them know when it’s fixed. This is very nice when dealing with site admins.

The file in question is includes > tng > tNG_dispatcher.class.php

You can add some stuff around line 308 like this:
$txtContent .= "\r\Some user info:\r\n " . $_SESSION['username'];

Start OS X Finder as Root

Do this:
sudo /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder

Make sure you understand what you are up to before running the command. Running as root allows you to potentially do very bad things.

Via: http://www.macosxhints.com/article.php?story=20010514171224297

Restore mysql dump file to remote DB

First, navigate to the local directory where the file is, or in the [mysql.dump] part below, specify the full path:
mysql [db_name] -h [db_hostname/ip] -u [username] -p < [mysql.dumfile]

Custom Trigger, Set image NULL

After deleting an image from a record, you need to update the column to NULL.

So, here’s the custom Trigger. Set it to AFTER.

This is all to do with Adobe Dreamweaver Developer Toolkit. If you use it, you’ll knw what I’m yammering on about:


$query = "UPDATE tabl_name SET column_name = NULL WHERE thePrimaryKeyColumn = ".$tNG->getPrimaryKeyValue();
$update_result = $tNG->connection->execute($query);
if(!$update_result) {
$updateError = new tNG_error("Error updating column_name as NULL",array(),array());
return $updateError;
} else {
return NULL;
}
}

PNG Alpha Transparency & Adobe Dreamweaver Developer Toolkit

I already posted what to do with Adobe Dreamweaver Developer Toolkit and watermarking transparent PNG images. But, we also ran into a situation where we wanted to preserve transparency AND manually specify the image width and height. The original fix will work just fine if you leave width and height alone.

Here’s the fixed getImageCreate function (line 1886 of KT_Image.class.php)

function &getImageCreate($destWidth, $destHeight)
{
if (function_exists('imagecreatetruecolor') && $this->gdInfo>=2) {
$image = imagecreatetruecolor($destWidth, $destHeight);
imagesavealpha($image, true);
$trans_colour = imagecolorallocatealpha($image, 0, 0, 0, 127);
imagefill($image, 0, 0, $trans_colour);

} else {
$image = imagecreate($destWidth, $destHeight);
}
return $image;
}

Here’s the original, in case you need to roll back:

function &getImageCreate($destWidth, $destHeight)
{
if (function_exists('imagecreatetruecolor') && $this->gdInfo>=2) {
$image = imagecreatetruecolor($destWidth, $destHeight);
imagecolorallocate($image, 0, 0, 0);
$transparent = imagecolorallocate($image, 255, 0, 0);
imagecolortransparent($image, $transparent);
} else {
$image = imagecreate($destWidth, $destHeight);
}
return $image;
}

To me, it appears that the line imagecolorallocate($image, 0, 0, 0);
does nothing, as imagecolorallocate is used with imagecreate not imagecreatetruecolor.

Also, why specify RED as the only option for transparency? Or am I missing something? $transparent = imagecolorallocate($image, 255, 0, 0);

Samba shares and HFS extended attributes cause problems for Roaming Profiles on OS X Server 10.5 (Leopard)

Some users on a network with OS X server 10.5.2 (Leopard) as PDC controller may experience problems loading their roaming profile. Deactivating the streams support vfs module in samba did the trick. Stream support vfs module worked fine in 10.4

Continue reading ‘Samba shares and HFS extended attributes cause problems for Roaming Profiles on OS X Server 10.5 (Leopard)’

Address Book to CSV OS X

http://www.apple.com/downloads/macosx/internet_utilities/addressbooktocsvexporter.html

Sometimes I just want my addresses CSV’d dag nabbit!