Skip to content

Instantly share code, notes, and snippets.

View frozenminds's full-sized avatar

Constantin Bejenaru frozenminds

View GitHub Profile
@frozenminds
frozenminds / clean-magento_ce-db-extended.sql
Created May 12, 2014 12:54
Clean Magento database of junk and unnecessary data
--
-- Magento CE database clean-up extended
--
-- This is an extended clean-up which will clean search, import/export, reports, etc.
--
-- @author Constantin Bejenaru <[email protected]>
-- @copyright Copyright (c) Constantin Bejenaru (http://frozenminds.com/)
-- @license http://www.opensource.org/licenses/mit-license.html MIT License
--
@frozenminds
frozenminds / magento-anonymise-db.sql
Last active July 28, 2017 12:26
Anonymise Magento database
--
-- Anonymise Magento database
--
-- @author Constantin Bejenaru <[email protected]>
-- @copyright Copyright (c) Constantin Bejenaru (http://frozenminds.com/)
-- @license http://www.opensource.org/licenses/mit-license.html MIT License
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@frozenminds
frozenminds / strip-magento-ee-dumpfile.sh
Created August 19, 2014 18:18
Strip "INSERT INTO `table`" junk out of Magento SQL dumpfile. Use it when dump is huge and you can not even import it.
cat dump.sql | grep -v "INSERT INTO \`catalog_compare_item\`" | grep -v "INSERT INTO \`wishlist_item_option\`" | grep -v "INSERT INTO \`wishlist_item\`" | grep -v "INSERT INTO \`wishlist\`" | grep -v "INSERT INTO \`adminnotification_inbox\`" | grep -v "INSERT INTO \`dataflow_batch_export\`" | grep -v "INSERT INTO \`dataflow_batch_import\`" | grep -v "INSERT INTO \`report_event\`" | grep -v "INSERT INTO \`report_viewed_product_index\`" | grep -v "INSERT INTO \`report_compared_product_index\`" | grep -v "INSERT INTO \`catalogsearch_fulltext\`" | grep -v "INSERT INTO \`catalogsearch_query\`" | grep -v "INSERT INTO \`catalogsearch_recommendations\`" | grep -v "INSERT INTO \`catalogsearch_result\`" | grep -v "INSERT INTO \`catalog_category_flat_store_1\`" | grep -v "INSERT INTO \`catalog_category_flat_store_2\`" | grep -v "INSERT INTO \`catalog_product_flat_1\`" | grep -v "INSERT INTO \`catalog_product_flat_2\`" | grep -v "INSERT INTO \`log_customer\`" | grep -v "INSERT INTO \`log_quote\`" | grep -v "INSERT INTO \
@frozenminds
frozenminds / performance-mage_log.xml
Created October 14, 2014 08:22
Disable observers for Mage_Log. Module can not be disabled completely because other modules rely on it. Don't do this if you need the product compare feature.
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Disable observers for Mage_Log module.
*/
-->
<config>
<frontend>
<events>
<!-- Disable Mage_Log -->
@frozenminds
frozenminds / performance-mage_reports.xml
Created October 14, 2014 08:26
Disable observers for Mage_Reports. Module can not be disabled completely because other modules rely on it.
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Disable observers for Mage_Reports module.
*/
-->
<config>
<frontend>
<events>
<!-- Disable Mage_Reports -->
@frozenminds
frozenminds / change-definer-mysqldump
Created October 17, 2014 06:59
Change MySQL database definer
sed -i 's/DEFINER=`olddefiner`/DEFINER=`newdefiner`/g' mysqldump-file.sql
@frozenminds
frozenminds / vhost.conf
Created July 14, 2015 16:25
Nginx rewrite parameter "p" to "page" using Lua
server {
...
rewrite_by_lua '
-- get query args
local args = ngx.req.get_uri_args()
if args.p ~= nil then
args.page = args.p
args.p = nil
@frozenminds
frozenminds / nginx.conf
Created September 7, 2016 12:46
Nginx shared vars
server {
listen 80;
server_name test.dev;
root /var/www/html;
userid on;
default_type text/html;
index index.html;
@frozenminds
frozenminds / nginx.conf
Last active September 20, 2016 15:01
Nginx Load Balancing
user www-data;
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type text/html;
@frozenminds
frozenminds / tideways.service
Created November 27, 2017 14:06
Tideways SystemD service
[Unit]
Description=Tideways Daemon
Requires=network.target
[Service]
PIDFile=/var/run/tideways.pid
ExecStart=/usr/bin/tideways-daemon
User=tideways
Restart=on-failure
RestartSec=10