Skip to content

Instantly share code, notes, and snippets.

@ipascual
ipascual / magento2 - docker metrics
Created April 3, 2018 17:46
magento2 - docker metrics
# Commands
```
1) rm -rf pub/static/* generated/* var/view_preprocessed var/cache var/page_cache
2) Admin > Catalog > Products
3) Admin > Catalog > Products
4) Admin > Stores > Configuration
5) Admin > Stores > Configuration
```
# Metrics
@ipascual
ipascual / magento2 - delete invoices
Created March 19, 2018 22:36
magento2 - delete invoices SQL
fromInvoiceId = 418
fromOrderId = 371
DELETE FROM sales_invoice WHERE entity_id >= 418;
ALTER TABLE sales_invoice AUTO_INCREMENT = 418;
DELETE FROM sales_invoice_grid WHERE entity_id >= 418;
ALTER TABLE sales_invoice_grid AUTO_INCREMENT = 418;
DELETE FROM sales_invoice_item WHERE parent_id >= 418;
@ipascual
ipascual / magento2 - cleanup tables
Last active August 28, 2018 21:11
magento2 - cleanup tables - reset store SQL
SET FOREIGN_KEY_CHECKS = 0;
#Truncate order tables
TRUNCATE TABLE `gift_message`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
@ipascual
ipascual / jenkins - magento2 deployment script
Created March 8, 2018 20:07
jenkins - magento2 deployment script
#!/bin/bash
# ----------------------------------------------------
# v. 20180308
TARGET=/var/www/html
TMPTARGET=/var/www/codedeploy
BACKUP=/var/www/html-backup
USER=apache
GROUP=apache
# ----------------------------------------------------
@ipascual
ipascual / apache2 - forensic mode
Created January 18, 2018 13:59
apache2 - forensic mode
$ vi /etc/httpd/conf.modules.d/10-forensic.conf
LoadModule log_forensic_module modules/mod_log_forensic.so
LoadModule unique_id_module modules/mod_unique_id.so
ForensicLog logs/forensic_log
$ systemctl restart httpd
$ tail -f /var/log/httpd/forensic_log
@ipascual
ipascual / jenkins - magento1 deployment script
Last active May 3, 2019 11:37
jenkins - magento1 deployment script
# v. 20180110
TARGET=/var/www/B2C_America_PA/html
TMPTARGET=$TARGET/../html-in-progress
BACKUP=$TARGET/../html-backup
USER=apache
GROUP=apache
echo "Temporary folder: $TMPTARGET"
echo "Workspace folder: $WORKSPACE"
@ipascual
ipascual / centos7 - install LAMP
Last active January 10, 2018 23:50
centos7 - install LAMP
# Required Software
yum -y install git figlet gcc-c++ nfs-utils awscli firewalld mariadb psmisc mailx bzip2
# PHP 5.6.32
yum -y update
yum -y install epel-release
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://centos7.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
@ipascual
ipascual / centos7 - install Jenkins
Last active January 10, 2018 20:30
centos7 - install Jenkins
sudo yum install epel-release
sudo yum update
# Java
sudo yum install java-1.8.0-openjdk.x86_64
# Jenkins
cd ~
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
@ipascual
ipascual / rsync commands
Created November 20, 2017 23:14
Unix - rsync commands
rsync -avz --progress /myfolder username@54.85.88.53:/home/centos/myfolder
@ipascual
ipascual / bundle merge minify
Created September 20, 2017 22:08
Magento - magento2 - bundle merge minify
php bin/magento deploy:mode:set production
php bin/magento setup:static-content:deploy --theme Talos/default --area frontend
php bin/magento cache:flush
---
SELECT * FROM `core_config_data` WHERE `path` LIKE '%dev/%'
dev/template/minify_html