Main | 1 2 Next

Weblog Archives

August 8, 2006

AnySQL.net hacked and new IamDBA.com

    My old personal site (http://www.anysql.net) was hacked about two weeks ago, and very unfortunately I have no backup of my site, finally I lost about 4 months of data. AnySQL.net was hosted on my friend's WEB space, due to security requirement of my friends, I was unable to upload updated software to anysql.net, please come here to download latest version of my utilities.

    The hacker's behavior of destroy personal site should be blamed, there is no reason to do like this. And the hacker is obviously not professional at all.

    Thanks for your visit.

August 16, 2006

Made some change to mt-scode.cgi, just for fun!

    I make two changes to the security code display on my blog, first is to use different color for each digit, the second is change the location of each digit. Why I do this change is that some spam comments software have been able to read the digit from image file, Fenng's site has received lots of spam comments. My site almost has no comments, I made the change just for fun.

    The first thing is to generate for different color, I changed the code from:

$c_code4 = $im->colorAllocate(128,128,128);

to:

$c_code1 = $im->colorAllocate(xxx,xxx,xxx);
$c_code2 = $im->colorAllocate(xxx,xxx,xxx);
$c_code3 = $im->colorAllocate(xxx,xxx,xxx);
$c_code4 = $im->colorAllocate(xxx,xxx,xxx);

    Then change the code which draw the text to image:

$im->string(gdGiantFont,8,2,$scode,$c_code);

to:

$im->string(gdGiantFont,xx,yy,substr($scode,0,1),$c_code1);
$im->string(gdGiantFont,xx,yy,substr($scode,1,1),$c_code2);
$im->string(gdGiantFont,xx,yy,substr($scode,2,1),$c_code3);
$im->string(gdGiantFont,xx,yy,substr($scode,3,1),$c_code4);

    I am not sure whether this change could help you prevent spam comments. Maybe it's a really useless idea.

September 6, 2006

Inprove the performance of SCode plugins of Movable Type

    My friend,Fenng close the SCode (Anti-Spam Plugins) on his blog, because of this plugins consumed too much host CPU, and introduced the high load of web host. So I am trying to tuning the performance by cache the security code images, when accessing the page, if the cached image does not exist then it will call the GD library to draw the image (I think this step consumed most resource), else it will just read the content of the cached image.

    I have finished the change, but I cannot test the effect, because of web clicks of my host is not high at all. Hopefully someone can tell me the performance improve.

    Two changes of SCode.pm file, add a new function to return the temporary directory, and limited the security code to between 1000 and 5000, as following:

###########################
#                        #
# Do not modify from here #
#                        #
###########################
sub scode_tmpdir {
    return $tmpdir;
}

if ($code>0 && $code<=$scode_maxtmp)
{
    $scode = 1000 + ($scode % 4000);
    open(OUTFILE,">${tmpdir}${code}");
    print OUTFILE $scode;
    close(OUTFILE);
}

    Changes to mt-scode.cgi file, if the image are cached the read the cached image, else generate a new one and cache it. As following:

View Full Article ...

More changes to the SCode plugins of Movable Type

    I have heard that Fenng got a lot of spam message even with SCode plugins in his blog system, seems some spam robot are able to get the security code from image. Imaged security code are widely used in everywhere, to SCode plugins, maybe the image is too simple, we can modify it. I made two changes here:

  1. Draw four digit in different color.
  2. Draw a verticle line with background color in the middle of digit

    Hopefully this change can help to prevent from spam message, but there is no spam message on my own site because of lower traffic. This time we just modify the mt-scode.cgi file. As following:

View Full Article ...

September 7, 2006

A JavaScript problem on IE7 Beta2

    Microsoft has released IE7 Beta2 program, when final version released, lot's of people will migrate their IE6 to IE7 for the new features and security issue. I have downloaded and installed IE7 Beta2 in my notebook, and tested the pages on my blog.

    I do hit two problems. First is CSS, one of my friend fixed the CSS problem. Second is a JavaScript problem for Lilina (The RSS page of my blog), it cannot coalapse the items by clicking the article title. It take me some time to find out the reason and fix it.

    We just need to add a new line to "js/engine.js" file as following (the red line):

function ItemShowHide(id)
{
  var status;
  var item = document.getElementById('IITEM-'+id) ;
  var i ;
  ......

    Seems JavaScript in IE7 need more strict syntax, like C programming. Variables must be declared first before use. According to JavaScript language specification, this should be fixed in final version.

    So declare variables first is a good habit for programmer.

1 2 Next

About Weblog

This page contains an archive of all entries posted to AnySQL.net English in the Weblog category. They are listed from oldest to newest.

Tools is the previous category.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.34