layout hack
layout hackMain Pagelayout hack
layout hack
RSS Feed RSS Feed Main page
layout hack
layout hack
layout hackAbout Melayout hack
layout hack
Software I wrote
Resume
Friends of mine
Pictures
Musicianship
Stuff I have for sale
layout hack
layout hack
layout hackPersonal Newslayout hack
layout hack
2010:
March, April.
2009:
January, March, August.
2008:
Jan, Feb, Apr, May, July, August, September, October.
2007:
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
2006:
Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
2005:
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
2004:
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
2003:
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
2002:
Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
2001:
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
2000:
Jan, Feb, Apr, May, Jun, Jul, Aug, Oct, Nov, Dec.
1999:
Jan, Feb, Jun, Oct, Dec.
1998:
Jul, Aug, Sep, Nov.
layout hack
layout hack
layout hackGeek Stuff (computer related)layout hack
layout hack
Digital Music
Java
Why LiveWire Sucks
Why ASP Sucks (a bit)
Linux
MacOS
Unix
Oracle
Perl
Emacs
O'Reilly
layout hack
layout hack
layout hack(some of) My Interestslayout hack
layout hack
Humor
Sony Playstation
Cars
layout hack
layout hack
layout hackSearchlayout hack
layout hack

layout hack
layout hackAdslayout hack
layout hack



DBM Dumper Script

This is a handly lttle Perl script which I hacked up to help me read the various DBM-based password and user info database files which we use for sites which are not big enough to justify the use of a SQL database.

The -c option chops off trailing newlines from the key, and removes null characters from the output, which is necessary in some cases, when the DBM was created by a C program.



#!/usr/local/bin/perl

if (dbmopen(%DBMFILE, $ARGV[0],0444))
{
    @the_keys=keys(%DBMFILE);
    foreach $entry (@the_keys)
    {
        if ($ARGV[1] == '-c')   
        {
            $chopped_entry=$entry;
            chomp($chopped_entry);
            $chopped_entry =~ s/\000//g;
            $chopped_value = $DBMFILE{$entry};
            chomp ($chopped_value);
            $chopped_value =~ s/\000//g;
            print '['.$chopped_entry.'] '.$chopped_value."\n";
        }
        else
        {
            print '['.$entry.'] '.$DBMFILE{$entry}."\n";
        }
    }
    dbmclose(%DBMFILE);
}
else
{
    print "Doh!\n\n";
}
exit ;