Skip to content

Instantly share code, notes, and snippets.

View molotovbliss's full-sized avatar
⚗️
Code, Eat, Sleep++;

Jared molotovbliss

⚗️
Code, Eat, Sleep++;
  • DFW, Texas
View GitHub Profile
@molotovbliss
molotovbliss / Mb-M2-resources.md
Created March 19, 2018 17:29
Magento2 Resources List; Needing a place to keep a list of all the tools/references used during Magento development.
@molotovbliss
molotovbliss / README.md
Last active March 6, 2024 14:17
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
@molotovbliss
molotovbliss / mysql-large-db-import
Created November 29, 2016 18:05
Importing Large DB faster MySQL Settings
Source: https://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster
innodb_buffer_pool_size = 4G
innodb_log_buffer_size = 256M
innodb_log_file_size = 1G
innodb_write_io_threads = 16
innodb_flush_log_at_trx_commit = 0
Why these settings ?
innodb_buffer_pool_size will cache frequently read data
@molotovbliss
molotovbliss / watchdo.sh
Last active June 8, 2023 15:55 — forked from mikesmullin/watch.sh
watchdo: Linux bash script to monitor file modifications recursively & execute bash commands as changes occur
#!/usr/bin/env bash
# script: watchdo
# author: Mike Smullin <mike@smullindesign.com>
# modified: Jared Blalock <mb@molotovbliss.com>
# possible use for monitoring .less changes to compile to .css
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
@molotovbliss
molotovbliss / ul-li-to-array.php
Last active June 5, 2023 23:31
Convert html > ul > li to a PHP array
// original sauce: http://stackoverflow.com/a/9033361/158325
// dummy ul > li html content to parse into an array
$html = "<ul>
<li>Free shipping</li>
<li>Equipment & speakesr</li>
<li>Taxes & fees apply</li>
</ul>";
// call function to convert
@molotovbliss
molotovbliss / db1-db2-only-tables-diff.sh
Last active June 5, 2023 13:18
Easily compare with diff, mysqldump two DB tables only (no data)
# Easily compare with diff, mysqldump two DB table schemas ignoring /* SET Comments etc... */ with grep
# Used originaly to locate missing custom tables from Magento 1.x to Magento 2.x after data migration
# dump both databases with as little details as possible (DONT run these in production without table locking disabled!)
# Use grep to remove /* SET ... */ like comments from dump and save to > dbX.sql
mysqldump --skip-set-charset --skip-triggers --skip-opt -K --skip-comments --skip-extended-insert -d --no-data -u root -p db1 | grep -v '^\/\*![0-9]\{5\}.*\/;$' > db1.sql;
mysqldump --skip-set-charset --skip-triggers --skip-opt -K --skip-comments --skip-extended-insert -d --no-data -u root -p db2 | grep -v '^\/\*![0-9]\{5\}.*\/;$' > db2.sql;
# compare both db dumps and grep for only CREATE TABLE lines
diff db1.sql db2.sql | grep -iP '^\<.CREATE.TABLE.\`.+\`'
@molotovbliss
molotovbliss / xslt-tips.md
Last active May 9, 2023 17:22
XSLT/XML - CLI tricks with xsltproc and xmllint

Tricks from the Command Line: xsltproc and xmllint

Often, when writing an XSLT file, you’ll want to test it quickly, without contacting a FileMaker Server or otherwise accessing the rest of the world. On Linux and OS X, you can use the command-line utility, ‘xsltproc’, to run XSLT programs quickly:

xsltproc transform.xsl input.xml

This applies the stylesheet in the file transform.xml to the XML in input.xml, and writes the output to your terminal. You can instead write the output to a file:

xsltproc transform.xsl input.xml > output.xml

<FilesMatch \.php$>
<If "%{HTTP_COOKIE} =~ /XDEBUG_SESSION/">
SetHandler "proxy:fcgi://10.0.2.2:9172"
</If>
<Else>
SetHandler "proxy:fcgi://10.0.2.2:9072"
</Else>
ProxyFCGISetEnvIf "true" PATH_INFO "%{reqenv:SCRIPT_NAME}"
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/var/www/vhosts/magento/pub%{reqenv:SCRIPT_NAME}"
</If>
@molotovbliss
molotovbliss / sysdig-snippets.md
Created March 9, 2018 22:35
SYSDIG CHEAT SHEET