Archive for April, 2009

European Peacock butterfly (Inachis io)

Thursday, April 16th, 2009

This is the European Peacock butterfly (Inachis io)

Inachis io (butterfly)

Inachis io (butterfly)

(I’d say that Canon S5 IS has a lot of downsides, but sometimes its macro mode is amazingly good!:-)

The shot is from April 4th this year, from near the town of Svoge.

Light Trails (experiment)

Thursday, April 16th, 2009

Light Trails (Canon S5 IS)

This is a photo experiment from a few days ago… It’s nothing spectacular (and with a Canon S5 IS this is almost the maximum you can achieve)… I added a bit of contrast and one effect (using Adobe Fireworks).

Still, I kinda like it. And sometimes I dream of the moment when I can make a photo using F 21 number and 2 minutes exposition time (at least)… :-)

WordPress capturing $_POST requests (updated script)

Tuesday, April 14th, 2009

A while ago, I discovered a small and useful code snippet, which allowed you to capture all $_POST activity, related to your WordPress blog.

This might be useful when your WP-based website is experiencing a hacker attack. Or when you want to know where from is coming the biggest spam comment flood that try to drown your MySQL database in spam.

After using this small code snippet for a while, I discovered a way to improve it a little bit.

The original script didn’t show timestamps of the events recorded. I added this functionality, while leaving the original code almost the same.

If you want to use this updated version, feel free to copy the code:

$posty_ip = $_SERVER['REMOTE_ADDR'];
$the_file = $_SERVER['SCRIPT_NAME'];
$date_sub = date('Y-M-d @ H:i (O)');
if ( $posty_ip != "" && $posty_ip != "" ) {
  if ( !empty($_POST) ) {
    $fp = fopen( '/home/path/path-to-log.html', 'a' );
    foreach( $_POST as $key => $value ) {
	fwrite( $fp, $key.' = '.$value." <br />\n" );
    fwrite( $fp, "ip = ".$posty_ip." <br />\n" );
    fwrite( $fp, "date = ".$date_sub." <br />\n" );
    fwrite( $fp, "file = ".$the_file." <br />\n" );
    fwrite( $fp, '================================================'." <br /><br />\n\n" );
    fclose( $fp );

I also added HTML line breaks, as for me it was more useful to have an HTML log file.

The instructions where (and how) to place this code can be found in the original place. Still, it’s worth repeating: Be careful where you place the log file on your server!

I would also recommend to use a plugin, which encrypts passwords (you can download it from This is not obligatory, but it is always wise to send passwords over http encrypted, and this plugin does exactly that (you don’t have to use https to be able to encrypt the passwords being sent).

Enjoy! :-)

[ is the virtual home of Web & graphic designer Michel Bozgounov | powered by WP & hosted by DreamHost | also available in български ]

3.094 / 27 / 23.5