Mysql : Tips
Fix for logging issue
ERROR 1419 (HY000) at line 410: You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)
Take the backup of my.cnf and execute following commant to add it in the end of the file
echo 'log_bin_trust_function_creators = 1' >> my.cnf
Related cards:
Mysql
Mysql Secure Installation in ubuntu 18.04
sudo apt install mysql-server
enter Y to install
2.
sudo mysql_secure_installation
to run automated securing script
3. Press N for VALIDATE PASSWORD plugin
4. Set root password...
Docker Compose : Add New Container in existing docker compose
How to add a new container in a existing docker-compose file.
Steps:
The existing docker-compose file
version: '3.3'
networks:
pwa_net:
ipam:
driver: default
config:
- subnet: 60.0.0.0/24
gateway: 60.0.0.1
...
Docker Compose Network
This example shows that how the static ip can be assigned to container and how to add another container network to a container. This can be done only for version 2 compose.
version: '2'
services:
app:
image: busybox
command: ping ...
magento 2: Docker compose file
Docker compose file for magento 2.4
version: '3.3'
networks:
pwa_net:
ipam:
driver: default
config:
- subnet: 40.0.0.0/24
gateway: 40.0.0.1
services:
web-cont:
image: registry.vasan.com/mag...
Magento 2 Tips : Conditionally Loading Javascript and css in layout xml
First create your conditions in the system.xml..
Second add your css and js in your local xml.
<reference name="head">
<action method="addCss" ifconfig="my_config_section/advanced/load_css"><stylesheet>css/my_module/my_module.css</st...
Docker Tips
Here you can learn about the docker basic and its commands
- How to execute the docker run command
The docker run command is used to get the specific docker image from registry and start and run the conta...
Magento 2 Tips : How to get client ip
The client ip can be retrieved using
getClientIp()
method in
Magento\Framework\HTTP\PhpEnvironment\Request
class. This is very useful , when do the ip restriction in maintenance page development.
Magento 2 Tips : Install external lib
How to install a excel lib to generate formatted excel file
Step 1) Go to the magento 2 root folder then execute following command
sudo -uwww-data composer require phpoffice/phpspreadsheet
Magento 2 Tips : System Configuration field dependent on multiple values
How to show a field dependent on another field multiple values
<depends>
<field id="vasan/general/enable">1</field>
<field id="vasan/email_dispatch/receiver" separator=",">2,3</field>
...
Magento 2 Tips : Date Format
use Magento\Framework\Intl\DateTimeFactory;
=====================================
$endDate = $this->dateTimeFactory
->create($milestone->getData('end_date'), new \DateTimeZone('UTC'))->format('d/m/Y');
==========================...