Skip to content

Instantly share code, notes, and snippets.

@Knase
Knase / git-revert-sha-commit
Created March 17, 2024 21:18 — forked from mgibowski/git-revert-sha-commit
[git] revert to a commit by sha hash
# found at:
# http://stackoverflow.com/questions/1895059/git-revert-to-a-commit-by-sha-hash
# reset the index to the desired tree
git reset --hard 56e05fced
# move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to 56e05fced"
@Knase
Knase / pkglist.php
Created August 24, 2023 11:42 — forked from alankent/pkglist.php
Connect to Magento 2 Composer repo and list packages you can access
<?php
/**
* Return the path of the auth.json file.
*/
function findAuthJson() {
// Windows sets HOMEDRIVE and HOMEPATH, but cygwin sets HOME.
if (!isset($_SERVER["HOME"]) && isset($_SERVER["HOMEDRIVE"])) {
@Knase
Knase / mount.md
Created August 14, 2023 21:18
Mac OS Mount RW NTFS

Write to NTFS support MacOS

1. Get the partition UUID

Connect the external drive to MacOS. It should mount read-only. Start "System Information", clic on Hardware -> Storage, select your drive in the list and copy its UUID.

Another way to get the UUID is to use the diskutil CLI tool:

~$ diskutil list 
~$ distutil info diskXsY
@Knase
Knase / Magento2-remove-orders-customers
Created June 2, 2023 00:13 — forked from carlowens/Magento2-remove-orders-customers
Magento 2 remove test data of orders and customers
SET FOREIGN_KEY_CHECKS = 0;
#clear orders
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`;
TRUNCATE TABLE `quote_payment`;
@Knase
Knase / README.md
Last active March 6, 2023 22:00 — forked from molotovbliss/README.md
Synced via Snip

Speed up warden for faster importing of large sql dumps.

  1. Add the innodb options to the warden/environments/magento2.base.yml docker-compose YML file.
  2. Restart warden environment warden env down && warden sync stop && warden env up -d && warden sync start
  3. Import the .sql file with warden db import.
  4. Remove options & restart warden enviornment once import completed.

Why these settings

  • innodb_buffer_pool_size : Will cache frequently read data
@Knase
Knase / README.md
Created October 30, 2022 16:46 — forked from molotovbliss/README.md
Speed up warden for faster importing of large sql dumps.

Speed up warden for faster importing of large sql dumps.

  1. Add the innodb options to the warden/environments/magento2.base.yml docker-compose YML file.
  2. Restart warden environment warden env down && warden sync stop && warden env up -d && warden sync start
  3. Import the .sql file with warden db import.
  4. Remove options & restart warden enviornment once import completed.

Why these settings

  • innodb_buffer_pool_size : Will cache frequently read data
@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 / 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.