Debugging CGI Using ptkdb

September 24, 2004

ptkdb is a graphical Perl debugger. To use it when debugging command line scripts is very straight forward. Just type in the command line:


perl -d:ptkdb script.pl

and you’re good to go.

However, using it to debug CGIs needs some tweaking to your CGI source. Replace the usual

#!/usr/bin/perl

line at the top of the CGI script with this one:


#!/usr/bin/perl -d:ptkdb
BEGIN {$ENV{DISPLAY} = "$ENV{REMOTE_ADDR}:0.0";}

Go to your browser and invoke your CGI and a debugger window should pop up.

Change Behavior of iTunes Arrows

September 10, 2004

Starting with iTunes 4.5, Apple implemented those little grey arrows next to the song title, artist, and album, which will take you to the corresponding match in the iTunes Music Store. To change the behavior of these arrows so that instead of going to the store, it will take you to your library instead, you can do either one of two ways:

  1. Hit option key when you click the arrow.
  2. Change it permamnently by executing this from the terminal:
    defaults write com.apple.iTunes invertStoreLinks -bool YES

    Make sure iTunes is not running when you execute this command.

Enable Safari Debug Menu

September 8, 2004

To enable Safari Debug menu from the command line:

% defaults write \
com.apple.Safari IncludeDebugMenu 1

Make sure Safari is not running when you run this command.

Determine Disk Usage

September 7, 2004

This command will show the number of KBs used for all non-hidden files and folders in the current directory:

du -sk * | sort -rn

Bad Behavior has blocked 14 access attempts in the last 7 days.