вторник, 29 мая 2012 г.

пятница, 18 мая 2012 г.

Enable Apache mod_status 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
Apache-2.2

Problem:
I need enable apache module mod_status.


Solution:
Edit apache conf file: "/etc/conf.d/apache2"
Add option "-D STATUS" to the directive "APACHE2_OPTS"
Example string:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -D STATUS"

Restart apache and follow here "http://localhost/server-status"

суббота, 10 марта 2012 г.

Magento cms home page with products and pager

Params:
Magento 1.6.0

Problem:
Display products on home page with pager.

Solution:
Without programming you can display products only from one category.
Edit home page in admin panel of your shop.
Admin panel -> CMS -> Pages -> Home page
Insert into "Design" tab the following code
<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
   <action method="setCategoryId">
      <category_id>18</category_id>
   </action>
   <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
      <block type="page/html_pager" name="product_list_toolbar_pager"/>
   </block>
   <action method="setToolbarBlockName">
      <name>product_list_toolbar</name>
   </action>
</block>
</reference>
Change the category_id value for your needs.

четверг, 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 ;)