Skip to content

Instantly share code, notes, and snippets.

View CajuCLC's full-sized avatar
🌎
Anacardium occidentale

Eric Cavalcanti CajuCLC

🌎
Anacardium occidentale
View GitHub Profile

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@CajuCLC
CajuCLC / debugging reindex locks mysql commands.md
Created October 18, 2017 15:02 — forked from tegansnyder/debugging reindex locks mysql commands.md
Useful Mysql Commands for Debugging Magento Reindex Locks

Sometimes you may have a run away reindex process that aborted due to a MySQL connection error of some sorts. It may be useful to use the following MySQL commands to aid in debugging.

Determining if a lock exists

Magento Enterprise labels the reindex lock via the constant REINDEX_FULL_LOCK in app/code/core/Enterprise/Index/Model/Observer.php

SELECT IS_FREE_LOCK('mydatabase_name.reindex_full')

Returns 1 is specified lock is free and can be acquired, 0 if it’s in use, NULL if an error occurs.

Determing the thread that is holding the lock

@CajuCLC
CajuCLC / Magento-Indexing-Locks.md
Last active August 23, 2018 17:35 — forked from tegansnyder/Magento-Indexing-Locks.md
Magento EE Indexer Locks

Here is how we can see if we have MySQL locks due to indexing:

Display locks:
SELECT IS_USED_LOCK('magento.reindex_full');
Releasing locks:
SELECT RELEASE_LOCK('magento.reindex_full');
@CajuCLC
CajuCLC / magento1_enterprise_index_diagnostics.sql
Created November 9, 2017 19:53 — forked from mttjohnson/magento1_enterprise_index_diagnostics.sql
Magento 1.x Enterprise Partial Indexing Diagnostics Toolset
-- When products are added/removed from a category this table stores all the relation data
select * from catalog_category_product where product_id = '24526';
-- The index that is used for presenting products in a category on the frontend
select * from catalog_category_product_index where product_id = '24526';
-- The change log table used for Magento EE partial index functionality
select * from catalog_category_product_index_cl where product_id = '24526' and version_id > (select version_id from enterprise_mview_metadata where changelog_name = 'catalog_category_product_index_cl');
# use a desktop user-agent string
#user-agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1"
# use a mobile user-agent string
#user-agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
# When following a redirect, automatically set the previous URL as referer.
#referer = ";auto"
referer = "http://domain.com"
@CajuCLC
CajuCLC / remove-all-from-docker.sh
Created August 30, 2018 18:19 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@CajuCLC
CajuCLC / Install composer on Amazon AMI running on EC2
Created September 10, 2018 01:51 — forked from asugai/Install composer on Amazon AMI running on EC2
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@CajuCLC
CajuCLC / customer_account.xml
Created March 12, 2019 22:38 — forked from matt-bailey/customer_account.xml
Disable My Account sidebar links in Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- Remove unwanted account navigation links -->
@CajuCLC
CajuCLC / customer_account.xml
Created March 12, 2019 22:38 — forked from matt-bailey/customer_account.xml
Disable My Account sidebar links in Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- Remove unwanted account navigation links -->
@CajuCLC
CajuCLC / kubectl-shortcuts.sh
Created April 11, 2019 07:00 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'