Sunday 2 May 2010

PHP file_exists function bug and Domain Migration

First of all, no, this is not a Bug report. Just a friendly title to someone who might be asking themselves the same thing.

The other day i was reported that our Intranet website was not working properly. I looked at the PHP code to see if everything was in order and runned a few tests with variable placing inside the file_exists and the function was returning false when the file actually existed. Why is this i asked?! Eventually i found out, there was no bug or change in the code.

We had at our corporate environment migrated the domain and Intranet was running smoothly for 2 weeks. At the end of the 2 weeks the old domain was shutdown. Only by the third day this Intranet communication came to me, but the answer was that in the IIS manager for the Intranet Server, whe still had issues with the "Directory Security", pointing to a user from the old domain.

The file_exists was trying to access the path with a user that was no longer valid, returning false on the function as it had no permissions.

Voilá
Hope it helps


Taken from: http://bitboard.blogspot.com/

PostgreSQL "Export to file"

How to export Postgres query results to a CSV file:

1 - Press SQL Editor Icon
2 - Make query
3 - From the SQL Editor Icon, File -> Export


Taken from: http://bitboard.blogspot.com/

Can't add ODBC entry

The answer for this is simple, the tool to manage ODBC entry's on Windows is ODBCAD32.exe

If you can't add an entry on the SYSTEM DSN tab the first thing you need to remember is that you have to run the tool with administrative provilidges to be able to add entrys in this tab. Otherwise the only tab you will have permissions to add entry's to will be the USER DSN.

This obviously is because the tool needs to change registry key's and the SYSTEM DSN is in the Machine Scope wether the USER DSN is in the USER scope.

To run the tool odbcad32 with admin privilidges without logging off that current user's account you can do the following at the command line:

C:\> runas /U:domain\adminuser odbcad32.exe
and enter password



Taken from: http://bitboard.blogspot.com/

10 Steps to totally and completely Remove Panda Anti Virus Protection Service from Computer or Server

I decided to add this here first so i won't forget, second so that anyone experiencing the same issue and is tired of looking for the web with no success on this, can apply the procedure i tell you here, and move on to be productive.

Well, how to fully remove Panda Services from the computer?
Why you would want to remove it?

For the second question, you might want to add a new protection from other company and would like to clean the dependencys from the previous one. OR, you happened to have a previous version of Panda Admin Secure and installing a new version does not successfully update all the clients. Or better still, you can't update Panda clients after you have migrated the domain, and freshed install the new version of Panda Admin Secure onto a new server.

Panda is installed on the client side at the following location:
%ProgramFiles%\Panda Software\

There is a file at %ProgramFiles%\Panda Software\Panda Administrator 3 called DServers.ini but changing it to the right server won't change a thing.

So, onto the removal:

There are some approaches that i have gatthered here, there, panda security forum, etc, but i have compiled it all to suit every scenerios to become completely removed , resulting in a always successfull fresh client install after that.

Step 1
Create a distributable package on your latest version of AdminSecure Console and save it to your hard drive. After that, you will have two files, named ConfPavAgent.ini and Pavagent.exe. Edit the ini file in notepad and change "action=install" to "action=uninstall"



Step 2
With the INI file saved, run PavAgent and let it do it's job. It might take a while, 15 minutes is an average on some computers.

Password is panda in lowercase letters
Extract the contents and run \ClientShield\RemoveALL with administrator privilidges. Altough the warning it says that is not responsible for any damage etc, i have run it successfully in dozens of computers and servers. It will take a few seconds to complete, as it works in the windows registry to remove certain keys.

Step 4
Open regedit and go to key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Check if there are any services left starting with PAV and if so, remove them:




Step 5
Go to Device Manager -> View -> Show hidden devices . Check if there are still any hidden devices installed, if so remove them, don't restart yet when it asks:




Step 6
There is a Panda NDIS filter installed in each Network connection you have. Go to the connection properties and uninstall this filter with administrative privilidges:


*Any network Connection will be temporarily lost while removing this filter

Step 7
Reboot

Step 8
Delete PAV*.* and ShlDrv51.sys from C:\windows\system32\drivers

Step 9
Delete %ProgramFiles%\Panda Software and %ProgramFiles%\Common Files\Panda Software folders . IMPORTANT: Any quarantined file will be deleted as the restore folder is deleted, so if you want to keep any important file you have that may have been blocked and want to restore it, you should try to trestore it first.

Step 10
Check with the tool XSAid3 if there are any registered services left (started or stopped ) and if so remove them and reboot.

Your system will be now cleaned and ready for new client distribution.

One last note, Windows Firewall might be an obstacle to successfully distributing clients remotely, temporarily turn off Windows Firewall or enable Remote Admininstration on the firewall service rules.
Thanks for reading.

Taken  from: http://bitboard.blogspot.com/