Category Archives: Windows

[SOLVED] Frequent corrupt HTTP downloads on Windows

Note: If you are just looking for the final solution, skip to the last paragraph.

On my new Windows 7 64-bit installation, I started getting frequent corrupt downloads when files were downloaded via HTTP. First, I thought my download manager (Free Download Manager) was buggy. However, I got corrupt downloads when downloading via Firefox too. I noticed it happening even with third party web installers and even Windows update (with error “WindowsUpdate_80246002” “WindowsUpdate_dt000”). However, downloads via torrent client were fine. So were downloads over SSH Proxy Forwarded tunnel and downloads over HTTPS.

These symptoms could be caused by various reasons. I suspected malware infection but latest updated version of Bitdefender Free did not detect any. Neither did Malwarebytes. Also, the bug was reproduced inside an isolated Virtual Machine with a different OS too using NAT. So, malware infection was ruled out.

Another reason this could happen is because of faulty networking hardware or buggy driver. Bittorrent has integrity checks on application layer so it automatically repairs corruption due to faulty hardware and drivers. However, it was strange that downloads over HTTPS and SSH VPN connections were not buggy.

The network adapter I was having this problem with is Intel® Centrino® Wireless-N 1030 and driver version is So, I decided to try to update the driver. I ran the Intel® Driver Update Utility and found that a newer version of the driver (application version 16.7.0, driver version is available for download. So, I downloaded it using the SSH Proxy Forwarded tunnel (you could download it in a different computer or setup a tunnel and download using it) and installed it. However, updating drivers didn’t help either.

So I suspected that since connections over secure connections were fine, something intercepting non-secure connections could be a problem. The first suspect was Bitdefender Antivirus. I removed it and rebooted. The problem no longer existed. All the downloads following Bitdefender uninstall were fine. I searched for this and found that other users were having the same problem too and it was not a Bitdefender bug but a Windows bug which also affects other security suites that monitor HTTP traffic.

The solution is to install Windows hotfix KB2735855. Download it here for 32-bit Windows 7 and here for 64-bit Windows 7. According to Microsoft’s article regarding this bug, this bug only applies to Windows 7, Windows Server 2008 R2 and Windows Web Server 2008 R2.

[SOLVED] Failed installing Samsung Mobile MTP Device Error code 10: This device cannot start

While trying to connect Samsung Galaxy S3 i9300 with Android 4.0 Ice Cream Sandwich on Windows 7 64bit PC with Kies installed, the device driver installation failed and it showed “The device cannot start” in Device Manager. While searching for a fix, I found a XDA developer forum post offering a solution for this issue however, the fix didn’t work but thanks to the thread, I finally managed to get it working. I’m sorry but I don’t know how it works and why it works and the procedure involves editing registry so proceed with caution. Having said that, here is what you can do to get it to work.

Before continuing with the procedure, make sure you have the latest drivers for Samsung device. To do that, connect your device, wait for it to fail and then open Windows Update and click Check for Updates. If you find any Samsung driver update, install it and restart if you have to.

Here is the process:
1. Open Registry editor (regedit.exe)
2. Navigate to the following key and perform a backup by right clicking on it and selecting Export and save anywhere:

This step is a safety measure. You can restore the settings by double clicking the reg file if something goes wrong.
3. Now, under Class, find the following keys and look for UpperFilters on the right pane:

If you find UpperFilters, just right click on it and select Delete to delete it.

Remember to do it for both keys i.e. {36FC9E60-C465-11CF-8056-444553540000} and {EEC5AD98-8080-425f-922A-DABF3DE3F69A}.
4. Now, disconnect your phone if you have it connected and try reconnecting.

Hope it works for you too. If it doesn’t or if you mess something up, you might want to start looking for a cheap Office for Mac 2016 and convert (just kidding!!) , you may want to restore your registry by double clicking the reg file backed up in step 2 and look for some other solution. Best of luck.

[HOWTO] Install M2Crypto for Python 2.7 on Windows

I am using Windows 7 Home Premium 64-bit and had to setup M2Crypto required for a Python program that I am writing in Python 2.7 (32-bit). After hours of trying and searching, I finally managed to get it installed and working.

Here are some of the things that I tried, please move on to “How I managed to get it to work” if you don’t want to go through boring “What I tried” stuff.

What I tried:
First of all, I tried to install M2Crypto via pip. I got an error saying that swig.exe was not found, so I downloaded copy of swigwin and extracted it, then added the directory to system PATH. I installed easy_install (setuptools), opened the terminal and changed dir to Python27\Scripts and installed pip (easy_install pip). Then, I tried to install M2Crypto using pip:

pip install M2Crypto

Unfortunately, I got the following error:

SWIG\_m2crypto.i(31) : Error: Unable to find ‘openssl\opensslv.h’

SWIG\_m2crypto.i(45) : Error: Unable to find ‘openssl\safestack.h’

SWIG\_evp.i(12) : Error: Unable to find ‘openssl\opensslconf.h’

SWIG\_ec.i(7) : Error: Unable to find ‘openssl\opensslconf.h’

error: command ‘swig.exe’ failed with exit status 1

So, I downloaded openssl source files and copied the include directory to swig_dir/lib, then I got errors that from swig. I also tried giving build_dist parameter to but in vain. I was thinking of compiling openssl myself, but I figured that I would require Visual Studio (which I do not have). I thought of using MingW, but turns out you need to compile Python with MingW for it to work. I almost gave up on this, but I found that some developers had contributed build of OpenSSL and M2Crypto, so that I could just install them. Move on to next section to do it yourself.

How I managed to get it to work
I downloaded pre-built binaries of M2Crypto built against OpenSSL 1.0 from M2Crypto Wiki. The one that I downloaded is M2Crypto-0.21.1.win32-py2.7.msi. Then, I set it up. It detected my Python installation and installed the package. However, when I ran the Python script, I got the following error:

import __m2crypto
ImportError: DLL load failed

I don’t know if it was because I did not restart my computer after installation or if OpenSSL dlls were missing, in either case, you may want to install Win32 OpenSSL V1 Light and install it and it should work.

Hope this helps.

[HOWTO] Install easy_install and pip in Python 3 (Windows)

I am just starting with Python 3 on Windows and I wanted to install easy_install and/or pip for installing other available packages easily. However, I found that setuptools setup for Python 3.3.2 (the version I am using) is not available.

I discovered distribute, a fork of setuptools, which provides easy_install. I downloaded source from Python Package page for distribute and extracted it. In the elevated command prompt (cmd->Run as Administrator), I changed to extracted directory and then ran Then, easy_install was successfully installed in Python_Directory\Scripts. Then, I could install pip by changing directory to Scripts and running the following:

easy_install pip

Hope this helps.

[HOWTO] Make Street Bike Fury run in Windows 7

I had played a great indie game a few years back. It was called Street Bike Fury from S64 Games. The game is no longer being developed because of death of the developer. I had tried to make this game run earlier but failed. However, I have found a way now and I would like to share that.

After some research, I found that the game was developed using Game Maker 6. The programs made in this only run in Windows XP and not in Windows 7 and Windows Vista. However, in YoYoGames Wiki, there is a software that can fix this. First download and setup Street Bike Fury from official download page. Then, download the Game Maker Conversion Program from here. Then setup the game but don’t launch it. Use the GM_Convert_Game and patch the exe. Then you will be able to run it.

Hope this helps.

[SOLVED] Error: 0x800F0A12 while installing Windows 7 Service Pack 1

When trying to update Windows 7 Ultimate to Service Pack 1 using Windows Update, I got error: 0x800F0A12. I have two hard disks of which one has Fedora 15 and the other has Windows 7, the one with Fedora 15 had Grub installed. I disconnected the other hard disk and tried it again and the issue was resolved. If you have single hard disk with some other OS installed, you may face similar error which is a little more difficult to solve. Before performing this, make sure to back up your important data and have recovery tools handy. Please proceed at your own risk.

To solve the issue, you have to set the partition with Windows 7 as active using Disk Management (Win+R: diskmgmt.msc) by right clicking the partition and selecting “Mark Partition as Active”. After the update has been installed, make sure to set your other partition which has the boot loader as active.

[HOWTO] Setup step debugging PHP in Netbeans on Windows with XAMPP

I am using Netbeans 6.9.1 on Windows 7 with XAMPP 1.7.4 installed. I wanted to enable step debugging for PHP like I do in my PC with Fedora (see here for Netbeans PHP step debugging for Fedora). To do that, I had to follow the following steps:

Edit the php.ini file (xampp\php\php.ini) in a text editor to uncomment (remove leading semicolon 😉 the following lines:

zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000

Also, search for the line containing “xdebug.remote_enable” and change it to:

xdebug.remote_enable = On

Then restart apache service.

Now, open the file Program Files\NetBeans 6.9.1\etc\netbeans.conf and find the line containing “netbeans_default_options”. Add the text “-J-Dorg.netbeans.modules.php.dbgp.level=400” at the end of the line so that it looks like the following:

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dorg.netbeans.modules.php.dbgp.level=400"

Now, restart Netbeans and select Debug>Debug Project. However, I have experienced it is very slow on Windows compared to the installation on Fedora.

Hope this helps.

[SOLVED] Warning: imagettftext() [function.imagettftext]: Invalid font filename in path\to\php\file.php on line NN

I am running XAMPP 1.7.4 with PHP 5.3.5 on Windows 7. When using any text related GD library functions such as imagettftext(), I get the following error:

[SOLVED] Warning: imagettftext() [function.imagettftext]: Invalid font filename in path/to/php/file.php on line NN

Normally, this happens when the font is missing in GDFONTPATH and can usually be resolved by using correct font folder, using correct font file and naming it properly in the PHP file. However, in this particular case, I’ve figured that this is the problem with GD Library or PHP because I am still getting the error even though I have done everything right. I tried WAMP but still in vain. When I tried the same in my Linux machine, everything was fine.

Here is what I did as a workaround. I removed the putenv line and referred to fonts by relative path. For example, the following sample code is the one that does not work

putenv('GDFONTPATH=' . realPath('fonts'));
imagettftext($image, $size, $angle, $xcordinate, $ycordinate, $text_color, $font, $text);

I have assumed that the fonts folder contains a file ariali.ttf and in that case, the code must have worked. However, it does not, so the workaround is to do the following:

//putenv('GDFONTPATH=' . realPath('fonts')); remove this line
$font="fonts/ariali.ttf"; //use relative path here instead
imagettftext($image, $size, $angle, $xcordinate, $ycordinate, $text_color, $font, $text);

The above code works and I guess this is how I will have to use fonts in PHP from now on.

[SOLVED] “[ERROR] Fatal error: Can’t open and lock privilege tables: Incorrect key file for table ‘user’; try to repair it”

I am working on a computer with XAMPP installed on Windows 7. When I upgraded XAMPP to fix the earlier problem with WinMySQLAdmin, a new problem with mysql was introduced. The error log (mysql_error.log) showed the following entry at the end:

[ERROR] Fatal error: Can’t open and lock privilege tables: Incorrect key file for table ‘user’; try to repair it

To fix, I downgraded to earlier version of XAMPP, exported the database and removed the mysql data directory, and reinstalled the latest version of XAMPP. Now, MySQL could start without problems. Then, I imported the data back and all was well.