Archive for September, 2004

Sep
24

Debugging CGI Using ptkdb

Posted by: | Comments (0)

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.

Categories : Notes, Perl
Comments (0)
Sep
10

Change Behavior of iTunes Arrows

Posted by: | Comments (0)

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.

Categories : Mac OS X, Notes
Comments (0)
Sep
08

Enable Safari Debug Menu

Posted by: | Comments (0)

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.

Categories : Mac OS X, Notes
Comments (0)
Sep
07

Determine Disk Usage

Posted by: | Comments (0)

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

du -sk * | sort -rn
Categories : Linux, Notes
Comments (0)