Skip to content

Instantly share code, notes, and snippets.

View iamaravi's full-sized avatar
🎯
Sr. Magento Developer 10 Yr experience

arvi iamaravi

🎯
Sr. Magento Developer 10 Yr experience
View GitHub Profile
Export all Blocks :
mysql -umag2user -p -h database.local magento2 -B -e "SELECT block_id,identifier from cms_block cb JOIN cms_block_store cbs ON cb.row_id = cbs.row_id WHERE cbs.store_id = 6;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > block_categories.csv
#php bin/magento queue:consumers:start product_action_attribute.update
----------------
#Step to export product PDP content:
@iamaravi
iamaravi / airtelalacarte.js
Created August 21, 2020 12:29
Script to select all free channels in Airtel DTH Alacarte plan
var selectedChannels = 0;
jQuery(".icon-outlined-plus").click();
jQuery("a.btn-circle.cursor-pointer.btn-sm").each(function(){
var amount = jQuery(this).text();
amount = amount.replace("Rs","").replace("/1","").replace("mo","");
amount = parseInt(amount);
if(amount === 0) {
angular.element(jQuery(this).closest('div').find('[type=checkbox]')).triggerHandler('click');
selectedChannels++;
}
<?php
$xmlDOC ='<root>
<status>Success</status>
<error_code>0</error_code>
<cmessage>Delivery challans created</cmessage>
<quote_id>1234567</quote_id>
<items>
<item>
<item_id>000005</item_id>
<item_qty>5.000</item_qty>
@iamaravi
iamaravi / xmlvalidationusingxsd.php
Created May 4, 2015 06:30
XML validation using XSD source.
<?php
function libxml_display_error($error)
{
$return = "<br/>\n";
switch ($error->level) {
case LIBXML_ERR_WARNING:
$return .= "<b>Warning $error->code</b>: ";
break;
case LIBXML_ERR_ERROR:
$return .= "<b>Error $error->code</b>: ";
<?php
class Namespace_Module_Model_Entity extends Mage_Core_Model_Abstract
{
/**
* Initialization
*/
public function _construct()
{
$this->_init('namespace_module/entity');
}

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@iamaravi
iamaravi / git cheatsheet
Created September 26, 2014 08:15
Common git commands
#Branching
Create
git checkout -b [name_of_your_new_branch]
git push origin [name_of_your_new_branch]
Delete
git branch -D [name_of_your_new_branch]
git push origin :[name_of_your_new_branch]