Skip to content

Instantly share code, notes, and snippets.

@avdhut86
avdhut86 / nginx fail2ban badbots
Created March 19, 2021 12:53 — forked from Warloxk/nginx fail2ban badbots
nginx fail2ban badbots
#access log format
log_format main '$remote_addr - $remote_user [$time_local] "$request" - $request_filename '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
@avdhut86
avdhut86 / magento2_eav_attribute_reference.md
Created March 18, 2021 13:15 — forked from ericrisler/magento2_eav_attribute_reference.md
References related to EAV Attribtues in Magento 2

The array of data you can pass to the \Magento\Eav\Setup\EavSetup::addAttribute() method is as follows:

Some of the attribute keys are remapped using the Magento\Eav\Model\Entity\Setup\PropertyMapper class. We indicate what it's mapped to in [] brackets

$data = [
     'type' => 'varchar',  
          // (string)[eav_attribute][backend_type]: database storage type (varchar|int|text|decimal)
     'backend' => NULL,      
          // (string)[eav_attribute][backend_model]: class name used to retrieve/save the attribute data to the db
     'frontend' => NULL,     
SELECT e.entity_id,
e.sku,
v.value as url_key
FROM catalog_product_entity e
INNER JOIN catalog_product_entity_varchar v
ON e.entity_id = v.entity_id
AND attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'url_key' AND entity_type_id = 4);
@avdhut86
avdhut86 / magento2-deploy.sh
Created March 18, 2021 12:36 — forked from sergiojovanig/magento2-deploy.sh
Deploy Magento 2 steps
php bin/magento setup:backup --db
gzip var/backups/*.sql
git pull
php bin/magento maintenance:enable
php bin/magento cache:enable
rm -fr var/di var/generation var/cache
php bin/magento setup:di:compile
php bin/magento deploy:mode:set production --skip-compilation
php bin/magento maintenance:enable
php bin/magento setup:upgrade