Skip to content

Instantly share code, notes, and snippets.

Code, Eat, Sleep++;

Jared molotovbliss

Code, Eat, Sleep++;
View GitHub Profile
molotovbliss / mysql-large-db-import
Created Nov 29, 2016
Importing Large DB faster MySQL Settings
View mysql-large-db-import
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 / terminalrc
Created Dec 14, 2017
Dracula Theme for XFCE4 Terminal
View terminalrc
molotovbliss /
Last active Sep 7, 2021
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 /
Created Mar 19, 2018
Magento2 Resources List; Needing a place to keep a list of all the tools/references used during Magento development.
molotovbliss / remove-table-prefixes.sql
Last active May 31, 2021
Remove table prefixes MySQL
View remove-table-prefixes.sql
# Set @database, @old_prefix and @new_prefix (if you want a different prefix instead of removing)
# Execute the Generated SQL Query this generates to rename all tables found with prefix.
SET SESSION group_concat_max_len = 999999999;
SET @database = "databasename";
SET @old_prefix = "mgn_";
SET @new_prefix = "";
SELECT GROUP_CONCAT("RENAME TABLE ", TABLE_NAME, " TO ", replace(TABLE_NAME, @old_prefix, @new_prefix),'; ' separator '')
FROM information_schema.TABLES WHERE TABLE_SCHEMA = @database AND TABLE_NAME LIKE CONCAT(@old_prefix, '%');
View gist:2562551

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
molotovbliss / logrotate
Last active Apr 26, 2021
Magento Log Rotate with logrotate
View logrotate
The magento-logrotate.conf file contents:
/path/to/magento/var/log/*log {
rotate 7
create 660 www-data www-data
molotovbliss / JSONArrayFileUtil.php
Last active Apr 2, 2021
Simple PHP Class to save an array to disk and read it back into a PHP Array using JSON.
View JSONArrayFileUtil.php
* Save an PHP Array to disk with a delimiter to support
* multiple array values. Associative Array supported.
* @author Jared Blalock (
* @link
Class Json_Array {
View apache-as-proxy.conf
<FilesMatch \.php$>
SetHandler "proxy:fcgi://"
SetHandler "proxy:fcgi://"
ProxyFCGISetEnvIf "true" PATH_INFO "%{reqenv:SCRIPT_NAME}"
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/var/www/vhosts/magento/pub%{reqenv:SCRIPT_NAME}"