четверг, 23 февраля 2012 г.

Gentoo install libgtk-x11-2.0.so.0

Params:
OS: Linux solar 3.1.6-gentoo #16 SMP Thu Jan 5 14:49:10 GMT 2012 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux

Problem:
I trying to run LDOCE5 and have this error:
Error while loading shared libraries: libgtk-x11-2.0.so.0
32bit applications need 32bit libraries, but I have 64bit system.

Solution: 
Many 32bit libraries on 64bit gentoo you can install with package app-emulation/emul-linux-x86-gtklibs. Also this package has needed libgtk-x11-2.0.so.0
> emerge app-emulation/emul-linux-x86-gtklibs  -av

суббота, 18 февраля 2012 г.

Enable MySQL query cache, in Gentoo

Params:

   - OS: Linux solar 3.1.6-gentoo #16 SMP Thu Jan 5 14:49:10 GMT 2012 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux
   - MySQL: mysql  Ver 14.14 Distrib 5.1.61, for pc-linux-gnu (x86_64) using readline 5.1

Problem:
No problem :) I need to enable query cache in mysql for testing my site with high load.

Solution:
Edit mysql config file "/etc/mysql/my.cnf".
Add those options to the "[mysqld]" section:
query-cache-type = 1
query-cache-size = 10M

Restart mysql daemon:
/etc/init.d/mysql restart

To check cache enabled or not, run this query:
show variables like '%query_cache%';
And you will see that (and other options):
have_query_cache YES
query_cache_type ON

суббота, 4 февраля 2012 г.

Magento disable user subscribe success email notification

Params:
Magento 1.6.0

Problem:
In Magento admin you can not disable email notification when user subscribe.  So, look to this solution

Solution:
Find script:
/app/code/core/Mage/Newsletter/Model/Subscriber.php
and comment folloving line in function subscribe($email) :
$this->sendConfirmationSuccessEmail();


PS:
This is bad solution, because  when you upgrade your store to the new version
those changes will be overwritten. If you not so lazy, create package for yourself ;)

пятница, 3 февраля 2012 г.

Magento change amount of emails sended at once

Params:
Magento 1.6.0

Problem:
In Magento I need decrease of emails count wich will be send by cron at once.  Set this value to 8
and send emails every 5 minutes against default 15.

Solution:
Find and edit the following scriots by example.

Change count of emails in one action:
app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php
$countOfSubscritions = 8;
app/code/core/Mage/Newsletter/Model/Observer.php
$countOfSubscritions = 8

Change newsletter exec cron  time interval:
/app/code/core/Mage/Newsletter/etc/config.xml
<crontab><jobs><newsletter_send_all><schedule>
<cron_expr>*/5 * * * *</cron_expr>


PS:
This is bad solution, because  when you upgrade your store to the new version
those changes will be overwritten. If you not so lazy, create package for yourself ;)