Thursday, November 17, 2011

Converting FAT32 to NTFS without losing data

Once upon a time you cannot copy a file into your portable hard drive, the system says 'No enough space in the disk'. But when you check the disk you still have plenty of space, so what's wrong?

Most of the time this is because the size of the file that you want to copy is too large for the file system to handle. Check your disk file system format, FAT32 can only handle about 4GB (232−1) bytes. Most portable hard drive and flashdisk is formated that way. So when you try to copy for example an ISO image of 7GB, the system will refuse to copy the file.

One way to resolve this issue is by converting the file system to NTFS format without losing all existing file in the disk. Just go to the Command Prompt and execute the command:

C:\> CONVERT  G:  /fs:ntfs

Where G: is a name of the drive you want to convert.

Note:
You may also have to check the disk for consistency before converting by executing:

C:\> CHKDSK  G:  /F

Friday, October 21, 2011

Installing Microsoft Games for Windows LIVE the easy way

More games are now require that Microsoft Games for Windows LIVE already installed. For example are DiRT racing series and Super Streer Fighter IV. Both are my favorite games. Actually I hate this requirement because I never playing game on online mode.

Straight to the point, first you must download 'Microsoft Games for Windows' installer. When you download it from Microsoft sites, it seems that the installer is small in size for the complete file packages would be downloaded later (about 70 MB) during installation process which will be a nightmare for those who have poor Internet connection. The solution is to download the complete package from other site. I myself download it from fileHippo, the link is here Microsoft Games for Windows.

You should also have Microsoft Visual C++ Redistributable and the latest Microsoft .NET framework installed on your system before installing Microsoft Games for Windows. Both installer can be downloaded there as well. Note that XP users should have Service Pack 3 installed and Windows7 users should have Service Pack 1 installed.

After installation of Microsoft Games for Windows, when you start the program, you will be prompted to install Windows Live ID sign-in Assistant. This is very annoying, anyway we have to download it from Microsoft Download Center, here is the link: http://www.microsoft.com/download/en/details.aspx?id=15106.
For 64bit system choose wllogin_64.msi and for 32bit system choose wllogin_32.msi

Bear in mind that before installing Windows Live ID sign-in Assistant, you must turn on Windows Update service (if it was turned off) otherwise your installation will fail. You can safely turn off Windows Update service later when the installation success.

Now you can play your favorite games.
Good Luck.

Tuesday, October 4, 2011

Creating an autorun.inf folder with batch file

There are an article about creating an autorun.inf folder on your USB drive’s root directory to prevent viruses from creating its own malicious autorun.inf file on your USB drive.

Unfortunately, once your computer is infected, it’s quite difficult to create the folder. If you have successfully deleted the infected autorun.inf file, the malware would simply recreate that file immediately before you are able to create the folder. This prevents you from creating the autorun.inf folder giving you an “A subdirectory or file autorun.inf already exists” message.

The process of deleting the file and creating the folder must be done as quickly as possible. But for some who can’t do this quickly, you’ll need a batch file. Copy and paste the following code into a new text file, rename it as mkautorun.bat or anything you want with .bat extensions. Copy it to your root USB drive and run it from there. It will delete the existing autorun.inf file and replace it with the folder. It also creates a CON folder inside the folder.


@echo off
cls
attrib autorun.inf -r -h -s
del autorun.inf
md autorun.inf
cd autorun.inf
md .\con\
cd\
attrib autorun.inf +r +h +s
echo.
dir autorun.* /a
echo.
echo DONE!
Pause

Windows XP Icon Cache

Are you experiencing icon lag while browsing through all your Start Menu icons and programs? Do you have a smaller menu delay and your icons need ages to load? No need to give up.

Just delete the IconCache.db file from your profile directory (usually in C:\Documents and Settings\YourUsername\Local Settings\Application Data). Then restart your computer.

The new IconCache.db will be rebuilt. You should uncheck (turn off) 'Do not show system files and folders' from Windows Explorer's Options menu to locate this file.

Sunday, October 2, 2011

Your PHP scripts get timeout error?

If you have php scripts that has to be executed longer than normally, probably because it has complex calculation/tasks to be executed, then you may end up with script timeout error. By default, each php script is given 60 seconds maximum period to complete. If you need more time, then you need to edit your php.ini configuration file.

Open your php.ini file, find and change these following section:

max_execution_time = 600    
; Maximum execution time of each script, in seconds

max_input_time = 600 
; Maximum amount of time each script may spend parsing request data in apache

Restart your Apache webserver to apply the new configurations.
It is recommended that you first inspect your scripts to find out why it takes longer to executed, probably there are some bugs or inefficient use of programming logic.

Maximum file import size in phpMyAdmin

The default maximum size of file that can be imported via phpMyAdmin is 2MB. If your back-up script larger than 2MB then you have to change the maximum limit of file import size of phpMyAdmin.

Open your php.ini file, find and modify the following parameters:
upload_max_filesize = 256MB
post_max_size = 256MB

In the example above, I set the maximum upload size to 256MB. Make sure the size of the imported sql script below the limit or you have to raise the limit again.

If you have no access to file php.ini then you are out of luck. Ask your administrator to set it for you.
Restart your Apache webserver to apply the new configurations.

MySQL Error - Can't open file: 'something.MYD'. (errno: 145)

The following error may occur with a MySQL database table:

Can't open file: 'TableName.MYD'. (errno: 145)

This error usually means that 'TableName' table has become corrupt. From my experience, it appears that the error commonly affects a table used for storing sessions and may occur when the database has used up all allocated disk space. Additional disk space will normally need to be allocated.

Also, run the following SQL query via phpMyAdmin:
REPAIR TABLE TableName 

Remember to change TableName with the name of the corrupted table as shown in error message respectively.

Beware of the case in MySQL Query

LINUX is case sensitive…
Assuming there is a table named category on your database, compare the following 2 queries:

SELECT category_id, CONCAT(main_cat_name,' ::: ',category_name) FROM category ORDER BY 2
SELECT category_id, CONCAT(main_cat_name,' ::: ',category_name) FROM CATEGORY ORDER BY 2

Both queries will work on MySQL server on WINDOWS, but only the first one works on LINUX. The second query will rise error ‘Table CATEGORY doest exist