Archive for April, 2007

Universal Extractor – Extract files from unknown compressed formats

Just used this to extract a file that WinZip, 7-zip and IZArc couldn’t extract. Pretty nifty tool and free!

http://www.legroom.net/software/uniextract

Reinstall Dreamweaver 8 with different Product Key/Serial

We got upgrade copies of Dreamweaver 8 at work recently, which meant I could free up my personal copy of DW8 I installed at work. After trying to uninstall and reinstall, I quickly found there was no easy way to change the product key.

After many many attempts, I came up with a procedure in order to switch the product key in the installation.

  1. Uninstall Dreamweaver 8
  2. Delete/Rename this folder: C:\Documents and Settings\All
    Users\Application Data\Macromedia\Licensing\Products\Dreamweaver 8.0
  3. Reinstall Dreamweaver 8

There may be an easier and quicker way to do this but I was unable to find a solution with my web searches.

Test configuration before restarting Apache

Have you ever made a lot of changes to your apache conf files on your web server that you were worried that the changes may result in apache not restarting? I know I have. There is a way to check your changes before you restart the running service.

cmd:

httpd -t
# or
/usr/sbin/httpd -t

If everything was entered correctly, you should see the following message printed: “Syntax OK”.

If there are errors, it will print the first one it finds and exits. Otherwise it will print all the warnings if any and then print the “Syntax OK” message.

If you keep each virtual host in a separate configuration files like I do, then you can check the specific httpd.conf file.

cmd:

httpd -t -f /path/to/virtual/httpd.conf

I stumbled upon this great example how to write a MySQL LEFT JOIN today. It explains pretty well what they are used for and how to write one. Check it out.

http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php

One thing that should be explained better is what a regular JOIN is. You don’t have to say the word JOIN, but basically when you select from multiple tables, you are doing a JOIN.

Subversion Repository Creation Script

I have been using Subversion (SVN) pretty heavily the past couple of weeks. I wanted a quick way to create a repository that included the standard trunk, branches and tags directories and set the correct owner and file permissions for the new repo. I came up with the following script. Please feel free to comment out sections you do not need.

#!/usr/bin/php -q
< ?php
define('REPO_PARENT_PATH', '/path/to/repos');
define('REPO_OWNER', 'devel_user:devel_group');
define('REPO_MOD', '770');

if( $argc < 2 )
        die("No repo name specified.\\n\\nUsage: addrepo.php repo_name\\n\\n");
$repo_name = $argv[1];
echo "Adding Repository: $repo_name\\n\\n";

// Create repositoryi
$repo_path = REPO_PARENT_PATH;
if( substr( $repo_path, strlen($repo_path)-1, 1) != '/' )
        $repo_path .= '/';
exec("svnadmin create $repo_path$repo_name");

// Add trunk
exec("svn mkdir file://$repo_path$repo_name/trunk -m \"Add trunk\"");

// Add branches
exec("svn mkdir file://$repo_path$repo_name/branches -m \"Add branches\"");

// Add tags
exec("svn mkdir file://$repo_path$repo_name/tags -m \"Add tags\"");

// Change file permissions
exec("chmod -R ".REPO_MOD." $repo_path$repo_name");

// Change file ownership
exec("chown -R ".REPO_OWNER." $repo_path$repo_name");
?>

To use, execute the script from the shell one parameter being the name of your repository.

Example: ./addrepo.php repo_name
Blubrry player!