Tuesday, January 28, 2014

Lamp install on Ubuntu with few clicks

Easiest way to install Lamp Server i have found after googling for 2 hours.
I thought to share with you so you can also get benefit from it.

sudo apt-get install tasksel
sudo tasksel install lamp-server

After you will be prompted to enter mysql root password . Enter the root password for Mysql and press enter.
It will install most rexommended php modules.
 
 
If you want to install phpmyadmin run below command:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
  
-----------------------------------------Enjoy-----------------------------------------------------

Saturday, December 21, 2013

Excel extarct words before and after a specific word

Excel extarct words before and after a specific word

For example, you have the following text in a cell “A1″ and you’d like to extract the text before the comma (the last name):
“Alam, Afroz”
To extract the last name before the comma “Alam” from A1, use one of the following formula:
=LEFT(A1,(FIND(",",A1,1)-1))
The result: Alam
To extract the first name after the comma from A1, use one of the following formula:
=MID(A1,FIND(",",A1)+2,256)
The result: Afroz

Friday, December 20, 2013

Compare data in Excel in two columns to find duplicates

Compare data in Excel in  two columns to find duplicates

To use a formula to compare the data in two columns:

  1. In a new worksheet, enter the following data (leave column B empty):
    X1: 1   Y1:     Z1: 3
    X2: 2   Y2:     Z2: 5
    X3: 3   Y3:     Z3: 8
    X4: 4   Y4:     Z4: 2
    X5: 5   Y5:     Z5: 0
         
  2. Type the following formula in cell B1:
    =IF(ISERROR(MATCH(X1,$Z$1:$Z$5,0)),"",X1)
  3. Select cells Y1:Y5.
  4. The duplicate numbers are displayed in column B, as in the following example:
     
    X1: 1   Y1:      Z1: 3
    X2: 2   Y2:2     Z2: 5
    X3: 3   Y3:3     Z3: 8
    X4: 4   Y4:      Z4: 2
    X5: 5   Y5:5     Z5: 0 
     
         

Thursday, December 12, 2013

Import large database from command line in windows

Import large database from command line in windows

Use
gzip -d [DATABASE_FILE.SQL.GZ]
to unzip .sql.gz 

If you are in the command prompt, type there
CD C:\wamp\bin\mysql\mysql5.1.36\bin {you can replace mysql5.1.36 with your version of mysql}
mysql -u [DATABASE_USERNAME] -p [DATABASE_NAME] < [DATABASE_FILE.SQL]


From the mysql console:
mysql> use DATABASE_NAME;
mysql> source path/to/file.sql;

Friday, May 3, 2013

Magento : Change options of configurable product to radio button

Magento : Change options of configurable product to radio button

Replace the configurable.phtml code with below code:
<?php
$_product    = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
?>
<?php if ($_product->isSaleable() && count($_attributes)):?>
    <dl>
    <?php foreach($_attributes as $_attribute): ?>
        <dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
        <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>
            <div class="input-box">
                <select style="display:none;" name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
                   
                  </select>
              </div>
        </dd>
    <?php endforeach; ?>
    </dl>
    <script type="text/javascript">
        var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
    </script>
<?php endif;?>
<div id="r"></div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#attribute<?php echo $_attribute->getAttributeId() ?> option").each(function(i, e) {
    if(jQuery(this).val() == '')
    {}
    else
    {
    jQuery("<input type='radio' name='r' />")
        .attr("value", jQuery(this).val())
        .attr("checked", i == 0)
        .click(function () {
            jQuery("#attribute<?php echo $_attribute->getAttributeId() ?>").val(jQuery(this).val());
        })
        .appendTo("#r");
        jQuery("<span >&nbsp;&nbsp;&nbsp;"+jQuery(this).html()+"&nbsp;&nbsp;&nbsp;</span>")
        .appendTo("#r");
    }
       
});
});


</script>

Monday, September 17, 2012

Magento : Change page layout from controller

 Change page layout from controller in Magento



Just you need to replace one line of code in your controller
where you want to change the layout of the page if you are not
able to do from xml through setlayout.

Replace
$this->loadLayout();

with
$this->loadLayout()->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');

Monday, September 10, 2012

Magento : Category Flat Data index error


 When reindexing "Category Flat Data " gives error
Cannot initialize the indexer process.

 I run the below query and the issue resolved.

ALTER TABLE catalog_category_entity ENGINE=INNODB;
ALTER TABLE core_store ENGINE=INNODB;

:)