[Computers]: Unpairing/hard resetting Sony Ericsson's HBH-PV700 (Bluetooth headset)

So, I was digging through my mum's old phone collection that she wanted me to throw them away. Well that was months ago, I decided to retain it for the sake of researching bluetooth fingerprints as that was somewhat my main interest as of now along with a few other things.

I came across some working phones and a dead phone (most likely been submerged into water as I recalled when trying to turn the device up whilst hooked into power supply). I came across this Sony Ericsson Z520i package that comes with HBH-PV700 free. I recalled that my mum wanted me to fix her phone because it would not charge properly. The problem with the device wasn't actually the device itself as I later found out (these days... several months later), luckily it was the charger that seems to be faulty as I somewhat have an equipment to verify. I also recalled she wanted me to somewhat salvage her bluetooth headset so that she maybe able to use on her new phone which turns out now as a cheap Nokia phone. I told her before that the chances of making the bluetooth headset pair up with a competitor branded device is unlikely. Little did I know it was my naiveness that really got to me as you'll see :)

I began searching on the internet a few moments ago on howto `unpair' the HBH-PV700. Most people replied that you need to hold down both Volume up and Volume down simultaneously for 5-10 seconds when the device is on. Even the manual on Sony Ericsson's site said similar thing except for 5 seconds instead of 5-10 seconds (Reference: http://www.sonyericsson.com/cws/download/1/940/12/1192971184/HBH-PV700__UG_R1.... Many of which tried and got back saying it does not work, frankly I've been trying that without any success as well.

I have started varying my ways of trying to hard reset the bluetooth headset in a bid to be able make it discoverable again. I have tried ways such as turning the bluetooth headset on and whilst holding both the volume keys, turn the bluetooth headset on.

In the end after fiddling around for about 1 hour, I've begun noticing a particular trend. It seems that when certain times I hold both the volume keys I can hear the usual beep sounds but not all the time. So I've tried holding both volume keys in the fashion that it would not beep, guess what it works!.

Apparently, holding down both volume keys and hearing the headset beep is a signal that the volume has either been turned on to maximum or minimum but it was not the correct sequence for hard resetting the headset. When both volume keys are held down correctly, one should not hear those 1 second interval beeps. When also held down for 5 seconds without any beeps emitted, one should then hear about 1.5/2 seconds high pitch beep, this is the signal you should be hearing. When you hear that, instead of the headset flashing green light every one second you should see the light on the headset alternates the colour between green and red constantly. This is where it makes the headset discoverable and of course able to pair with a new device.

What about turning the bluetooth headset off so that when you turn it on again it will be in discoverable mode? Unfortunately I have not found the answer to that. With my more modern aged bluetooth headset (I bought myself Nokia BH-905 headset), it should turn itself off in about 1-2 minutes. I have waited for about a minute for HBH-PV700 to do the same but it still remained powered on and in discoverable mode. I have even tried to turn the power off for the bluetooth headset which makes the headset pair with whatever device it was originally paired with (this effectively means that I'm back to square one with having to hard reset the headset).

Maybe I'll find a way to turn the headset off and make it discoverable the next time when its on, maybe I won't :) I was quite pleased to be able to find the correct method, at the same time I was unhappy with the way Sony Ericsson documented their guide on hard resetting/unpairing the headset. If they were clear on which beeps indicated what for instance it would have most likely saved lots of headaches for those who couldn't figure out.

It is also noteworthy here that HBH-PV700 is a rather old headset, judging by inquirer's questions on forums and what not, I'd say it would have been roughly 6 years old (circa 2005 for this device). I wouldn't know if anyone is facing similar issues but if they did and if they found this blog post, maybe they may find their cure :). I must however in the meantime inform my mum that I can get her old headset to pair, though I am not prepared for what she has to say about me keeping all her old phones when they should have been chucked away!.

[computers]: Freeing up some more space on N900. (revised)

Ok so in my previous blog entry there were some noticeable flaws with how it worked. I realised that but went further into adjusting the way apt-* handles package management by redirecting directories from one to the other. That didn’t work, unfortunately. So I tried to make a script to automatically do a binding mount from /var/lib/dpkg to /opt/var/lib/dpkg which regardless of the method I chose it would refuse to simply execute that. I eventually got desperate after several attempts to make N900 execute that binding mount script at boot so that I would not get funny names for individual labels.

For those who aren’t aware, the funny names on labels are cases where locales (or language strings for a specific title) are either missing, incomplete or corrupt (usually corrupt database). Here is an example of one where instead of showing: Web, Media Player, Calendar, Photos, Contacts. It shows: weba_ap_web_b, mp_ap_name, cal_ap_name, imag_ap_images and addr_ap_address.

Eventually I got a little too desperate and decided to incorporate a dirty hack (don’t ever try to attempt this or you’ll suffer the same fate) which made the device repeat the same command at every CPU cycle. In case if you were wondering, yes its the dreaded while true loop hack. If you wanted to call me stupid you can :) I had to reflash at the end after trying alternative ways to prevent the while true loop hack from gobbling up CPU cycles.

I recently came in contact with lcuk whom is part of the team that created the maemo optification package. The maemo optification package frees up the limited rootfs space which merely can only hold 256MB or so of data and places the files as well as directories into /opt which shares the same partition as /home and that sits on a 2GB partition and on a different memory chip.

Little did I know that you could actually symbolically link directories. I thought linking directories was not easy and a better approach was to actually do a binding mount. I also recalled a case with having too many symlinks will cause certain programs to not work correctly as they complain of too many symlinks.

As I explained to lcuk of my improper ways in dealing with such complicated ways of freeing up rootfs space that lbthomson noted. lcuk simply moved the directory into /opt, did a symlink from /opt to that /var/lib/dpkg, added a line into /etc/maemo-optify-auto-opt.conf and that was what was needed!

So effectively speaking one needs to do the following (as root of course):

mkdir -p /opt/maemo/var/lib
mv /var/lib/dpkg /opt/maemo/var/lib
ln -s /opt/maemo/var/lib/dpkg /var/lib/dpkg

Again I must stress that I cannot be blamed if you semi-bricked your device (i.e. bootloops at Nokia screens), if you lost hair or even if you go insane :). These are not for the faint of heart and should be done by someone whom is knowledgeable at linux skills.

Of course there are other directories that can also be optified, which were not included in the standard PR1.3, those included directories such as locale. For locales, there are two directories that needs to be optified (One of the two directories takes up a rather large chunk of space: ~24MB) You will need to do the following (as usual with root):

mkdir -p /opt/maemo/usr/lib/
mkdir -p /opt/maemo/usr/share/
mv /usr/lib/locale /opt/maemo/usr/lib
mv /usr/share/locale /opt/maemo/usr/share
ln -s /opt/maemo/usr/lib/locale /usr/lib/locale
ln -s /opt/maemo/usr/share/locale /usr/share/locale

As for portions of microb optification, the engine can be optified, It is also advisable that you do not have microb running visible, again you’ll need to be root:

mkdir -p /opt/maemo/usr/share/microb-engine
mv /usr/share/microb-engine /opt/maemo/usr/share
ln -s /opt/maemo/usr/share/microb-engine /usr/share/microb-engine

[Computers]: mtd-utils 20090606 for archlinux

Owners of Nokia N900 device and are using archlinux to tinker around in will be happy to note mtd-utils (20090606 version) is now available in the Arch User Repository (AUR). mtd-utils allows one to modify flash filesystems that are used on a wide variety of devices (including the smartphones of course).

The mtd-utils that originally was available in the AUR was rather outdated (and in saying so, this version is hardly any newer than that one :)), thus is probably not a good idea to use the said version when dealing with N900’s ubifs for instance as one may get corrupt images. The linux-mtd that I have provided is specifically used on N900, in saying that hopefully one will not get corrupt images when dealing or even making ubifs images for instance.

Without much further ado, here is the said AUR package: mtd-utils 20090606. Those of you who want to read more on about how such utilities can be used, which includes an example can be found on this talk.maemo.org thread.

In order to fully utilise the tools provided, you will need to have a kernel compiled with ubifs support. Here is a very good documentation on the tools provided plus loads of information on UBIFS.

There are two ways to dump the FIASCO image, one way is by using Nokia’s proprietary flash tool and the other is by using 0xFFFF’s open flasher tool. For those wanting to have a peek inside the root.jffs2 file you will need kernel compiled with UBIFs support, that and mtd-utils which is as mentioned provided on this blog entry. x86 from talk.maemo.org has uncovered the finer details to allow one peeking/dumping the contents of the rootfs.jffs2 file here.

[Computers]: xchat2 PM blocker script *modded*

On some IRC networks, it is a netiquette that one should not private message (by means of using /query or /msg) others without their prior permission. There is quite a lengthy discussion as to why such is a rule and I do not see such point in creating a blog post specifically for that.

Xchat initially had a PM blocker script for which one can have all the uninvited private messages going into one xchat window/tab and the person initiating the uninvited private message will get a friendly message saying that they are not allowed to privately message the said user. For some reason the script goes unmaintained and became hard to obtain as the original author seems to have lost interest.

As Xchat later became Xchat2 the script was unusable due to the fact that it relied on Xchat user’s directory and not Xchat2 user’s directory. This lead to many unanswered questions as to how to get this old script to work.

So I’ve decided to mod the original script, make it somewhat more user friendly and instead of telling the offending user that his/her uninvited private messages is blocked, it will not say anything instead to the offending user.

Here is the modified script:

#!/usr/bin/perl
#
# Query-Manager
###########################################################################
# Placed in the public domain.
###########################################################################
# Needs xchat2. This script no longer works with xchat as it has been ported.
# Typos has been fixed along with paths specified correctly.
my $script_name    = "Query-Manager";
my $script_version = '1.0.1 EN';
my $script_Date = '06.2011';
$homedir = $ENV{'HOME'};
#
IRC::register($script_name,$script_version, "", "");
IRC::print("\cC12\cB$script_name\cB Version\cC3 $script_version\cO by \cB\cC4C\cC7obra-x\cO loading...\n");
IRC::print "Type: /QMHELP to get started.\n";
#
#
# Global Variables
#
$homedir = $ENV{'HOME'};
@lstqnick;
@lstqtime=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
@lstqflood=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$stms1=": \cBActive.\cO\n";
$stms2=": \cBIncktive.\cO\n";
$qbst="\cC3<\cC4Query-Manager\cC3>\cO\11";
#
# Settings for modified
#
$mtfl=20; # Time difference in seconds for private message flooder.
$mxfl=5;  # Maximum floods in relevant time
$QBLW="QM-Log"; #Logging Window
$play_cmd = "play";
# $play_file = "C:\Program Files\X-Chat 2\plugins\.xchat\notify.wav";
$play_file = "$homedir/.xchat2/sounds/notify.wav";
$qmnn_sound = 1; # NickSond Standard = on
$QBMessage = "";
#
# Handler
#
IRC::add_command_handler("qb", "qb_on_off_cmdhandler");
IRC::add_command_handler("qbflip", "qb_flipflop_cmdhandler");
IRC::add_command_handler("qmstat", "qm_status_cmdhandler");
IRC::add_command_handler("qbadduser", "adduser_cmdhandler");
IRC::add_command_handler("qbremuser", "remuser_cmdhandler");
IRC::add_command_handler("qbloglist", "qblog_cmdhandler");
IRC::add_command_handler("qbulist", "qbloguserlist_cmdhandler");
IRC::add_command_handler("nsn", "nicksound_cmdhandler");
IRC::add_command_handler("qmhelp", "qmhelp_cmdhandler");
#
IRC::add_message_handler("PRIVMSG", "privmsg_cntl_handler");
#
# Direct Routines
#
sub qb_on_off_cmdhandler {
    my $state = shift;
    if (uc $state eq 'ON' ){
            system("rm -f $homedir/.xchat/.privoff");
            IRC::print("$qbst\cC7,0Query Manager $stms1");
            return 1;
    } else {
            if (uc $state eq 'OFF'){
                    system("touch $homedir/.xchat/.privoff");
                    IRC::print("$qbst\cC7,0Query Manager $stms2");
                    return 1;
            }
    }
    IRC::print("$qbst\cC7,0Syntax: QB [ON/OFF]");
    return 1;
}
sub qb_flipflop_cmdhandler {
    if(-e "$homedir/.xchat/.privoff") {
            system("rm -f $homedir/.xchat/.privoff");
            IRC::print("$qbst\cC7,0Query Manager $stms1"); }
    else {
            system("touch $homedir/.xchat/.privoff");
            IRC::print("$qbst\cC7,0Query Manager $stms2"); }
    return 1;
}
sub qm_status_cmdhandler {
    if(-e "$homedir/.xchat/.privoff") {
        IRC::print("$qbst\cC7,0Query-Manager:\cB Inactive.\n"); }
    else { IRC::print("$qbst\cC7,0Query-Manager:\cB Active.\n");}
    if ($qmnn_sound){ IRC::print("$qbst\cC7,0Notify blocked private messages:\cB Active.\n");}
    else { IRC::print("$qbst\cC7,0Notify blocked private messages:\cB Inactive.\n");}
    return 1;
}
sub adduser_cmdhandler {
    # Add user to whitelist
    # Add user (C) 2002 Christopher MacGown
    system("touch C:\Program Files\X-Chat 2\plugins\.xchat\whitelist"); # Ensure whitelist exists
    open(WHITELIST, ">>$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
    print WHITELIST $_[0],"\n";
    close WHITELIST;
    IRC::print("$qbst\cC7,0\cB$_[0]\cB added.\n");
    check_whitelist();
    return 1;
}
sub remuser_cmdhandler {
    # Remove User from whitelist
    # Rem User (C) 2002 Christopher MacGown
    $remove = $_[0];
    chomp($remove);
    open(WHITELIST, "<$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
    @whitelist="";
    while ( defined ($Ruser = )) {
            chomp($Ruser);
            if (lc($Ruser) eq lc($remove)){
                    IRC::print("$qbst\cC7,0\cB$Ruser\cB removed.\n");
            } else {
                    push(@whitelist,$Ruser);
            }
    }
    close WHITELIST;
    open(WHITELIST, ">$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
    foreach $QUser (@whitelist) {
            if($QUser eq "" || $QUser eq "\0" || $QUser eq "\n") { ;;
            } else {
            print WHITELIST $QUser, "\n";
            }
    }
    close WHITELIST;
    check_whitelist();
    return 1;
}
sub qblog_cmdhandler {
    IRC::command("/query $QBLW");
    IRC::print_with_channel("$qbst Qyerylogtest End","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[32]\0032>\00316\011 $lstqtime[32] $lstqflood[32] QB-Log 32\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[31]\0032>\00316\011 $lstqtime[31] $lstqflood[31] QB-Log 31\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[30]\0032>\00316\011 $lstqtime[30] $lstqflood[30] QB-Log 30\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[29]\0032>\00316\011 $lstqtime[29] $lstqflood[29] QB-Log 29\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[28]\0032>\00316\011 $lstqtime[28] $lstqflood[28] QB-Log 28\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[27]\0032>\00316\011 $lstqtime[27] $lstqflood[27] QB-Log 27\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[26]\0032>\00316\011 $lstqtime[26] $lstqflood[26] QB-Log 26\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[25]\0032>\00316\011 $lstqtime[25] $lstqflood[25] QB-Log 25\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[24]\0032>\00316\011 $lstqtime[24] $lstqflood[24] QB-Log 24\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[23]\0032>\00316\011 $lstqtime[23] $lstqflood[23] QB-Log 23\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[22]\0032>\00316\011 $lstqtime[22] $lstqflood[22] QB-Log 22\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[21]\0032>\00316\011 $lstqtime[21] $lstqflood[21] QB-Log 21\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[20]\0032>\00316\011 $lstqtime[20] $lstqflood[20] QB-Log 20\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[19]\0032>\00316\011 $lstqtime[19] $lstqflood[19] QB-Log 19\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[18]\0032>\00316\011 $lstqtime[18] $lstqflood[18] QB-Log 18\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[17]\0032>\00316\011 $lstqtime[17] $lstqflood[17] QB-Log 17\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[16]\0032>\00316\011 $lstqtime[16] $lstqflood[16] QB-Log 16\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[15]\0032>\00316\011 $lstqtime[15] $lstqflood[15] QB-Log 15\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[14]\0032>\00316\011 $lstqtime[14] $lstqflood[14] QB-Log 14\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[13]\0032>\00316\011 $lstqtime[13] $lstqflood[13] QB-Log 13\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[12]\0032>\00316\011 $lstqtime[12] $lstqflood[12] QB-Log 12\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[11]\0032>\00316\011 $lstqtime[11] $lstqflood[11] QB-Log 11\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[10]\0032>\00316\011 $lstqtime[10] $lstqflood[10] QB-Log 10\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[9]\0032>\00316\011 $lstqtime[9] $lstqflood[9] QB-Log  9\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[8]\0032>\00316\011 $lstqtime[8] $lstqflood[8] QB-Log  8\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[7]\0032>\00316\011 $lstqtime[7] $lstqflood[7] QB-Log  7\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[6]\0032>\00316\011 $lstqtime[6] $lstqflood[6] QB-Log  6\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[5]\0032>\00316\011 $lstqtime[5] $lstqflood[5] QB-Log  5\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[4]\0032>\00316\011 $lstqtime[4] $lstqflood[4] QB-Log  4\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[3]\0032>\00316\011 $lstqtime[3] $lstqflood[3] QB-Log  3\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[2]\0032>\00316\011 $lstqtime[2] $lstqflood[2] QB-Log  2\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[1]\0032>\00316\011 $lstqtime[1] $lstqflood[1] QB-Log  1\n","$QBLW","");
    IRC::print_with_channel("$qbst Qyerylogtest End","$QBLW","");
    return 1;
}
sub qbloguserlist_cmdhandler {
    open(DATA, "$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
    @Whitelist="";
    IRC::command("/query $QBLW");
    IRC::print_with_channel("$qbst\cC7Exempted Nicknames:\cO\n","$QBLW","");
    while ( defined ($Ruser = )) {
            chomp($Ruser);
            push(@Whitelist,$Ruser);
    }
    close DATA;
    foreach $Wuser (@Whitelist) {
            IRC::print_with_channel("$Wuser","$QBLW","");
    }
    IRC::print_with_channel("$qbst\cC7End of list.\cO\n","$QBLW","");
    return 1;
}
sub nicksound_cmdhandler {
    my $state = shift;
    if (uc $state eq 'ON' ){
            IRC::print("$qbst\cC7,0Notify blocked private messages$stms1");
            $qmnn_sound = 1;
            return 1;
    } else {
            if (uc $state eq 'OFF'){
                    IRC::print("$qbst\cC7,0Notify blocked private messages$stms2");
                    $qmnn_sound = 0;
                    return 1;
            }
    }
    IRC::print("$qbst\cC7,0Syntax: NSN [ON/OFF]");
    return 1;
}
sub qmhelp_cmdhandler {
    IRC::print("\cC7 -- Query Manager Getting started/Help --\n\n");
    IRC::print("You will need to create either an empty whitelist file or a list of\n");
    IRC::print("exempted usernames inside your xchat2 directory. For linux it is\n");
    IRC::print("~/.xchat2/whitelist.\n");
    IRC::print("\cC3 -- Query Blocker --\n");
    IRC::print("\cB/QB [ON/OFF]\cB Turns Query-Manager on or off.\n");
    IRC::print("\cB/qbflip\cB flip the Query-Manager on or off.\n");
    IRC::print("\cB/qmstat\cB Shows Query Blocker status.\n");
    IRC::print("\cB/qbadduser [nickname]\cB Adds a specified nickname to your whitelist.\n");
    IRC::print("\cB/qbremuser [nickname]\cB Removes a specified nickname from your whitelist.\n");
    IRC::print("\cB/qbloglist\cB Lists the actual status of logs.\n");
    IRC::print("\cB/qbulist\cB Shows the list of exempted nicknames.\n\n");
    IRC::print("\cC3 -- Nicksound Notify --\n");
    IRC::print("\cB/NSN [ON/OFF]\cB Turns Notify blocked private messages on or off.\n");
    return 1;
}
sub privmsg_cntl_handler {
    local($line) = @_;
    $MyName = (IRC::get_info(1));
    # check if blocking is turned on or off
    if(-e "$homedir/.xchat2/.privoff"){
            NSN(@_);
            return;
    } else {
            if($line =~ m/:(.+?)\!.+? PRIVMSG $MyName :(.*)/) {
                    $QUser = $1;
                    $Umessage = $2;
                    $Allow = 1;
                    check_whitelist();
                    if ($Allow) { block_privmsg();} else {
                            NSN(@_);
                            return;
                    }
            }
    }
}
#
# Internal Routines
#
sub NSN {
    if ($qmnn_sound){
            my $mynick = IRC::get_info(1);
            $mynick =~ tr/A-Z/a-z/;
            my $line = shift(@_);
            $line =~ tr/A-Z/a-z/;
            if (index($line, $mynick) != -1){system("$play_cmd $play_file &");}
    }
}
sub check_whitelist {
# For this to work correctly you want to at least touch a file in your home directory via
# touch ~/.xchat2/whitelist. You can then populate this file with a single list of usernames
# which will then be read and if matched will exempt that nickname to privmsg you.
# Upper or lower case for nicknames isn't important.
    open(DATA, "$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
    @Whitelist="";
    while ( defined ($Ruser = )) {
            chomp($Ruser);
            push(@Whitelist,$Ruser);
    }
    close DATA;
    foreach $Wuser (@Whitelist) {
            if (lc($QUser) eq lc($Wuser)) {
                    $Allow = 0;
                    return;
            }
    }
}
sub block_privmsg {
    $qfld=0;
    IRC::command("/query $QBLW");
    $QTime=time();
    if($QUser eq $lstqnick[30]) {$qtnlst=$lstqtime[30];$qfld=$lstqflood[30];}
    if($QUser eq $lstqnick[29]) {$qtnlst=$lstqtime[29];$qfld=$lstqflood[29];}
    if($QUser eq $lstqnick[28]) {$qtnlst=$lstqtime[28];$qfld=$lstqflood[28];}
    if($QUser eq $lstqnick[27]) {$qtnlst=$lstqtime[27];$qfld=$lstqflood[27];}
    if($QUser eq $lstqnick[26]) {$qtnlst=$lstqtime[26];$qfld=$lstqflood[26];}
    if($QUser eq $lstqnick[25]) {$qtnlst=$lstqtime[25];$qfld=$lstqflood[25];}
    if($QUser eq $lstqnick[24]) {$qtnlst=$lstqtime[24];$qfld=$lstqflood[24];}
    if($QUser eq $lstqnick[23]) {$qtnlst=$lstqtime[23];$qfld=$lstqflood[23];}
    if($QUser eq $lstqnick[22]) {$qtnlst=$lstqtime[22];$qfld=$lstqflood[22];}
    if($QUser eq $lstqnick[21]) {$qtnlst=$lstqtime[21];$qfld=$lstqflood[21];}
    if($QUser eq $lstqnick[20]) {$qtnlst=$lstqtime[20];$qfld=$lstqflood[20];}
    if($QUser eq $lstqnick[19]) {$qtnlst=$lstqtime[19];$qfld=$lstqflood[19];}
    if($QUser eq $lstqnick[18]) {$qtnlst=$lstqtime[18];$qfld=$lstqflood[18];}
    if($QUser eq $lstqnick[17]) {$qtnlst=$lstqtime[17];$qfld=$lstqflood[17];}
    if($QUser eq $lstqnick[16]) {$qtnlst=$lstqtime[16];$qfld=$lstqflood[16];}
    if($QUser eq $lstqnick[15]) {$qtnlst=$lstqtime[15];$qfld=$lstqflood[15];}
    if($QUser eq $lstqnick[14]) {$qtnlst=$lstqtime[14];$qfld=$lstqflood[14];}
    if($QUser eq $lstqnick[13]) {$qtnlst=$lstqtime[13];$qfld=$lstqflood[13];}
    if($QUser eq $lstqnick[12]) {$qtnlst=$lstqtime[12];$qfld=$lstqflood[12];}
    if($QUser eq $lstqnick[11]) {$qtnlst=$lstqtime[11];$qfld=$lstqflood[11];}
    if($QUser eq $lstqnick[10]) {$qtnlst=$lstqtime[10];$qfld=$lstqflood[10];}
    if($QUser eq $lstqnick[9]) {$qtnlst=$lstqtime[9];$qfld=$lstqflood[9];}
    if($QUser eq $lstqnick[8]) {$qtnlst=$lstqtime[8];$qfld=$lstqflood[8];}
    if($QUser eq $lstqnick[7]) {$qtnlst=$lstqtime[7];$qfld=$lstqflood[7];}
    if($QUser eq $lstqnick[6]) {$qtnlst=$lstqtime[6];$qfld=$lstqflood[6];}
    if($QUser eq $lstqnick[5]) {$qtnlst=$lstqtime[5];$qfld=$lstqflood[5];}
    if($QUser eq $lstqnick[4]) {$qtnlst=$lstqtime[4];$qfld=$lstqflood[4];}
    if($QUser eq $lstqnick[3]) {$qtnlst=$lstqtime[3];$qfld=$lstqflood[3];}
    if($QUser eq $lstqnick[2]) {$qtnlst=$lstqtime[2];$qfld=$lstqflood[2];}
    if($QUser eq $lstqnick[1]) {$qtnlst=$lstqtime[1];$qfld=$lstqflood[1];}
    $tmp=$QTime-$qtnlst;
    if(($tmp>$mtfl) and ($qfld>0)) {$qfld=$qfld-1;}
    if(($tmp>$mtfl*2) and ($qfld>0)) {$qfld=0;}
    if($tmp<$mtfl) {
            $qfld=$qfld+1;
            if($qfld>$mxfl) {
                    if($qfld<$mxfl+2) {
                            IRC::command("/ignore $QUser!*@* PRIV");
                            IRC::send_raw("PRIVMSG $QUser : Thankyou for attempting to flood, you are now ignored!\n");
                            IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4Ignored automatically for flooding","$QBLW","");
                    }
                    if($qfld>($mxfl*2)) {
                            if($qfld<($mxfl*2+2)) {
                                    IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4Automatically killing \c0$QUser\cC4for flooding","$QBLW","");
                                    IRC::command("/kill $Quser --> Queryflooder");
                            }
                    }
            }
    }
    if($QUser ne $lstqnick[1]) {
            $lstqnick[30]=$lstqnick[29];$lstqtime[30]=$lstqtime[29];$lstqflood[30]=$lstqflood[29];
            $lstqnick[29]=$lstqnick[28];$lstqtime[29]=$lstqtime[28];$lstqflood[29]=$lstqflood[28];
            $lstqnick[28]=$lstqnick[27];$lstqtime[28]=$lstqtime[27];$lstqflood[28]=$lstqflood[27];
            $lstqnick[27]=$lstqnick[26];$lstqtime[27]=$lstqtime[26];$lstqflood[27]=$lstqflood[26];
            $lstqnick[26]=$lstqnick[25];$lstqtime[26]=$lstqtime[25];$lstqflood[26]=$lstqflood[25];
            $lstqnick[25]=$lstqnick[24];$lstqtime[25]=$lstqtime[24];$lstqflood[25]=$lstqflood[24];
            $lstqnick[24]=$lstqnick[23];$lstqtime[24]=$lstqtime[23];$lstqflood[24]=$lstqflood[23];
            $lstqnick[23]=$lstqnick[22];$lstqtime[23]=$lstqtime[22];$lstqflood[23]=$lstqflood[22];
            $lstqnick[22]=$lstqnick[21];$lstqtime[22]=$lstqtime[21];$lstqflood[22]=$lstqflood[21];
            $lstqnick[21]=$lstqnick[20];$lstqtime[21]=$lstqtime[20];$lstqflood[21]=$lstqflood[20];
            $lstqnick[20]=$lstqnick[19];$lstqtime[20]=$lstqtime[19];$lstqflood[20]=$lstqflood[19];
            $lstqnick[19]=$lstqnick[18];$lstqtime[19]=$lstqtime[18];$lstqflood[19]=$lstqflood[18];
            $lstqnick[18]=$lstqnick[17];$lstqtime[18]=$lstqtime[17];$lstqflood[18]=$lstqflood[17];
            $lstqnick[17]=$lstqnick[16];$lstqtime[17]=$lstqtime[16];$lstqflood[17]=$lstqflood[16];
            $lstqnick[16]=$lstqnick[15];$lstqtime[16]=$lstqtime[15];$lstqflood[16]=$lstqflood[15];
            $lstqnick[15]=$lstqnick[14];$lstqtime[15]=$lstqtime[14];$lstqflood[15]=$lstqflood[14];
            $lstqnick[14]=$lstqnick[13];$lstqtime[14]=$lstqtime[13];$lstqflood[14]=$lstqflood[13];
            $lstqnick[13]=$lstqnick[12];$lstqtime[13]=$lstqtime[12];$lstqflood[13]=$lstqflood[12];
            $lstqnick[12]=$lstqnick[11];$lstqtime[12]=$lstqtime[11];$lstqflood[12]=$lstqflood[11];
            $lstqnick[11]=$lstqnick[10];$lstqtime[11]=$lstqtime[10];$lstqflood[11]=$lstqflood[10];
            $lstqnick[10]=$lstqnick[9];$lstqtime[10]=$lstqtime[9];$lstqflood[10]=$lstqflood[9];
            $lstqnick[9]=$lstqnick[8];$lstqtime[9]=$lstqtime[8];$lstqflood[9]=$lstqflood[8];
            $lstqnick[8]=$lstqnick[7];$lstqtime[8]=$lstqtime[7];$lstqflood[8]=$lstqflood[7];
            $lstqnick[7]=$lstqnick[6];$lstqtime[7]=$lstqtime[6];$lstqflood[7]=$lstqflood[6];
            $lstqnick[6]=$lstqnick[5];$lstqtime[6]=$lstqtime[5];$lstqflood[6]=$lstqflood[5];
            $lstqnick[5]=$lstqnick[4];$lstqtime[5]=$lstqtime[4];$lstqflood[5]=$lstqflood[4];
            $lstqnick[4]=$lstqnick[3];$lstqtime[4]=$lstqtime[3];$lstqflood[4]=$lstqflood[3];
            $lstqnick[3]=$lstqnick[2];$lstqtime[3]=$lstqtime[2];$lstqflood[3]=$lstqflood[2];
            $lstqnick[2]=$lstqnick[1];$lstqtime[2]=$lstqtime[1];$lstqflood[2]=$lstqflood[1];
    }
    $lstqnick[1]=$QUser;$lstqtime[1]=$QTime;$lstqflood[1]=$qfld;
    if(($qfld>$mxfl) or ($Umessage =~ m/no Query/) or ($Umessage=~m/Query-Manager is off/) or ($Umessage =~ m/Pager/)) { return 1 } else {
#           IRC::send_raw("PRIVMSG $QUser : $QBMessage\r\n");
            IRC::command("/query $QBLW");
            IRC::print_with_channel("\0032<\cO$QUser\0032>\cO\11$Umessage\n","$QBLW","");
            return 1;
    }
}

For those who wants the original script, here it is:

#!/usr/bin/perl
#
# Query-Blocker
###########################################################################
# Placed in the public domain.
###########################################################################
# Needs xchat, should work with any version > 1.6.3, tested with 1.6.3; 1.6.6; 1.6.10
#
my $script_name    = "Query-Manager";
my $script_version = '1.0.0 En';
my $script_Date = '12.2002';
$homedir = $ENV{'HOME'};
#
IRC::register($script_name,$script_version, "", "");
IRC::print("\cC12\cB$script_name\cB Version\cC3 $script_version\cO by \cB\cC4C\cC7obra-x\cO loading...\n");
IRC::print "/QMHELP for more information\n";
#
# Global Variables
#
$homedir = $ENV{'HOME'};
@lstqnick;
@lstqtime=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
@lstqflood=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$stms1="is now \cBaktive.\cO\n";
$stms2="is now \cBinaktive.\cO\n";
$qbst="\cC3<\cC4Query-Manager\cC3>\cO\11";
#
# Settings for modified
#
$mtfl=20; # Time difference in SEC who say FLood
$mxfl=5;  # Maximum Floods in relevant time
$QBLW="QM-Log"; #Logging Window
$play_cmd = "play";
$play_file = "C:\Program Files\X-Chat 2\plugins\.xchat\notify.wav";
$qmnn_sound = 1; # NickSond Standard = on
$QBMessage = "I don't accepting private messages or dialogs at this time. Please talk with me in the public channel. { Automessage }";
#
# Handler
#
IRC::add_command_handler("qb", "qb_on_off_cmdhandler");
IRC::add_command_handler("qbflip", "qb_flipflop_cmdhandler");
IRC::add_command_handler("qmstat", "qm_status_cmdhandler");
IRC::add_command_handler("qbadduser", "adduser_cmdhandler");
IRC::add_command_handler("qbremuser", "remuser_cmdhandler");
IRC::add_command_handler("qbloglist", "qblog_cmdhandler");
IRC::add_command_handler("qbulist", "qbloguserlist_cmdhandler");
IRC::add_command_handler("nsn", "nicksound_cmdhandler");
IRC::add_command_handler("qmhelp", "qmhelp_cmdhandler");
#
IRC::add_message_handler("PRIVMSG", "privmsg_cntl_handler");
#
# Direct Routines
#
sub qb_on_off_cmdhandler {
    my $state = shift;
    if (uc $state eq 'ON' ){
            system("rm -f $homedir/.xchat/.privoff");
            IRC::print("$qbst\cC7,0Query Blocker $stms1");
            return 1;
    } else {
            if (uc $state eq 'OFF'){
                    system("touch $homedir/.xchat/.privoff");
                    IRC::print("$qbst\cC7,0Query Blocker $stms2");
                    return 1;
            }
    }
    IRC::print("$qbst\cC7,0Syntax: QB [ON/OFF]");
    return 1;
}
sub qb_flipflop_cmdhandler {
    if(-e "$homedir/.xchat/.privoff") {
            system("rm -f $homedir/.xchat/.privoff");
            IRC::print("$qbst\cC7,0Query Blocker $stms1"); }
    else {
            system("touch $homedir/.xchat/.privoff");
            IRC::print("$qbst\cC7,0Query Blocker $stms2"); }
    return 1;
}
sub qm_status_cmdhandler {
    if(-e "$homedir/.xchat/.privoff") { IRC::print("$qbst\cC7,0Query-Blocker are\cB inaktive.\n"); }
    else { IRC::print("$qbst\cC7,0Query-Blocker are\cB aktive.\n");}
    if ($qmnn_sound){ IRC::print("$qbst\cC7,0Nick Sound Notify are\cB aktive.\n");}
    else { IRC::print("$qbst\cC7,0Nick Sound Notify are\cB inaktive.\n");}
    return 1;
}
sub adduser_cmdhandler {
    # Add user to whitelist
    # Add user (C) 2002 Christopher MacGown
    system("touch C:\Program Files\X-Chat 2\plugins\.xchat\whitelist"); # Ensure whitelist exists
    open(WHITELIST, ">>$homedir/.xchat/whitelist") || die "Cannot open ~/.xchat/whitelist\n";
    print WHITELIST $_[0],"\n";
    close WHITELIST;
    IRC::print("$qbst\cC7,0\cB$_[0]\cB added.\n");
    check_whitelist();
    return 1;
}
sub remuser_cmdhandler {
    # Remove User from whitelist
    # Rem User (C) 2002 Christopher MacGown
    $remove = $_[0];
    chomp($remove);
    open(WHITELIST, "<$homedir/.xchat/whitelist") || die "Cannot open ~/whitelist\n";
    @whitelist="";
    while ( defined ($Ruser = )) {
            chomp($Ruser);
            if (lc($Ruser) eq lc($remove)){
                    IRC::print("$qbst\cC7,0\cB$Ruser\cB removed.\n");
            } else {
                    push(@whitelist,$Ruser);
            }
    }
    close WHITELIST;
    open(WHITELIST, ">$homedir/.xchat/whitelist") || die "Cannot open ~/.xchat/whitelist\n";
    foreach $QUser (@whitelist) {
            if($QUser eq "" || $QUser eq "\0" || $QUser eq "\n") { ;;
            } else {
            print WHITELIST $QUser, "\n";
            }
    }
    close WHITELIST;
    check_whitelist();
    return 1;
}
sub qblog_cmdhandler {
    IRC::command("/query $QBLW");
    IRC::print_with_channel("$qbst Qyerylogtest End","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[32]\0032>\00316\011 $lstqtime[32] $lstqflood[32] QB-Log 32\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[31]\0032>\00316\011 $lstqtime[31] $lstqflood[31] QB-Log 31\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[30]\0032>\00316\011 $lstqtime[30] $lstqflood[30] QB-Log 30\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[29]\0032>\00316\011 $lstqtime[29] $lstqflood[29] QB-Log 29\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[28]\0032>\00316\011 $lstqtime[28] $lstqflood[28] QB-Log 28\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[27]\0032>\00316\011 $lstqtime[27] $lstqflood[27] QB-Log 27\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[26]\0032>\00316\011 $lstqtime[26] $lstqflood[26] QB-Log 26\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[25]\0032>\00316\011 $lstqtime[25] $lstqflood[25] QB-Log 25\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[24]\0032>\00316\011 $lstqtime[24] $lstqflood[24] QB-Log 24\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[23]\0032>\00316\011 $lstqtime[23] $lstqflood[23] QB-Log 23\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[22]\0032>\00316\011 $lstqtime[22] $lstqflood[22] QB-Log 22\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[21]\0032>\00316\011 $lstqtime[21] $lstqflood[21] QB-Log 21\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[20]\0032>\00316\011 $lstqtime[20] $lstqflood[20] QB-Log 20\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[19]\0032>\00316\011 $lstqtime[19] $lstqflood[19] QB-Log 19\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[18]\0032>\00316\011 $lstqtime[18] $lstqflood[18] QB-Log 18\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[17]\0032>\00316\011 $lstqtime[17] $lstqflood[17] QB-Log 17\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[16]\0032>\00316\011 $lstqtime[16] $lstqflood[16] QB-Log 16\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[15]\0032>\00316\011 $lstqtime[15] $lstqflood[15] QB-Log 15\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[14]\0032>\00316\011 $lstqtime[14] $lstqflood[14] QB-Log 14\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[13]\0032>\00316\011 $lstqtime[13] $lstqflood[13] QB-Log 13\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[12]\0032>\00316\011 $lstqtime[12] $lstqflood[12] QB-Log 12\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[11]\0032>\00316\011 $lstqtime[11] $lstqflood[11] QB-Log 11\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[10]\0032>\00316\011 $lstqtime[10] $lstqflood[10] QB-Log 10\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[9]\0032>\00316\011 $lstqtime[9] $lstqflood[9] QB-Log  9\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[8]\0032>\00316\011 $lstqtime[8] $lstqflood[8] QB-Log  8\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[7]\0032>\00316\011 $lstqtime[7] $lstqflood[7] QB-Log  7\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[6]\0032>\00316\011 $lstqtime[6] $lstqflood[6] QB-Log  6\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[5]\0032>\00316\011 $lstqtime[5] $lstqflood[5] QB-Log  5\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[4]\0032>\00316\011 $lstqtime[4] $lstqflood[4] QB-Log  4\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[3]\0032>\00316\011 $lstqtime[3] $lstqflood[3] QB-Log  3\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[2]\0032>\00316\011 $lstqtime[2] $lstqflood[2] QB-Log  2\n","$QBLW","");
    IRC::print_with_channel("\0032<\00315$lstqnick[1]\0032>\00316\011 $lstqtime[1] $lstqflood[1] QB-Log  1\n","$QBLW","");
    IRC::print_with_channel("$qbst Qyerylogtest End","$QBLW","");
    return 1;
}
sub qbloguserlist_cmdhandler {
    open(DATA, "$homedir/.xchat/whitelist") || die "can't open whitelist\n";
    @Whitelist="";
    IRC::command("/query $QBLW");
    IRC::print_with_channel("$qbst\cC7Akzeptierte Nicks.\cO\n","$QBLW","");
    while ( defined ($Ruser = )) {
            chomp($Ruser);
            push(@Whitelist,$Ruser);
    }
    close DATA;
    foreach $Wuser (@Whitelist) {
            IRC::print_with_channel("$Wuser","$QBLW","");
    }
    IRC::print_with_channel("$qbst\cC7Ende der Liste.\cO\n","$QBLW","");
    return 1;
}
sub nicksound_cmdhandler {
    my $state = shift;
    if (uc $state eq 'ON' ){
            IRC::print("$qbst\cC7,0Nick Sound Notify $stms1");
            $qmnn_sound = 1;
            return 1;
    } else {
            if (uc $state eq 'OFF'){
                    IRC::print("$qbst\cC7,0Nick Sound Notify $stms2");
                    $qmnn_sound = 0;
                    return 1;
            }
    }
    IRC::print("$qbst\cC7,0Syntax: NSN [ON/OFF]");
    return 1;
}
sub qmhelp_cmdhandler {
    IRC::print("\cC7 -- Query Manager Help --\n\n");
    IRC::print("\cC3 -- Query Blocker --\n");
    IRC::print("\cB/QB [ON/OFF]\cB shots on or off the Query Blocker.\n");
    IRC::print("\cB/qbflip\cB flip the Query Blocker on or off.\n");
    IRC::print("\cB/qmstat\cB shows its Blocker and Nicksound Notify active or not.\n");
    IRC::print("\cB/qbadduser [nick]\cB will add a user to your Whitelist.\n");
    IRC::print("\cB/qbremuser [nick]\cB will remove a user from your Whitelist.\n");
    IRC::print("\cB/qbloglist\cB lists the actual Status in logging.\n");
    IRC::print("\cB/qbulist\cB shows the list of accepted Nicks / Users.\n\n");
    IRC::print("\cC3 -- Nicksound Notify --\n");
    IRC::print("\cB/NSN [ON/OFF]\cB shots on or off the Nicksound Notify.\n");
    return 1;
}
sub privmsg_cntl_handler {
    local($line) = @_;
    $MyName = (IRC::get_info(1));
    # check if blocking is turned on or off
    if(-e "$homedir/.xchat/.privoff"){
            NSN(@_);
            return;
    } else {
            if($line =~ m/:(.+?)\!.+? PRIVMSG $MyName :(.*)/) {
                    $QUser = $1;
                    $Umessage = $2;
                    $Allow = 1;
                    check_whitelist();
                    if ($Allow) { block_privmsg();} else {
                            NSN(@_);
                            return;
                    }
            }
    }
}
#
# Internal Routines
#
sub NSN {
    if ($qmnn_sound){
            my $mynick = IRC::get_info(1);
            $mynick =~ tr/A-Z/a-z/;
            my $line = shift(@_);
            $line =~ tr/A-Z/a-z/;
            if (index($line, $mynick) != -1){system("$play_cmd $play_file &");}
    }
}
sub check_whitelist {
# For this to work correctly you want to at least touch a file in your homedirectory
# touch ~/whitelist   you can populate this file with a single list of usernames
# which will then be read and if matched will allow that user to privmsg you as normal.
# case isn't important
    open(DATA, "$homedir/.xchat/whitelist") || die "can't open whitelist\n";
    @Whitelist="";
    while ( defined ($Ruser = )) {
            chomp($Ruser);
            push(@Whitelist,$Ruser);
    }
    close DATA;
    foreach $Wuser (@Whitelist) {
            if (lc($QUser) eq lc($Wuser)) {
                    $Allow = 0;
                    return;
            }
    }
}
sub block_privmsg {
    $qfld=0;
    IRC::command("/query $QBLW");
    $QTime=time();
    if($QUser eq $lstqnick[30]) {$qtnlst=$lstqtime[30];$qfld=$lstqflood[30];}
    if($QUser eq $lstqnick[29]) {$qtnlst=$lstqtime[29];$qfld=$lstqflood[29];}
    if($QUser eq $lstqnick[28]) {$qtnlst=$lstqtime[28];$qfld=$lstqflood[28];}
    if($QUser eq $lstqnick[27]) {$qtnlst=$lstqtime[27];$qfld=$lstqflood[27];}
    if($QUser eq $lstqnick[26]) {$qtnlst=$lstqtime[26];$qfld=$lstqflood[26];}
    if($QUser eq $lstqnick[25]) {$qtnlst=$lstqtime[25];$qfld=$lstqflood[25];}
    if($QUser eq $lstqnick[24]) {$qtnlst=$lstqtime[24];$qfld=$lstqflood[24];}
    if($QUser eq $lstqnick[23]) {$qtnlst=$lstqtime[23];$qfld=$lstqflood[23];}
    if($QUser eq $lstqnick[22]) {$qtnlst=$lstqtime[22];$qfld=$lstqflood[22];}
    if($QUser eq $lstqnick[21]) {$qtnlst=$lstqtime[21];$qfld=$lstqflood[21];}
    if($QUser eq $lstqnick[20]) {$qtnlst=$lstqtime[20];$qfld=$lstqflood[20];}
    if($QUser eq $lstqnick[19]) {$qtnlst=$lstqtime[19];$qfld=$lstqflood[19];}
    if($QUser eq $lstqnick[18]) {$qtnlst=$lstqtime[18];$qfld=$lstqflood[18];}
    if($QUser eq $lstqnick[17]) {$qtnlst=$lstqtime[17];$qfld=$lstqflood[17];}
    if($QUser eq $lstqnick[16]) {$qtnlst=$lstqtime[16];$qfld=$lstqflood[16];}
    if($QUser eq $lstqnick[15]) {$qtnlst=$lstqtime[15];$qfld=$lstqflood[15];}
    if($QUser eq $lstqnick[14]) {$qtnlst=$lstqtime[14];$qfld=$lstqflood[14];}
    if($QUser eq $lstqnick[13]) {$qtnlst=$lstqtime[13];$qfld=$lstqflood[13];}
    if($QUser eq $lstqnick[12]) {$qtnlst=$lstqtime[12];$qfld=$lstqflood[12];}
    if($QUser eq $lstqnick[11]) {$qtnlst=$lstqtime[11];$qfld=$lstqflood[11];}
    if($QUser eq $lstqnick[10]) {$qtnlst=$lstqtime[10];$qfld=$lstqflood[10];}
    if($QUser eq $lstqnick[9]) {$qtnlst=$lstqtime[9];$qfld=$lstqflood[9];}
    if($QUser eq $lstqnick[8]) {$qtnlst=$lstqtime[8];$qfld=$lstqflood[8];}
    if($QUser eq $lstqnick[7]) {$qtnlst=$lstqtime[7];$qfld=$lstqflood[7];}
    if($QUser eq $lstqnick[6]) {$qtnlst=$lstqtime[6];$qfld=$lstqflood[6];}
    if($QUser eq $lstqnick[5]) {$qtnlst=$lstqtime[5];$qfld=$lstqflood[5];}
    if($QUser eq $lstqnick[4]) {$qtnlst=$lstqtime[4];$qfld=$lstqflood[4];}
    if($QUser eq $lstqnick[3]) {$qtnlst=$lstqtime[3];$qfld=$lstqflood[3];}
    if($QUser eq $lstqnick[2]) {$qtnlst=$lstqtime[2];$qfld=$lstqflood[2];}
    if($QUser eq $lstqnick[1]) {$qtnlst=$lstqtime[1];$qfld=$lstqflood[1];}
    $tmp=$QTime-$qtnlst;
    if(($tmp>$mtfl) and ($qfld>0)) {$qfld=$qfld-1;}
    if(($tmp>$mtfl*2) and ($qfld>0)) {$qfld=0;}
    if($tmp<$mtfl) {
            $qfld=$qfld+1;
            if($qfld>$mxfl) {
                    if($qfld<$mxfl+2) {
                            IRC::command("/ignore $QUser!*@* PRIV");
                            IRC::send_raw("PRIVMSG $QUser : You Are Ignored by Flood !\n");
                            IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4 Ignored by Flood !","$QBLW","");
                    }
                    if($qfld>($mxfl*2)) {
                            if($qfld<($mxfl*2+2)) {
                                    IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4 Kill by Flood !","$QBLW","");
                                    IRC::command("/Kill $Quser --> Queryflooder");
                            }
                    }
            }
    }
    if($QUser ne $lstqnick[1]) {
            $lstqnick[30]=$lstqnick[29];$lstqtime[30]=$lstqtime[29];$lstqflood[30]=$lstqflood[29];
            $lstqnick[29]=$lstqnick[28];$lstqtime[29]=$lstqtime[28];$lstqflood[29]=$lstqflood[28];
            $lstqnick[28]=$lstqnick[27];$lstqtime[28]=$lstqtime[27];$lstqflood[28]=$lstqflood[27];
            $lstqnick[27]=$lstqnick[26];$lstqtime[27]=$lstqtime[26];$lstqflood[27]=$lstqflood[26];
            $lstqnick[26]=$lstqnick[25];$lstqtime[26]=$lstqtime[25];$lstqflood[26]=$lstqflood[25];
            $lstqnick[25]=$lstqnick[24];$lstqtime[25]=$lstqtime[24];$lstqflood[25]=$lstqflood[24];
            $lstqnick[24]=$lstqnick[23];$lstqtime[24]=$lstqtime[23];$lstqflood[24]=$lstqflood[23];
            $lstqnick[23]=$lstqnick[22];$lstqtime[23]=$lstqtime[22];$lstqflood[23]=$lstqflood[22];
            $lstqnick[22]=$lstqnick[21];$lstqtime[22]=$lstqtime[21];$lstqflood[22]=$lstqflood[21];
            $lstqnick[21]=$lstqnick[20];$lstqtime[21]=$lstqtime[20];$lstqflood[21]=$lstqflood[20];
            $lstqnick[20]=$lstqnick[19];$lstqtime[20]=$lstqtime[19];$lstqflood[20]=$lstqflood[19];
            $lstqnick[19]=$lstqnick[18];$lstqtime[19]=$lstqtime[18];$lstqflood[19]=$lstqflood[18];
            $lstqnick[18]=$lstqnick[17];$lstqtime[18]=$lstqtime[17];$lstqflood[18]=$lstqflood[17];
            $lstqnick[17]=$lstqnick[16];$lstqtime[17]=$lstqtime[16];$lstqflood[17]=$lstqflood[16];
            $lstqnick[16]=$lstqnick[15];$lstqtime[16]=$lstqtime[15];$lstqflood[16]=$lstqflood[15];
            $lstqnick[15]=$lstqnick[14];$lstqtime[15]=$lstqtime[14];$lstqflood[15]=$lstqflood[14];
            $lstqnick[14]=$lstqnick[13];$lstqtime[14]=$lstqtime[13];$lstqflood[14]=$lstqflood[13];
            $lstqnick[13]=$lstqnick[12];$lstqtime[13]=$lstqtime[12];$lstqflood[13]=$lstqflood[12];
            $lstqnick[12]=$lstqnick[11];$lstqtime[12]=$lstqtime[11];$lstqflood[12]=$lstqflood[11];
            $lstqnick[11]=$lstqnick[10];$lstqtime[11]=$lstqtime[10];$lstqflood[11]=$lstqflood[10];
            $lstqnick[10]=$lstqnick[9];$lstqtime[10]=$lstqtime[9];$lstqflood[10]=$lstqflood[9];
            $lstqnick[9]=$lstqnick[8];$lstqtime[9]=$lstqtime[8];$lstqflood[9]=$lstqflood[8];
            $lstqnick[8]=$lstqnick[7];$lstqtime[8]=$lstqtime[7];$lstqflood[8]=$lstqflood[7];
            $lstqnick[7]=$lstqnick[6];$lstqtime[7]=$lstqtime[6];$lstqflood[7]=$lstqflood[6];
            $lstqnick[6]=$lstqnick[5];$lstqtime[6]=$lstqtime[5];$lstqflood[6]=$lstqflood[5];
            $lstqnick[5]=$lstqnick[4];$lstqtime[5]=$lstqtime[4];$lstqflood[5]=$lstqflood[4];
            $lstqnick[4]=$lstqnick[3];$lstqtime[4]=$lstqtime[3];$lstqflood[4]=$lstqflood[3];
            $lstqnick[3]=$lstqnick[2];$lstqtime[3]=$lstqtime[2];$lstqflood[3]=$lstqflood[2];
            $lstqnick[2]=$lstqnick[1];$lstqtime[2]=$lstqtime[1];$lstqflood[2]=$lstqflood[1];
    }
    $lstqnick[1]=$QUser;$lstqtime[1]=$QTime;$lstqflood[1]=$qfld;
    if(($qfld>$mxfl) or ($Umessage =~ m/no Query/) or ($Umessage =~ m/Query its off/) or ($Umessage =~ m/Pager/)) { return 1 } else {
            IRC::send_raw("PRIVMSG $QUser : $QBMessage\r\n");
            IRC::command("/query $QBLW");
            IRC::print_with_channel("\0032<\cO$QUser\0032>\cO\11$Umessage\n","$QBLW","");
            return 1;
    }
}

For those whom has the original script, here is the patch to bring it up to my unsupported version:

--- QueryManager-1.0.0-En.pl.temp   2011-07-23 20:49:16.071104822 +1000
+++ QueryManager-1.0.1-EN.pl.temp   2011-07-23 20:46:15.541104823 +1000
@@ -1,19 +1,20 @@
     #!/usr/bin/perl
     #
-    # Query-Blocker
+    # Query-Manager
     ###########################################################################
     # Placed in the public domain.
     ###########################################################################
-    # Needs xchat, should work with any version > 1.6.3, tested with 1.6.3; 1.6.6; 1.6.10
-    #
+    # Needs xchat2. This script no longer works with xchat as it has been ported.
+    # Typos has been fixed along with paths specified correctly.
     my $script_name    = "Query-Manager";
-    my $script_version = '1.0.0 En';
-    my $script_Date = '12.2002';
+    my $script_version = '1.0.1 EN';
+    my $script_Date = '06.2011';
     $homedir = $ENV{'HOME'};
     #
     IRC::register($script_name,$script_version, "", "");
     IRC::print("\cC12\cB$script_name\cB Version\cC3 $script_version\cO by \cB\cC4C\cC7obra-x\cO loading...\n");
-    IRC::print "/QMHELP for more information\n";
+    IRC::print "Type: /QMHELP to get started.\n";
+    #
     #
     # Global Variables
     #
@@ -21,19 +22,20 @@
     @lstqnick;
     @lstqtime=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
     @lstqflood=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
-    $stms1="is now \cBaktive.\cO\n";
-    $stms2="is now \cBinaktive.\cO\n";
+    $stms1=": \cBActive.\cO\n";
+    $stms2=": \cBIncktive.\cO\n";
     $qbst="\cC3<\cC4Query-Manager\cC3>\cO\11";
     #
     # Settings for modified
     #
-    $mtfl=20; # Time difference in SEC who say FLood
-    $mxfl=5;  # Maximum Floods in relevant time
+    $mtfl=20; # Time difference in seconds for private message flooder.
+    $mxfl=5;  # Maximum floods in relevant time
     $QBLW="QM-Log"; #Logging Window
     $play_cmd = "play";
-    $play_file = "C:\Program Files\X-Chat 2\plugins\.xchat\notify.wav";
+    # $play_file = "C:\Program Files\X-Chat 2\plugins\.xchat\notify.wav";
+    $play_file = "$homedir/.xchat2/sounds/notify.wav";
     $qmnn_sound = 1; # NickSond Standard = on
-    $QBMessage = "I don't accepting private messages or dialogs at this time. Please talk with me in the public channel. { Automessage }";
+    $QBMessage = "";
     #
     # Handler
     #
@@ -55,12 +57,12 @@
            my $state = shift;
            if (uc $state eq 'ON' ){
                    system("rm -f $homedir/.xchat/.privoff");
-                   IRC::print("$qbst\cC7,0Query Blocker $stms1");
+                   IRC::print("$qbst\cC7,0Query Manager $stms1");
                    return 1;
            } else {
                    if (uc $state eq 'OFF'){
                            system("touch $homedir/.xchat/.privoff");
-                           IRC::print("$qbst\cC7,0Query Blocker $stms2");
+                           IRC::print("$qbst\cC7,0Query Manager $stms2");
                            return 1;
                    }
            }
@@ -70,24 +72,25 @@
     sub qb_flipflop_cmdhandler {
            if(-e "$homedir/.xchat/.privoff") {
                    system("rm -f $homedir/.xchat/.privoff");
-                   IRC::print("$qbst\cC7,0Query Blocker $stms1"); }
+                   IRC::print("$qbst\cC7,0Query Manager $stms1"); }
            else {
                    system("touch $homedir/.xchat/.privoff");
-                   IRC::print("$qbst\cC7,0Query Blocker $stms2"); }
+                   IRC::print("$qbst\cC7,0Query Manager $stms2"); }
            return 1;
     }
     sub qm_status_cmdhandler {
-           if(-e "$homedir/.xchat/.privoff") { IRC::print("$qbst\cC7,0Query-Blocker are\cB inaktive.\n"); }
-           else { IRC::print("$qbst\cC7,0Query-Blocker are\cB aktive.\n");}
-           if ($qmnn_sound){ IRC::print("$qbst\cC7,0Nick Sound Notify are\cB aktive.\n");}
-           else { IRC::print("$qbst\cC7,0Nick Sound Notify are\cB inaktive.\n");}
+           if(-e "$homedir/.xchat/.privoff") {
+            IRC::print("$qbst\cC7,0Query-Manager:\cB Inactive.\n"); }
+           else { IRC::print("$qbst\cC7,0Query-Manager:\cB Active.\n");}
+           if ($qmnn_sound){ IRC::print("$qbst\cC7,0Notify blocked private messages:\cB Active.\n");}
+           else { IRC::print("$qbst\cC7,0Notify blocked private messages:\cB Inactive.\n");}
            return 1;
     }
     sub adduser_cmdhandler {
            # Add user to whitelist
            # Add user (C) 2002 Christopher MacGown
            system("touch C:\Program Files\X-Chat 2\plugins\.xchat\whitelist"); # Ensure whitelist exists
-           open(WHITELIST, ">>$homedir/.xchat/whitelist") || die "Cannot open ~/.xchat/whitelist\n";
+           open(WHITELIST, ">>$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
            print WHITELIST $_[0],"\n";
            close WHITELIST;
            IRC::print("$qbst\cC7,0\cB$_[0]\cB added.\n");
@@ -99,7 +102,7 @@
            # Rem User (C) 2002 Christopher MacGown
            $remove = $_[0];
            chomp($remove);
-           open(WHITELIST, "<$homedir/.xchat/whitelist") || die "Cannot open ~/whitelist\n";
+           open(WHITELIST, "<$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
            @whitelist="";
            while ( defined ($Ruser = )) {
                    chomp($Ruser);
@@ -110,7 +113,7 @@
                    }
            }
            close WHITELIST;
-           open(WHITELIST, ">$homedir/.xchat/whitelist") || die "Cannot open ~/.xchat/whitelist\n";
+           open(WHITELIST, ">$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
            foreach $QUser (@whitelist) {
                    if($QUser eq "" || $QUser eq "\0" || $QUser eq "\n") { ;;
                    } else {
@@ -160,10 +163,10 @@
            return 1;
     }
     sub qbloguserlist_cmdhandler {
-           open(DATA, "$homedir/.xchat/whitelist") || die "can't open whitelist\n";
+           open(DATA, "$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
            @Whitelist="";
            IRC::command("/query $QBLW");
-           IRC::print_with_channel("$qbst\cC7Akzeptierte Nicks.\cO\n","$QBLW","");
+           IRC::print_with_channel("$qbst\cC7Exempted Nicknames:\cO\n","$QBLW","");
            while ( defined ($Ruser = )) {
                    chomp($Ruser);
                    push(@Whitelist,$Ruser);
@@ -172,18 +175,18 @@
            foreach $Wuser (@Whitelist) {
                    IRC::print_with_channel("$Wuser","$QBLW","");
            }
-           IRC::print_with_channel("$qbst\cC7Ende der Liste.\cO\n","$QBLW","");
+           IRC::print_with_channel("$qbst\cC7End of list.\cO\n","$QBLW","");
            return 1;
     }
     sub nicksound_cmdhandler {
            my $state = shift;
            if (uc $state eq 'ON' ){
-                   IRC::print("$qbst\cC7,0Nick Sound Notify $stms1");
+                   IRC::print("$qbst\cC7,0Notify blocked private messages$stms1");
                    $qmnn_sound = 1;
                    return 1;
            } else {
                    if (uc $state eq 'OFF'){
-                           IRC::print("$qbst\cC7,0Nick Sound Notify $stms2");
+                           IRC::print("$qbst\cC7,0Notify blocked private messages$stms2");
                            $qmnn_sound = 0;
                            return 1;
                    }
@@ -192,24 +195,27 @@
            return 1;
     }
     sub qmhelp_cmdhandler {
-           IRC::print("\cC7 -- Query Manager Help --\n\n");
+           IRC::print("\cC7 -- Query Manager Getting started/Help --\n\n");
+        IRC::print("You will need to create either an empty whitelist file or a list of\n");
+        IRC::print("exempted usernames inside your xchat2 directory. For linux it is\n");
+        IRC::print("~/.xchat2/whitelist.\n");
            IRC::print("\cC3 -- Query Blocker --\n");
-           IRC::print("\cB/QB [ON/OFF]\cB shots on or off the Query Blocker.\n");
-           IRC::print("\cB/qbflip\cB flip the Query Blocker on or off.\n");
-           IRC::print("\cB/qmstat\cB shows its Blocker and Nicksound Notify active or not.\n");
-           IRC::print("\cB/qbadduser [nick]\cB will add a user to your Whitelist.\n");
-           IRC::print("\cB/qbremuser [nick]\cB will remove a user from your Whitelist.\n");
-           IRC::print("\cB/qbloglist\cB lists the actual Status in logging.\n");
-           IRC::print("\cB/qbulist\cB shows the list of accepted Nicks / Users.\n\n");
+           IRC::print("\cB/QB [ON/OFF]\cB Turns Query-Manager on or off.\n");
+           IRC::print("\cB/qbflip\cB flip the Query-Manager on or off.\n");
+           IRC::print("\cB/qmstat\cB Shows Query Blocker status.\n");
+           IRC::print("\cB/qbadduser [nickname]\cB Adds a specified nickname to your whitelist.\n");
+           IRC::print("\cB/qbremuser [nickname]\cB Removes a specified nickname from your whitelist.\n");
+           IRC::print("\cB/qbloglist\cB Lists the actual status of logs.\n");
+           IRC::print("\cB/qbulist\cB Shows the list of exempted nicknames.\n\n");
            IRC::print("\cC3 -- Nicksound Notify --\n");
-           IRC::print("\cB/NSN [ON/OFF]\cB shots on or off the Nicksound Notify.\n");
+           IRC::print("\cB/NSN [ON/OFF]\cB Turns Notify blocked private messages on or off.\n");
            return 1;
     }
     sub privmsg_cntl_handler {
            local($line) = @_;
            $MyName = (IRC::get_info(1));
            # check if blocking is turned on or off
-           if(-e "$homedir/.xchat/.privoff"){
+           if(-e "$homedir/.xchat2/.privoff"){
                    NSN(@_);
                    return;
            } else {
@@ -238,11 +244,11 @@
            }
     }
     sub check_whitelist {
-    # For this to work correctly you want to at least touch a file in your homedirectory
-    # touch ~/whitelist   you can populate this file with a single list of usernames
-    # which will then be read and if matched will allow that user to privmsg you as normal.
-    # case isn't important
-           open(DATA, "$homedir/.xchat/whitelist") || die "can't open whitelist\n";
+    # For this to work correctly you want to at least touch a file in your home directory via
+    # touch ~/.xchat2/whitelist. You can then populate this file with a single list of usernames
+    # which will then be read and if matched will exempt that nickname to privmsg you.
+    # Upper or lower case for nicknames isn't important.
+           open(DATA, "$homedir/.xchat2/whitelist") || die "Cannot open ~/.xchat2/whitelist\n";
            @Whitelist="";
            while ( defined ($Ruser = )) {
                    chomp($Ruser);
@@ -298,13 +304,13 @@
                    if($qfld>$mxfl) {
                            if($qfld<$mxfl+2) {
                                    IRC::command("/ignore $QUser!*@* PRIV");
-                                   IRC::send_raw("PRIVMSG $QUser : You Are Ignored by Flood !\n");
-                                   IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4 Ignored by Flood !","$QBLW","");
+                                   IRC::send_raw("PRIVMSG $QUser : Thankyou for attempting to flood, you are now ignored!\n");
+                                   IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4Ignored automatically for flooding","$QBLW","");
                            }
                            if($qfld>($mxfl*2)) {
                                    if($qfld<($mxfl*2+2)) {
-                                           IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4 Kill by Flood !","$QBLW","");
-                                           IRC::command("/Kill $Quser --> Queryflooder");
+                                           IRC::print_with_channel("\cC12<\cO$QUser\cC12>\cO\11\cB\cC4Automatically killing \c0$QUser\cC4for flooding","$QBLW","");
+                                           IRC::command("/kill $Quser --> Queryflooder");
                                    }
                            }
                    }
@@ -341,14 +347,10 @@
                    $lstqnick[2]=$lstqnick[1];$lstqtime[2]=$lstqtime[1];$lstqflood[2]=$lstqflood[1];
            }
            $lstqnick[1]=$QUser;$lstqtime[1]=$QTime;$lstqflood[1]=$qfld;
-           if(($qfld>$mxfl) or ($Umessage =~ m/no Query/) or ($Umessage =~ m/Query its off/) or ($Umessage =~ m/Pager/)) { return 1 } else {
-                   IRC::send_raw("PRIVMSG $QUser : $QBMessage\r\n");
+           if(($qfld>$mxfl) or ($Umessage =~ m/no Query/) or ($Umessage=~m/Query-Manager is off/) or ($Umessage =~ m/Pager/)) { return 1 } else {
+    #              IRC::send_raw("PRIVMSG $QUser : $QBMessage\r\n");
                    IRC::command("/query $QBLW");
                    IRC::print_with_channel("\0032<\cO$QUser\0032>\cO\11$Umessage\n","$QBLW","");
                    return 1;
            }
     }
-    
-    
-    
-

To use the script, you will need to obviously copy the lines a text editor, save it as whatever you wish but note the location of where it is saved. Open up xchat2 and load that script via /load /path/to/script/script.pl.

N.B.: I will not provide support for this script as I do not have much clues as to the inner workings of this script, and by using this script/or the modified script you hereby agree to GNU GPLv2 licensing terms.

[Computers]: Modding the Nokia CA-146C

A fair few users have posted their images of melted Nokia CA-146C after using the said device for charging their Nokia phones. http://www.nokiausers.net/general/n97-charging-warning-beware-of-using-suppli... and http://discussions.europe.nokia.com/t5/Nseries-and-S60-Smartphones/N97-Charge... are such links telling owners to be aware of charger adapter melting on them when used.

Fortunately I have not had to deal with a melted CA-146C however after seeing those aforemented links I will not let the same event happen to me. So I have decided to modify my CA-146C in a bid to prevent the same disaster happening to me. Owners of CA-146C whom has not had their equipment melted may want to take note as this may prevent their charger adapter melting on them.

The modification is very simple, you can make it as complex as you like however I am going to just state the basics to get the job done.

The same usual warning applies:

- I will not be held responsible for any damages, losses, inconvenience, etc, etc, etc for what you follow from this post. By applying the steps mentioned you hereby agree that any loss, burden, etc, etc, etc will be borne by yourself.

- Modifying your CA-146C will void your warranty and I have noticed that one may hear an audible high pitched noise when the charger adapter is used in the usual manner.

Now, for starters one will need the following:

- The blade of stanley knife (A knife or a flathead screwdriver may suffice however the blade of stanley knife is ideal).

- A screwdriver (use an old one if you do happen to own one as it will only be used for tapping the blade of stanley knife).

- A drill.

- The smallest drill bit you can find (in my case I used a 1.9mm drill bit).

- A bench vice (or something equivalent to bench vice to hold the charger adapter in place whilst you break open).

- Superglue (or sticky tape if you do not care about the looks :)).

 

If you happen to have somewhat unsteady hands (like I do), it is a good idea to wedge the charger adapter to bench vice (or equivalent). Using the sharp edge of the blade from a stanley knife with the handle from the screwdriver, start tapping on the side of the CA-146C case. You need to align the blade from the stanley knife with the side of the CA-146C case where you see the indent. It is best to first tap out from the edges of the indent first before tapping on the middle part of the case.

Once you see the indent widening, pry it slowly (do not use excessive force). If the case does not open, repeat the process above but on the reverse side of the case.

The case can be easily opened when both sides of the case have wider cracks. When the case is opened you will be able to see the two small charger heads (2mm and 3mm respectively) on the plastic case (with Nokia logo) that you pull out from and on the other piece is where you see the device with the PCB board.

With the case for just the small charger heads, place that plastic case (Nokia logo facing up) on the table or in between the bench vice. Start drilling some holes around the plastic case but do not drill holes behind the Nokia logo as you will notably damage your small charger heads!. It is ideal to drill holes above and below the Nokia logo (Only two holes near the letters NO and KI).

After drilling the required holes, join the case with the rest of the device together. Use superglue to glue the cracks together or if you only have sticky tape like I did, close the case up and place the sticky tape close to the rear end of the case (where it is closer to those two small charger heads). Try not to block those newly created ventilation holes as it will defeat the purpose of having to modify the device in the first place!.

Now with a modified CA-146C that has ventilation holes, it will not be as easy for the device to melt the plastic as it would before. It may look ugly and less water resistant but at least you would not suffer the same fate as those who left their charger adapater as stock!.

[computers]: Freeing up some more space on N900.

One of the persisting issues with N900 (as with many other minor nuisances of owning one in the first place) is the lack of free space on the rootfs. Evidently when PR1.3 came around, it was literally a godsend to those of us who has a fair amount of programs installed on their N900. Though it the fix isn’t a complete one as one would have thought.

The fact is, is that even though most programs are now using the /opt space which is sharing the same storage space as /home (2GB partition) one still shouldn’t have too many programs installed as 2GB can be filled up somewhat easily. Of course there is a fix for that as well which would be to repartition the EMMC (29GB partition) space and that is an area I won’t go into detail about (those of you keen on it, there’s a t.m.o thread on it). Then again the rootfs can still be filled up with one for instance installing loads of applications that either hasn’t been `optified' (to store stuff in /opt rather than in /) or installed something like mandb (manual database).

So what can you do about it? lbthomson has wrote a blog entry awhile back on two other places that can be relocated without bricking the device. Those of you who aren’t aware, relocating N900’s root directories (i.e. /opt, /usr, /etc, /var, etc) to some other partition without caution can easily brick N900 (thereby forcing the need to reflash or restore previous image if one used robbiethe1st’s backupmenu). Unfortunately at the time of lbthomson’s entry, it was when PR1.2 was still around and that `optification' was a mere addon rather than integral part of maemo base. Now with PR1.3, one of his mentioned location is no longer really valid unless you heavily use apt-get, use fapman (faster applications manager), or even aptitude.

Those of you who happens to heavily use apt-man, fapman, aptitude (like I do). I have a somewhat better solution for you :) instead of sharing space with /opt (and inevitably /home) you can have the downloaded debs be placed into EMMC instead. To have whatever apt-get downloads be stored into /home/user/MyDocs/.apt-archive-cache, one needs to append this into their /etc/apt/apt.conf.d:

/00maemo: dir::cache::archives "/home/user/MyDocs/.apt-archive-cache";

As for the second location of where things can be relocated. I have made a nice little script just for the task. You will need to save this into a file, make the file executable and execute it as root:

#!/bin/ash
# Optify dpkg database (directory that dpkg and apt-* tools uses)
# Version 0.1
# Written by tuxsavvy (http://eidolon-sapphire.posterous.com/)
# Inspiration came from lbthomson's blog (http://maemo-experience.blogspot.com/2010/02/free-up-space-on-rootfs.html)
# Script is licensed under GPL v2

# First we must check to see if the user is running the script as root,
# which is mandatory.
if [ "$(whoami)" != 'root' ]; then
    echo "Error: You must run this script as root."
    exit 1;
fi
# We will need to create the directory /opt/var/lib/dpkg otherwise we will
# need to recreate the one in /var/lib later on.
echo "Creating directory /opt/var/lib/dpkg"
mkdir /opt/var/lib/dpkg
# We move /var/lib/dpkg to /opt/var/lib/dpkg now that PR1.3 has
# optified a fair few things. Furthermore it will be neater that way.
echo "Moving the contents of /var/lib/dpkg to /opt/var/lib/dpkg"
mv /var/lib/dpkg/* /opt/var/lib/dpkg
# For every directory there was in /var/lib/dpkg we will need to recreate
# those.
echo "Recreating directories in /var/lib/dpkg"
for i in `find /opt/var/lib/dpkg -type d| awk '{ FS="/"; print $6 }'| tail -5`; do
    mkdir /var/lib/dpkg/$i;
done
# We will now symlink individual files from /opt/var/lib/dpkg/alternatives
# to /var/lib/dpkg/alternatives/
echo "Creating shortcuts for each individual files in alternatives"
for i in `find /opt/var/lib/dpkg/alternatives -maxdepth 1 -type f| awk '{ FS="/"; print $7 }'`; do
    ln -s /opt/var/lib/dpkg/alternatives/$i /var/lib/dpkg/alternatives/$i;
done
# We will now symlink individual files from /opt/var/lib/dpkg/info
# to /var/lib/dpkg/info/
echo "Creating shortcuts for each individual files in info"
echo "This may take awhile ..."
for i in `find /opt/var/lib/dpkg/info -maxdepth 1 -type f| awk '{ FS="/"; print $7 }'`; do
    ln -s /opt/var/lib/dpkg/info/$i /var/lib/dpkg/info/$i;
done
# We will now symlink individual files from /opt/var/lib/dpkg/parts
# to /var/lib/dpkg/parts/
echo "Creating shortcuts for each individual files in parts"
for i in `find /opt/var/lib/dpkg/parts -maxdepth 1 -type f| awk '{ FS="/"; print $7 }'`; do
    ln -s /opt/var/lib/dpkg/parts/$i /var/lib/dpkg/parts/$i;
done
# We will now symlink individual files from /opt/var/lib/dpkg/triggers
# to /var/lib/dpkg/triggers/
echo "Creating shortcuts for each individual files in triggers"
for i in `find /opt/var/lib/dpkg/triggers -maxdepth 1 -type f| awk '{ FS="/"; print $7 }'`; do
    ln -s /opt/var/lib/dpkg/triggers/$i /var/lib/dpkg/triggers/$i;
done
# We will now symlink individual files from /opt/var/lib/dpkg/updates
# to /var/lib/dpkg/updates/
echo "Creating shortcuts for each individual files in updates"
for i in `find /opt/var/lib/dpkg/updates -maxdepth 1 -type f| awk '{ FS="/"; print $7 }'`; do
    ln -s /opt/var/lib/dpkg/updates/$i /var/lib/dpkg/updates/$i;
done
# We will now move the /opt/var/lib/dpkg/lock file into /var/lib/dpkg as
# apt-get will not work for instance with a symlinked lock file.
echo "Moving /opt/var/lib/dpkg/lock to /var/lib/dpkg/lock"
mv /opt/var/lib/dpkg/lock /var/lib/dpkg/lock
# That's it! we're done :)
echo "Done"

P.S.: If any of you were curious as to why on that other author’s blog entry I used a different handle and if it was really me. Let me assure you it was :)

[Computers]: Activity manager [extras-devel] patch.

A moment ago I’ve posted this patch up on the talk.maemo.org thread for actman. The patch has the following implementations:

  • Include qload functionality (quick load, only for developers as you may lose shortcuts on your hildon-home.)
  • Fixed up some typos (not really important if anything
  • Decorated list when the user runs activity script from terminal, the command now is activity clist rather than activity list as that is what the GUI uses.
  • Makes sure the user is not root when trying to list the activities in command line.
  • Improper command will no longer say Bad command:, instead it will now print the help menu.
  • Bumped the minor version to 1.1.1

This patch is not compatible with the previous patches noted on my blog. You are forewarned.

--- /usr/bin/activity.orig  2011-05-29 17:10:04.000000000 +1000
+++ /usr/bin/activity   2011-07-03 16:25:09.000000000 +1000
@@ -20,7 +20,7 @@
 #
 # $Id: 0.py 2265 2010-02-21 19:16:26Z v13 $

-VERSION="1.1"
+VERSION="1.1.1"

 D0="$HOME/.activities"

@@ -312,7 +312,7 @@
        cat << _KOKO
 Pass the activity name to save the current configuration to.
 The "current" activity will be also set to be that activity.
-If it doesn't exist it will be created.
+If it does not exist it will be created.
 _KOKO
        exit 1
    fi
@@ -333,7 +333,7 @@
 {
    if [ -z "$1" ] ; then
        cat << _KOKO
-Pass the new activity as the first argument. If it doesn't exist it will
+Pass the new activity as the first argument. If it does not exist it will
 be created.
 _KOKO
        exit 1
@@ -356,7 +356,35 @@

 do_list()
 {
+if [ "$(whoami)" = 'root' ]; then
+        echo "You should not run this as root."
+        exit 1;
+fi
+   (
+   FOUND=0
+   cd $DSTDIR0
+   for i in * ; do
+       if [ -d "$i" ] ; then
+           echo "$i"
+           FOUND=1
+       fi
+   done
+   # If there is no activity, return the default as if it existed
+   if [ "$FOUND" = "0" ] ; then
+       echo "$DEFAULTACTIVITY"
+   fi
+   )
+}
+
+do_clist()
+{
+if [ "$(whoami)" = 'root' ]; then
+        echo "You should not run this as root."
+        exit 1;
+fi
    (
+   echo "List of stored activities:"
+   echo "========================================================="
    FOUND=0
    cd $DSTDIR0
    for i in * ; do
@@ -365,6 +393,8 @@
            FOUND=1
        fi
    done
+   echo "========================================================="
+   echo "Current activity: `cat $D0/$DSTDIR0/current`"
    # If there is no activity, return the default as if it existed
    if [ "$FOUND" = "0" ] ; then
        echo "$DEFAULTACTIVITY"
@@ -434,13 +464,13 @@
    if [ -z "$1" ] || [ -z "$2" ] ; then
        cat << _KOKO
 Pass the source and destination name as first and second parameter
-repsectively.
+respectively.
 _KOKO
        exit 1
    fi

    if ! check_exist "$1" ; then
-       echo "Activity $1 doesn't exist"
+       echo "Activity $1 does not exist"
        exit 1
    fi

@@ -490,7 +520,7 @@
    check_exist_error "$ACT"

    if ! [ "x$1" = "x-f" ] ; then
-       read -p "Are you sure? (type yes to continue) " ans
+       read -p "Are you sure? (type "yes" to continue) " ans
        if ! [ "$ans" = "yes" ] ; then
            echo "Aborted"
            return
@@ -525,6 +555,27 @@
    restore2 "$CURRENT"
 }

+do_qload()
+{
+   if [ -z "$1" ] ; then
+       cat << _KOKO
+Pass the new activity as the first argument.
+_KOKO
+       exit 1
+   fi
+   if [ "x$1" = "x-f" ] ; then
+       ACT="$2"
+   else
+       ACT="$1"
+   fi
+   
+   check_exist_error "$1"
+
+   echo "Loading "$1" activity without saving changes"
+   
+   restore2 "$ACT"
+}
+
 do_runstart()
 {
    if [ "x$1" = "x" ] ; then
@@ -562,10 +613,12 @@
   create ACTIVITY  Create a new (empty) activity.
   current      Print the current activity name.
   delete [-f] ACTIVITY Same as remove.
-  help         This help.
-  list         List available activities.
+  help         This help screen.
+  clist            List available activities.
   load [-f] SRC        Load activity SRC. If -f is used then it will be
            allowed to re-load the current activity.
+  qload    SRC     Quickly loads the activity without saving any
+           changes to the previous activity. (devs only)
   new ACTIVITY     Same as create.
   reload       Reload current activity without storing first.
   remove [-f] ACTIVITY Remove activity ACTIVITY. If -f is used then there
@@ -593,6 +646,9 @@
        # Just load
        do_load "$2" "$3"
        ;;
+   qload)
+       do_qload "$2" "$3"
+       ;;
    change)
        # Save the current and load the next
        do_change "$2"
@@ -600,6 +656,9 @@
    list)
        do_list
        ;;
+   clist)
+       do_clist
+       ;;
    current)
        do_current
        ;;
@@ -631,7 +690,7 @@
        do_version
        ;;
    *)
-       echo "Bad command: $1"
+       do_help
        ;;
 esac

Any of you whom have used my previous patch on actman needs to realise that there’s several flaws with the patch I’ve made, such as the fact that it littered the views.dump file along with gconf with extra bg-images. For starters the extra entries needs to be deleted and that needs to be applied for every affected desktop activity.

I will not condone the use of my previous patch (like I have already mentioned) nor will I condone the use of this one. The 9 desktop already works well without having to implement any extra lines to the code to make it work.

[computers]: N9? N950?

A few days ago there's some interesting bits of news floating around about N9 being the last meego device Nokia will officially produce. However the N9's specifications does show that it is crippled hardware-wise compared to its full fledged predecessor, the N900.

There are a few things going for the N9 against N900:

+ 1GHz TI-ARM processor (OMAP3650)

+ Capacitative touchscreen with 3.9" in size.

+ 802.11b/g/n wireless (some sources indicate 802.11a/b/g/n capability)

+ 1GB RAM

+ up to 64GB internal storage

+ NFC (Near Field Communication): However not to be used for making payments via swiping, its used for other things.

+ 8MP Dual-LED flash camera

+ 1430MAh battery

The reason why I say its crippled is this (what N9 basically lacks):

- A hardware keyboard!

- Interchangable batteries

- No microSD card support (that means if you bought N900 and bought a 32GB class 10 microSD card, you'd be the same level in approximate terms as N9)

- FM transmitter (this is why N900 was so cool, it prevented one from having to buy a separate device to make N900 output music to FM player)

Sure enough one may tally up all the pros and cons and still see N9 has more pros than cons but what I couldn't stand are the four negative things which N9 basically lacks.

So... what does one do in such cases like this? behold the N950, a developer device which is not for sale to consumers (sadly). What the N950 has over N9 is a hardware keyboard and supposedly a FM transmitter, though what N950 doesn't have are things like NFC which N9 has and there's no wording on how much internal storage will the N950 have.

The other problem with N950 is that its only available as a loan device, to add fuel to the flame is that because there are only 250 units manufactured you will need to produce a good reason as to why you want one and how you will contribute (in terms of giving support such as programming and what not) to Meego development. Therefore if you wanted a N950 you should hurry up as the applications close on the 28th of June 2011 (!).

As for me, I've submitted my application not long ago. Though I may not have much going for me in terms of being able to help out in programming but I'm willing to help out in other ways where possible (thus I really want a N950!). Hopefully I'll hear some good news that I'll be receiving one for testing and loaned purposes!.

Before I forget I should provide some links for interested parties of N950, though I must stress that you must hurry before you may end up regretting:

https://meego.com/community/device-program/devices/nokia-n9-devkit

http://forum.meego.com/showthread.php?t=3597

http://www.developer.nokia.com/Community/Discussion/showthread.php?225798-N95...

http://wiki.meego.com/Community_Office/Community_device_program/Nokia

Sony should die...

It has gotten to the point of rediculous-ness with Sony and their rage tactics against community, a community in which they created and now they are killing it. Today, a hacker who tried to restore a missing functionality in which Sony disabled it is sued to bankrupcy after another hacker pointed out the loophole. The disabled functionality was what sold the product off initially to the Linux community, its OtherOS support.

Woe, woe, woe, you may wonder why a hate blog post all of the sudden. Lets trace back to the origins of Sony's lack of tact. Lets trace back to the early 80s when there was the good old betamax versus VHS tapes war. Sony had these betamax days which were superior to VHS in terms of quality and what not as wikipedia states: http://en.wikipedia.org/wiki/Betamax#The_legacy_of_Betamax (paragraph 4 of that link). However it was largely due to Sony's demise that they were the only sole manufacturer or such products meant that they had literally absolute control. It was their stubbornness lead to the downfall of betamax days after VHS won the format war due to cheap pricing and had more competitors. Owners of betamax cannot simply use VHS tapes, nor vice-versa without a machine capable of playing such tapes.

Later on in the 90's or so when MiniDiscs came out, these were Sony's Minidiscs which were popular mostly in SE Asia countries (as most things manufactured from that region were). These devices were smaller and more compact than your average audio tapes back then. However Sony's lack of tact and their affinity with anti-copyright schemes fell into place when their recorders came about. Though initially it was a miniscule effect that one cannot for instance record audio from something that is outputted from an optical cable but could only have it outputted through the usual headphone/speaker jack (unless of course one purchases expensive Minidisc deck). The seriousness of this matter worsened when NetMD were introduced. NetMD allowed Minidisc recorders (mostly compact/portable forms) to be able to hook up to computer and allow the user/owner to record music straight from computer to MD at a blazing 24x speed. What the user/owner wouldn't know until later on is that by using OpenMG (Sony's proprietary music player/MD checkout tool), music were dubbed using such methods cannot be transferred back if one for instance reinstalled their OS on their computer. This was Sony's SCMS (Serial Copy Management System) that prohibited their recorded discs be used as a medium for exchanging music, notably this was rather effective as a stopgap for those who exchanged betamax tapes back or anyone whom used audiotapes, VHS or whatever other common media there was to exchange copyrighted material. However contrary to that the same sort of effect, it affected legitimate users who backed up their data onto such mediums and later found out that they could not transfer the music back at a blazing speed (only to find out that their tracks get removed if they tried to re-inport). Such prompted war and hatred against Sony for being a nazi over anti-copyright. [Source: http://www.minidisc.org/NetMD_faq.html#_q82]

Then in 2005 or so, Sony's audio CD contains a software which actually prevents copying of data. However that was quickly dubbed as a rootkit due to the way it was written. Aboveall it was thus most biggest run in with the consumers that Sony released such a software to be maliciously installed on their consumers computer that had the people annoyed with how Sony dealt with it. Sony was constantly reluctant to address the issue properly until almost a year later was when they finally began to open up a little insight on the audio CDs that had such software. [Source: http://en.wikipedia.org/wiki/Sony_BMG_copy_protection_rootkit_scandal]

Now, with Sony's PS3 they released the PS3 originally with OtherOS support, a hacker found a loophole and kindly informed PS3's loophole existed in OtherOS support. Sony decides to make that functionality hidden, which angered the Linux community due to the fact that they bought the device was not to only play games, surf the web and what not but to also run Linux. Sony says "Tough luck, don't upgrade your firmware or play online games if you want OtherOS capability." Now this is very much the case of where a person attacks a beehive, a bee colony where bees will attack if their base was destroyed. This was where lots of other hackers decided to hack open PS3 in ways to get what they wanted back, however along the way they have found various loopholes which Sony constantly tried to patch up. In the end Sony was left with rage, attacks hackers for "maliciously" sabotaging their equipment. They've sued GeoHotz which stirred up a DDoS attack on the PSN (PlayStation Network) followed by a compromise of users' accounts on PSN. Recently they sued Graf_Chokolo for trying to restore OtherOS functionality on his PS3. Talk about being sadistic Sony, you really are one hell of a piece of work, suing an individual for trying to make the best use of his device which he bought off you to bankrupcy.

I hope nobody else would buy a Sony product that is capable of either storing or recording data to its product like I am, or better yet avoid Sony altogether. They're one hell of an organisation that just doesn't understand its love for DRM is killing its own brand.

 

Inspirations for this blog article came from: http://tiny.catpa.ws/2011/06/24/sony-are-arseholes/

Needless to say that this is not an exact mirror of that blog content, nor is the author relaying hatred towards Sony without ever being affected by Sony (I am an onwer of Sony's NetMD MZ-N1 which I have yet to see all my music being re-liberated from a proprietary format that Sony has been stubborn to give up on). Also I myself wish to inform the potential readers to be aware of the excessive profanity used on the aforemented link :) I am in no ways directly related to the author nor will I be liable for any losses caused upon one reading the link.

Update 03/04/2011: Looks like Sony is getting its dose of annoying people off over the years. You reap what you sow Sony: http://attrition.org/security/rant/sony_aka_sownage.html

[Computers] Actman patch: updated, cleaned up slightly

I now have an updated patch for the Actman. This is by far an improvement compared to the previous one as it is now cleaner and qload function actually works.

There still needs to be a way to place all the background images into the Actman’s directory so that one does not necessarily need to create extra directories as per each defined activity and have those background images placed in each of those extra directories under multi_desktops.

If you have are unsure of this updated patch, I suggest you to read my previous blog entry: http://eidolon-sapphire.posterous.com/computers-actman-patch-changing-backgro...

The new patch:

--- activity.old    2010-04-14 10:07:23.000000000 +1000
+++ activity    2011-03-19 17:44:09.000000000 +1000
@@ -156,7 +156,15 @@
    echo -n "."
    gconftool-2 -s --type list --list-type string \
        "$CONTACTS" "[]"
-
+   # Ugly hack for unsetting background images which may stick during 
+   # restore2 function leaving either previous desktop activity 
+   # backgrounds or random desktop activity backgrounds as new/current 
+   # desktop activity backgrounds.
+   # for i in 1 2 3 4 5 6 7 8 9
+   # do gconftool -u /apps/osso/hildon-desktop/views/$i/bg-image
+   # echo -n "."
+   # done
+   gconftool -u /apps/osso/hildon-desktop/views
    # Don't remove thumbnails. Let hildon do it.
    # It is required in order to keep old thumbnails when switching to
    # a new activity or when upgrading to the first version that backs-up
@@ -241,13 +249,48 @@
    echo -n "."

    gconftool-2 --load $SRCDIR/views.dump
-
+   
    echo -n "."
+   # hack test for modified desktop
+   rm -f /home/user/.backgrounds/*
+   cp /home/user/multi_backgrounds/$1/*.png /home/user/.backgrounds/
+   cp /home/user/multi_backgrounds/$1/cache.info /home/user/.backgrounds/
+   gconftool -s /apps/osso/hildon-desktop/views/active -t list --list-type int [1,2,3,4,5,6,7,8,9]
+   for i in 1 2 3 4 5 6 7 8 9
+   do gconftool -s /apps/osso/hildon-desktop/views/$1/bg-image -t string /home/user/.backgrounds/background-$i.png
+   gconftool -s /apps/osso/hildon-desktop/views/active -t list --list-type int [1,2,3,4,5,6,7,8,9]
+   sleep 5
+   echo -n "."
+   done
+   # We should also set the same background from the first chosen home screen image as background to the lock slider image.
+   sudo rm -f /usr/share/themes/default/backgrounds/lockslider.png
+   sudo ln -s /home/user/multi_backgrounds/$1/background-1.png /usr/share/themes/default/backgrounds/lockslider.png
    set_current $1

    echo
 }

+qload()
+{
+   
+   if [ -z "$1" ] ; then
+       cat << _KOKO
+Pass the new activity as the first argument.
+_KOKO
+       exit 1
+   fi
+
+   if [ "x$1" = "x-f" ] ; then
+       ACT="$2"
+   else
+       ACT="$1"
+   fi
+
+   echo "Switching to activity: $ACT"
+
+   restore2 "$ACT"
+}
+
 # Store the current activity to "$1"
 do_store()
 {
@@ -500,9 +543,13 @@
        # Just load
        do_load "$2" "$3"
        ;;
+   qload)
+       # Just load
+       qload "$2" "$3"
+       ;;
    change)
-       # Save the current and load the next
-       do_change "$2"
+   # Save the current and load the next
+   do_change "$2"
        ;;
    list)
        do_list