Tuesday, January 28, 2014

Windows 7 Blue Screen uTorrent / µTorrent is running FIX

Hello,

If you are running Windows 7 and you had left the system running as some things are been downloaded from uTorrent / µTorrent. After some time you see a Blue Screen of Death with some error number and only way the system would work further is by hard restarting it.

If one thinks by restarting the system or reinstalling uTorrent / µTorrent will fix this issue then one has mistaken,

From my research on the net I found this issue comes due to access number of connection opened by uTorrent / µTorrent for downloading stuff, it very common if the there are many seeders for a specific file, in Windows 7 this will happen instantly.

If you download and install a Blue Screen Reader Tool from download.com then for this particular problem you will find the cause of blue screen which will appear as

Probably caused by : NETIO.SYS

On the net one will find different solutions of installing a windows patch / upgrading, changing some windows configuration, even upgrading RAM and uninstalling few softwares like MaAfee. But as the problem started with uTorrent / µTorrent so the solution has to be with its configuration.

I tried an tested this solution and it is working fine for me.
  1. Got to uTorrent / µTorrent and open Options -> Prefrences -> Bandwidth.
  2. Set the numbers in Number of connections as minimum as you like
    1. Global maximum number of connection 15
    2. Maximum number of connected peers per torrent 12
    3. Number of upload slots per torrent 1
You can play with numbers as per your requirement, but try to maintain the number in between minimum limits and you will be fine and safe from blue screen of death.

Thanx
Anshumaan Bakshi


Wednesday, January 8, 2014

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 47 bytes) in C:\wamp\www\workspace\MegaStore\lib\Zend\Db\Statement\Pdo.php on line 312

Hello,

If you get and error message like

 Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 47 bytes) in C:\wamp\www\workspace\MegaStore\lib\Zend\Db\Statement\Pdo.php on line 312


And no matter how much you change the php.ini file the error persists, then you need to add

ini_set('memory_limit', '2042M');

On top of the script which is throwing this error message, as this takes effect more properly when you are using some architectures like Zend or Magento the above simple fix can save a lot of your time.

Thanx
Anshumaan Bakshi

Wednesday, December 25, 2013

WAMP PID 4 Port 8 busy

Hello,

If you are on Windows 7 and WAMP is not working.You have closed SKYPE, changed its default ports etc, and any other related software which can possibly use port 80, and still WAMP doesn't start. Specifically Apache.

A little bit of Goggling can tell you that Port 80 is taken by Windows 7, Pid 4 in Task Manager, further you can find out that its a system process and it cannot be killed.

I found that there is service named http.sys which captures  port 80 on start-up and it needed to be stopped in order to release port 80.

It has to be disabled through REGEDIT, following are the steps for the same,

  1. Launch regedit, run-> type regedit
  2. Go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
  3. Locate Start
  4. Change the value to 4 which means disabled.
  5. Restart your system.
  6. Now your WAMP should work.

Thanx

Anshumaan Bakshi



Monday, December 23, 2013

ERROR 2006 (HY000) at line 8245: MySQL server has gone away

Hello,

If you are trying to import an SQL file through command line on windows and you get this error message

ERROR 2006 (HY000) at line 8245: MySQL server has gone away

then you need to open your my.cnf or my.ini and update as

max_allowed_packet = 3000M

more than the size of the file you are trying to import, like I was trying to import a 2.2 GB file.

Thanx
Anshumaan Bakshi

Wednesday, November 20, 2013

WAMP phpMyAdmin error #2002 - No connection could be made because the target machine actively refused it.

Hello,

If you get an error #2002 - No connection could be made because the target machine actively refused it when you try to access phpmyAdmin on a WAMP.

Then it is due to your 3306 port is already occupied by some other application. For me it was Skype today, I just needed to close Skype and restart the WAMP server once again and the issue was fixed. Skype will anyways take another vacant port so restart it as well.

You can make changes to my.ini so that it listens to another port, but easier to close Skype.

Try it.

Thanx
Anshumaan Bakshi

Tuesday, October 22, 2013

Magento Correcting the default taxing module for calculating tax based on discounted price

Hello,

Lets assume your client has a requirement of calculating tax based only on the discounted price.

Like,
The price of the item with tax is 100
Discount on this item with tax is 25
The remaining amount with tax is 75

If I consider 14% as tax then the tax should be shown as 9.21 and this is already part of 75. So if I subtract 9.21 from 75 then I will get 65.78, if I calculate 14% of 65.78 then I will get 9.21 to be exact.

In Magento this seems to be difficult to achieve by default configurations as if you enter item price without tax and discount is entered or calculated with tax.

I have checked it is not possible without a custom module.

Unfortunately cannot paste the entire module here but here are few pointers for resolving such issue.

  1. Main change we need to make is in the Quote Taxing module which is responsible for all the configuration based tax calculations, like in my case I was using unit based taxing so we have switch case which needed to be edited. This is the module which will return the actual tax amount so by changing it we are making the core change for recalculating the tax.
  2. Because of the above change we have our grand total all messed up, which needed to be corrected in Quote/address/grand file.
  3. Above 2 file will ensure that the new way of calculating tax has been enforced on frontend, but back end still needed to be changed
  4. The way Magento calculates row totals is, it adds the base price with the tax amount and hence we get row totals, but if the tax is based on the discounted price then adding it to the product price will give an incorrect result, fortunately this happens only at adminhtml template level, so as it being cosmetic change only we need to change the order, invoice view and create templates.
  5. Also we need to change the invoice subtotal calculation file as the final calculations is effected as I explained earlier.
If all the above changes are in place properly then the desired change will be achieved, I have tested and developed this module.

Thanx
Anshumaan Bakshi

Import MySql DB through command prompt on WAMP

Hello,

If we have a very large file to import on WAMP and PHPMyAdmin is dying due to various reasons then you can import the big file using CLI or through Dos

Follow the following steps.
  1. Run cmd command
  2. Assuming you have installed wamp on C: drive.
  3. C:>cd wamp
  4. C:\wamp>cd bin
  5. C:\wamp\bin>cd mysql
  6. C:\wamp\bin\mysql>cd mysql15.5.8
  7. C:\wamp\bin\mysql\mysql15.5.8>cd bin
  8. C:\wamp\bin\mysql\mysql15.5.8\bin>mysql.exe -u root -p dbname < sqlDump.sql
  9. Now we need to have the sqlDump.sql file inside C:\wamp\bin\mysql\mysql15.5.8\bin\ for direct execution of this command.
  10. If everything is fine, then this command will ask for the mysql password for username root and it should start importing the file on the mysql database.

Now what we are doing here is we are moving to WAMP's bin directory to locate the mysql.exe file. This command file is similar to the one we have on Linux and it behave s the same way, so we provide the information like username db and import sql file and it can easily be imported in our db.

Please note: We can also use direct path from any location as soon as we come to cmd like C:\wamp\bin\mysql\mysql15.5.8\bin\mysql.exe -u root dbname < sqlDump.sql
but need to be sure of the path which is hard to locate.

Thanx
Anshumaan Bakshi