Skip to content

Instantly share code, notes, and snippets.

@Knase
Knase / run.sql
Created October 10, 2022 23:31 — forked from DavaGordon/run.sql
Magento 2 - Delete All Test Orders
SET FOREIGN_KEY_CHECKS=0;
# Clean order history
TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;
# Clean order infos
TRUNCATE TABLE `sales_creditmemo`;
TRUNCATE TABLE `sales_creditmemo_comment`;
@Knase
Knase / remove customers and orders.sql
Created October 10, 2022 23:30 — forked from tegansnyder/remove customers and orders.sql
Magento - Remove Customers and Orders from Enterprise
###
###
### ORDERS
###
###
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
@Knase
Knase / remove customers and orders.sql
Created October 10, 2022 23:30 — forked from tegansnyder/remove customers and orders.sql
Magento - Remove Customers and Orders from Enterprise
###
###
### ORDERS
###
###
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
@Knase
Knase / sftp
Created September 21, 2022 13:49
sftp
sftp -P 22 -i "~/.ssh/key" [email protected]:/var/www/file file
sudo cpupower frequency-set --governor performance --min 2600000 --max 4000000
@Knase
Knase / curl.md
Created October 15, 2021 11:15 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Knase
Knase / Check linux ports
Created October 1, 2021 08:29
To check the listening ports and applications on Linux
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:22 ## see a specific port such as 22 ##
sudo nmap -sTU -O IP-address-Here
ps aux | grep mysqld
# Exporting entire database:
mysqldump -u user -p database --opt | gzip > database.sql.gz
# Export table
mysqldump -uroot --opt --databases DB_NAME --tables TABLE_NAME | gzip > /tmp/TABLE_NAME.export.sql.gz
# Importing:
gunzip < database.sql.gz | mysql -u user -p database
# Credit http://failshell.io/mysql/using-gzip-and-gunzip-with-mysql-to-importexport-backups/
@Knase
Knase / bash
Created February 16, 2021 13:25
tar magento 2
tar cvfj magento_dump.tar.bz2 /folder --exclude='var' --exclude='vendor' --exclude='pub/media' --exclude='pub/static' --exclude='generated'
@Knase
Knase / Change_php_version_ubnutu.md
Created February 5, 2021 11:07 — forked from xeptore/Change_php_version_ubnutu.md
How to downgrade/upgrade PHP versions on Ubuntu-based linux distros

Add Repo

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade

Install PHP5.6

sudo apt-get install php5.6 php5.6-cli php5.6-common libapache2-mod-php5.6 php5.6-mysql php5.6-fpm php5.6-curl php5.6-gd php5.6-bz2 php5.6-mcrypt php5.6-json php5.6-tidy php5.6-mbstring php5.6-intl php-redis php-memcached php-gettext php-xdebug