Skip to content

Instantly share code, notes, and snippets.

View evgv's full-sized avatar
🏠
Working from home

Eugene Zubkov evgv

🏠
Working from home
View GitHub Profile
@evgv
evgv / magento_clean_test_data.md
Created August 5, 2019 07:03
Magento 1.x, Clean test data

Magento 1.x, Clean test data

Customers

SET FOREIGN_KEY_CHECKS=0;

-- Customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
@evgv
evgv / nagento_1xx_apache_configuration_use_of_capital_and_small_initial_letters.md
Last active July 19, 2019 07:40
Magento 1.x.x | Apache configuration | Use of capital and small initial letters

Magento 1.x.x | Apache configuration | Use of capital and small initial letters

RewriteMap lower int:tolower
  RewriteCond %{REQUEST_URI} [A-Z]
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
  RewriteCond %{REQUEST_METHOD} !POST
  RewriteCond %{REQUEST_URI} !/customer/
  RewriteCond %{REQUEST_URI} !/checkout/
  RewriteCond %{REQUEST_URI} !/backmgmt2/
@evgv
evgv / how_to_show_git_branch_in_bash_prompt.md
Created April 4, 2019 07:24
How to show git branch bash prompt

Open for edit bashrc file

gedit ~/.bashrc

or `vi` or `nano` or any editor

Add to the end(as example) of file

@evgv
evgv / how_to_install_multiple_php_version_with_the_apache_on_ubuntu_1804.md
Created February 13, 2019 08:41
How to Install Multiple PHP Version with Apache on Ubuntu 18.04 & 16.04

How to Install Multiple PHP Version with Apache on Ubuntu 18.04 & 16.04

Generally, the hos manager used a separate server for each PHP version application deployment. Which increases the hosting cost. Some of the host managers are using Docker to run multiple PHP version on the single server. Also, most of you are aware of the configuration, I used in this tutorial. But some of the system administrators are not aware of this. This tutorial will help you to install multiple PHP version with Apache on Ubuntu 18.04 and 16.04 system without switching PHP versions. This tutorial describes the installation and configuration of two VirtualHost on Apache with separate PHP versions. First VirtualHost will work with PHP 5.6 and another VirtualHost will run with PHP 7.2. So just go through this tutorial. You can also use more than two PHP versions with Apache as required but this tutorial covers two only.

Apache Installation

Install Apache web server from the official repository. Launch terminal on your system

@evgv
evgv / magento_2_get_media_url_in_template_file.md
Last active August 19, 2021 17:29
Magento 2. get Media URL in template file

Magento 2. Get media URL in template file

You can get media url in your template file using below way but without using objectmanager you must have to define Block file with __construct() method with define storeManagerInterface in construct method.

In your phtml Block file create __construct function.

Add to __construct in your class

@evgv
evgv / magento_2_display_yes_no_in_order_grid_instead_0_1.md
Last active September 27, 2018 08:10
Magento 2. Display yes/no in grid instead 0/1

Magento 2. Display yes/no in grid instead 0/1

Need to create source class(Which must implement Magento\Framework\Data\OptionSourceInterface) for this which defined

<?php

namespace Vendor\Module\Model\Source;

How to colorize output of git

Auto

    git config --global color.ui auto

Manual

@evgv
evgv / magento_add_rel_links.md
Last active May 15, 2018 10:48
Magento. Add rel links
@evgv
evgv / magento_save_core_config_data_using_install_script.md
Last active May 14, 2018 13:08
Magento. Save core config data using install script

Magento. Save core config data using install script

Add install/upgrade script, and run migration.
Method saveConfig() has 2 required parameters ($path and $value) and 2 optional ($scope that equal default by default and $scopeId that equal 1 by default). More info you can see in class Mage_Core_Model_Config.

    <?php

 $installer = $this;
@evgv
evgv / ubuntu_get_your_ip_address.markdown
Last active April 27, 2018 06:28
Ubuntu. Get your IP address

Ubuntu get IP address

Some ways to get your ip address both local and public.

Local

    hostname -I