Magento - Delete test orders

September 16th, 2011

NOTE: the script contains a table name prefix ‘#_’ which must be either changed or removed.

Magento < 1.5 use:
http://www.eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos/

Magento >= 1.5 use:
http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-5-x.html

Once you’ve deleted your test orders and publish your live website you might find you get the error PayPal gateway has rejected request. Payment has already been made for this InvoiceID (#10412: Duplicate invoice) when trying to checkout live orders with paypal. This is because your paypal account has already processed a test order with this order id once and will not accept a second order with the same order no.

Here you you have two options:

1) change the padding of invoice numbers so your new invoice numbers won’t conflict with the old deleted ones. You can do this by changing the setting in your database e.g.

update `eav_entity_type` set `increment_pad_length`=10 where `entity_type_code`=’order’;

2) you can change the starting invoice number to a number greater than the last test order number to avoid the conflict - see http://www.magentocommerce.com/boards/viewthread/10985/ for more information

Installing BeautifulSoup on Linux

September 13th, 2011

It’s as easy as:

sudo python setup.py install

Manage and rotate Plesk log files

September 2nd, 2011

A web server using Plesk will, after some time begin to consume large amount of disk space in log files which are usually not required, if the server configuration is left in its default state. To avoid this use the log rotation feature in the log file management section of domains. There log files can be configured to rotate and to limit the amount of disk space used by them. Rotate by either file size or duration e.g. daily/weekly/monthly to manage the space log files use.

Drupal error 500 on 1and1 hosting

August 31st, 2011

Step 1:
Add the following to your .htaccess file:
##
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php
##

Step 2:
Uncomment this line in your .htaccess file (the comments above this line explain its purpose):
# RewriteBase /

Some background information for those who are interested (from the 1and1 website)…

What do I need to consider if I want to use PHP 5?

With 1&1 Linux hosting packages you have the choice between PHP 4 and PHP 5.

To distinguish a script as PHP 5, simply name the script with the file extension .php5. While the PHP developers have done their utmost to ensure compatibility, we cannot guarantee that PHP 4 scripts will function 100% correctly under PHP 5. Please note that in contrast to PHP 4, the default for the variable RegisterGlobals is “off”. By default Apache uses PHP 4 for .php extension. If you don’t want to rename all your scripts to .php5 you can do the following: Create a .htaccess file and place the following line

AddType x-mapp-php5 .php

in it. This will tell Apache to use PHP 5 instead of PHP 4 for the extension .php in the directory the .htaccess is placed and all sub-directories under it.
You can use AddHandler x-mapp-php5 .php as an alternative for or instead of AddType x-mapp-php5 .php

Debuggin in cakephp - write to the debug log file

August 27th, 2011

See http://book.cakephp.org/view/1195/Writing-to-logs for syntax to write to the debug log file. You also have other debugging tools available, for a complete reference see http://book.cakephp.org/view/1191/Using-the-Debugger-Class.

Putty timeout with message ”Network error: Software caused connection abort”

August 27th, 2011

If your putty ssh connection is disconnecting after some time of inactivity you can change either settings within your client or ssh server to avoid this and keep the connection aliive. For more information see http://ocaoimh.ie/2008/12/10/how-to-fix-ssh-timeout-problems/.

Paypal sandbox returns Pending

August 26th, 2011

http://www.cosmocentral.com/2009/07/payment_status-value-in-paypal-sandbox-always-pending/

Firefox 7 beta download

August 23rd, 2011

Having just recently received the automatic upgrade from Firefox 5 to Firefox 6, I decided to take a look at what the guys at Mozilla were up to and was soon glad to be reading about the memory footprint improvement claims being made about Firefox 7. Browsing seems to have become increasingly slower in recent releases and at the same time the amount of memory it is happy to hog just shocking. So much so that I have been finding myself reaching for the Chrome browser more and more frequently these days.

I was curious about what Mozilla had managed to achieve and if there was any substance to their claims so it wasn’t long before I had downloaded and installed the beta release. I have to say initial results are looking good. I saved my current tabs in FF 6, installed FF7 and reopened them to discover a memory usage reduction from ~300Mb to ~160Mb in task manager!

Furthermore, switching between multiple FF windows and tabs seems to be much more responsive. Early impressions seem to be good and bode well for the full release of Firefox 7 in October this year. I’ll be comparing it with Chrome with interest over the coming months, particularly as more and more add-ons release FF7-compatible versions.

Change start up form in C# application

August 13th, 2011

To change the form that is launched when a C# application starts open the file Program.cs and change the class in the call to Application.Run() to the form that should be launched on start up.

Copy data from corrupt hard disks

August 8th, 2011

http://www.roadkil.net/program.php/P29/Unstoppable%20Copier