Thursday, April 21, 2005

Downloading with curl example

Mac OS X comes with curl as the command line web tool.

You may be familiar with wget think of curl as wget on steroids. There is a litany of options one can employ when using curl, so to just get you started you might want to try one of the following:

curl -C -O - ''

The -C says continue

-O opts to make use of the remote file name as the output file for the local save

If you want to make use of a file name that you specify then you would employ:

curl -C -o ''

Sunday, April 10, 2005

Test plan for programming students

A test plan is something that doesn't seem to get taught any more. A test plan is an integral part of Quality Assurance

The format for a test plan can be as simple as the following columns

Test Case: Sample Data: Expected Result: Checked:

Friday, April 08, 2005

Testing for a non null value in Microsoft Access

The test on a NON NULL value in Microsoft Access in incredibly ANSI compliant.

update table set colum = value where colum IS NOT NULL

Monday, April 04, 2005

Perl script to identify incorrect ownership

Was feeling inclined the other day to look through a bunch of home directories on a unix login server at work to make sure that everyone had correct ownership on their home directories.

The result of the question produced the following script:

#!/usr/bin/perl
use File::stat
open(FH,"/etc/passwd");
while($line = ) {
chomp($line);
($user,undef,$uid,$gid,$fullName,$homedir,$shell)= split(/:/,$line);
#print "Now on line: $line\n";
if( -d "$homedir") {
$homedirUID = stat($homedir)->uid();
$homedirGID = stat($homedir)->gid();
print "Permission Error: [Bad UID] ${user}'s home directory not owned by $user\n" if($uid != $homedirUID);
print "Permission Error: [Bad GID] ${user}'s home directory not owned by $user\n" if($gid != $homedirGID);
}else{
print "Homedir: $homedir doesn't exist\n";
}
}
close(FH);