Pages

MySQL 4.0 Fulltext search

Now FindyPages.com has added the fulltext search features for searching pages. It creates a better search results on page keywords, page description, page name and page url.

However, as far as I can tell that MySQL 4.0 is having some restriction on the fulltext search.

Restrictions

A few restrictions affect MySQL FULLTEXT indices. Some of the default behaviors of these restrictions can be changed in your my.cnf or using the SET command.

  • FULLTEXT indices are NOT supported in InnoDB tables.
  • MySQL requires that you have at least three rows of data in your result set before it will return any results.
  • By default, if a search term appears in more than 50% of the rows then MySQL will not return any results.
  • By default, your search query must be at least four characters long and may not exceed 254 characters.
  • MySQL has a default stopwords file that has a list of common words (i.e., the, that, has) which are not returned in your search. In other words, searching for the will return zero rows.
  • According to MySQL's manual, the argument to AGAINST() must be a constant string. In other words, you cannot search for values returned within the query.

select count(members_pages.pageid) as record_count
from members
inner join members_pages on members.memberid = members_pages.memberid
where members.status_access = 1
and members_pages.status_access = 1
and members_pages.status_viewable_by = 1
and (
MATCH(members_pages.page_name, members_pages.page_keywords, members_pages.page_desc, members_pages.page_url) AGAINST ('" . trim(strtolower(addslashes($keywords))) . "' IN BOOLEAN MODE)
or lower(members_pages.page_url) like '%" . trim(strtolower(addslashes($keywords))) . "%')";

Extend Expired TrendMicro Internet Security license

These instruction will guide you to extend expired TrendMicro Internet Security 2005 License.
  • Stop TrendMicro
  • Go to the folder on C: drive the software is installed.
  • Go to "Internet Security" Folder and rename the following files.pcclient.exe ->
    • pcclient.exe -> pcclient.exe.BK_
    • pc-cillin.ini -> pc-cillin.ini.BK_
    • result.htm.tag -> result.htm.tag.BK_
    • result.htm -> restul.htm.BK_
  • Copy pcclient.exe and pc-cillin.ini from the licensed pc to the new pc.
  • Restart TrendMicro
  • Check if the license is update
  • Click "Update Component" to download the new updates.

"You've opened a new tab" annoyance on IE7

It's annoying to see the following page everytime I open a new tab window on IE7. Even after I check the "Don't show this page again" checkbox, it is still opening a new tab with this annoying "You've opened a new tab" tab.

How do I turn this off to just show my blank home page?

Open the registry by going to Start -> Run -> Type regedit
Look for the following registry
HKEY_CURRENT_USER \Software\Microsoft\Internet Explorer\TabbedBrowsing
TabBrowsing

Right click on the right window and open a new DWORD value.
TabbedBrowsing

Give the name "ShowTabsWelcome", and right click to modify the value. Make sure is shows 0.


Now open a new tab in IE7, the annoying "You've opened a new tab" page is gone!

Annoying Runonce.msn.com start page in IE7

Recently, I did a spyware scan on my laptop, but found few annoying ActiveX Controls running under IE7. So I change the security setting in IE7 to stop most of the ActiveX Controls. However, I restart the IE7 browser and getting the annoying "Customize Your Settings" home page every time. Even I change the default home page to "about:blank", it still starts with the "RoundOnce" page from http://rononce.man.com/runonce2.aspx.


I have no idea what this page does, but I believe that Microsoft is trying to guide the IE7 user to setup their IE7 and download new add-on from an non-Microsoft web sites. That looks weird!

Solutions:
After digging into the registry for IE7 and found a place to turn off the Runonce.msn.com start-up page. Basically, it requires two registry key to do the magic.

Open Regedit and go to the following section.
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
Look for the following two keys.
RunOnceComplete
RunOnceHasShown

if they do not exist. Add them by right click mouse -> New -> DWORD Value as shown in the image below.


Modify the value and set the value to 1 for both DWORD values as the images below.


Restart your IE7 browser. The annoying Runonce page is gone!

Remove unwanted startup program under msconfig

Once a while, there are unwanted startuup items in MSConfig that need to be disabled or removed. For example, the Quick Button service (EabServr).

Open MSConfig, under the StartUp tab, I can see an entry of the EabServr is disabled. I would like to remove it totally from the registry.

If you look at the location of the entry, it says "SOFTWARE/....." It's actually under the registry under the following path.
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\MSCOnfig\Startupreg

As seen here.

It's simpliy just right click on the key "eabconfg.cpl", and choose to delete the entry.

MSSQL-PHP-ADODB Issues

MSSQL-PHP-ADODB Issues
  • MSSQL only support FETCH_MODE_ASSOC
  • $rs->EOF cause unlimited loop
  • Only the first select statement in the procedure are returned as query object
  • the rest of query are return as true array
  • You can only fetchRow once
  • text, ntext, image fields can not be local variables
  • index on datetime will not be used if date range is in the query select statement

The following features are not working in the linked server env.
  • @@IDENTITY insert won't return at all
  • SET ROWCOUNT 500 for insert/update/select
  • Need to use SET XACT_ABORT ON to be able to write to the linked server

PHP + ADODB + IIS + MSSQL + Windows Authentication

These is my technical notes on how to make PHP connect to MSSQL using Windows Authentication, if PHP(IIS) and MSSQL are running on separate servers.

Environment:
PHP4 + PHP Adodb + IIS + MSSQL

In normal case, using PHP Adodb library do not allow you to user windows authentication to access MSSQL runing on the server or other server. To use the windows authentication in PHP to access MSSQL server, you will need to tweak the IIS configuration and the PHP connection string.

IIS configuration
- Open IIS Manager
- Right click on the web site running the PHP script.
- Choose Properties and go to Directory Security tab
- Click Edit on Anonymous access and authentication control
- Change the Anonymous access user name and password to the desired domain username and password
- Uncheck the "Allow IIS to control password
- Make sure the domain user has rights to access desired database on the MSSQL server

PHP Script
Useing the following connection string when connect to MSSQL with PHPAdodb library
$myDSN="PROVIDER=SQLOLEDB;DRIVER={SQL Server};SERVER=[MSSQL Server Name];DATABASE=[Database Name];Integrated Security=SSPI";

Notes:
As you can see, the doman user will need to have rights to access both servers. The user will also need to have rights to execute PHP.EXE and read(and possible write) access to the PHP script folders. Basically, the domain user will need to have everything IUSR_[server_name] user has.

I have not had chance to test this. Please use it at your own risk.

Reference:
Authentication methods for connections to SQL Server in Active Server Pages

MySQL Command

REM ############################
REM # Mysql restore
REM ############################
mysql -uroot -p nqueue < D:\nqueue_backup\dump.sql

Useful DOS command

REM ##############################
REM # Net Utilities Dos Command
REM ##############################
nbtstat - check network name status

REM ####################
REM # Kill process
REM ####################
tskill PID

DOS: loop

@ECHO OFF
set counter=1
set second=10
set minute=%second% / 60
set /A stopper=1000*%second%
echo Delay ... %second% second(s)

:loop
set /A counter=%counter%+1


if %counter% EQU %stopper% GOTO OK
GOTO loop


:OK
REM Put the command below
MOVE file1.txt file2.txt

DOS: if exist

@echo off

REM #######################
REM # Set Object Value
REM #######################

SET filename=D:\temp\test.bat
SET RETURN_MSG=

REM #######################
REM # Check object exist
REM #######################

if exist %filename% goto FOUND
SET RETURN_MSG=MESSAGE: Object not found
goto NOTFOUDN


:FOUND
SET RETURN_MSG=MESSAGE: Object found
echo %RETURN_MSG%
goto EXITOUT

:NOTFOUDN
echo %RETURN_MSG%
goto EXITOUT


:EXITOUT

How to bypass windows Genuine Ad

How to bypass windows Genuine Ad

How to bypass windows Genuine Advantage Check on Windows XP

Procedure...

It took basically 5 minutes to figure out how to bypass this check. However, Microsoft can change his server part of the check in order to block this.

Here's the procedure as it works (28 July 2005)

1. Block the ActiveX execution.

2. Choose the alternate method and download the GenuineCheck.exe

3. Right-click this executable and go the compatibilty tab

4. Set the compatibily mode to Windows 2000

5. Run GenuineCheck.exe

6. Paste the code returned in the Browser.

7. off you go...

Microsoft "Genuine Advantage" cracked in 24h:

http://www.boingboing.net/2005/07/28/microsoft_genuine_ad.html

window.g_sDisableWGACheck='all'
AV sez, "This week, Microsoft started requiring users to verifiy their serial number before using Windows Update. This effort to force users to either buy XP or tell them where you got the illegal copy is called 'Genuine Advantage.' It was cracked within 24 hours."
Before pressing 'Custom' or 'Express' buttons paste this text to the address bar and press enter:

javascript:void(window.g_sDisableWGACheck='all')

It turns off the trigger for the key check.

IIS 401.1 error or The parameter is incorrect on Windows 2003 SP1

If you are installing the nQplatform on the Windows 2003 SP1 with IIS6. You might be running into the following situation. Depends on the firm's security policy, the network administrator may lock down the IIS. This means the IUSR_COMPUTERNAME will not be able to view the web page.

Symptom:
Open IE browser on the same server and type http://localhost/nqueue or http://[server_name]/nqueue. If you are getting "The parameter is incorrect" or the attached error screen (401.1) error, it means the authentication to access the page for IUSR_COMPUTERNAME is out sync.

Please see the IIS_Config.PHP. If you see the IUSR_ field with no checkbox saying "Allow IIS to control password", it means the IUSR_ password is manually entered. It also means the password is out sync with the password created at system level.

Solution 1:
Ask firm's network administrator to re-boot machine and make sure the password is synced.

Solution 2:
1. Reset the password under Control Panel->Administrative Tool->Computer Management->User and Group for IUSR_
2. Reset the password under IIS->Default Web Site->Properties->Directory Security->Edit
3. Restart IIS web services

32bit program on Windows 2003 64bit issues

Possible work around for running PHP as CGI (or ISAPI) on Windows 2003 SP1 64bit.

Source:

Installing PHP 4 or 5 on Windows Server 2003 x64 results in http error 505. This is not a PHP bug. It is due to running a 32-bit ISAPI DLL under the 64-bit version of IIS 6, as documented here: http://support.microsoft.com/?id=895976

Solution: Flip the Metabase flag for Enable32bitAppOnWin64 as described in http://support.microsoft.com/?id=894435 ,
like this: CSCRIPT ADSUTIL.VBS SET W3SVC/AppPools/Enable32bitAppOnWin64 1

(Alternatively with full path: cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1)

MySQL Tips

Write output into a file
Login into mysql

mysql> \T D:\temp\innodb_status.txt
Logging to file 'D:\temp\innodb_status.txt'
mysql> show innodb status
mysql> \t
Outfile diabled