Skip to content

Instantly share code, notes, and snippets.

View florinel-chis's full-sized avatar

Florinel Chis florinel-chis

  • Magendoo
  • Bucharest, Romania
View GitHub Profile
@cmtickle
cmtickle / unbuffered_shell_example.php
Created January 31, 2018 14:55
Use unbuffered SQL queries with Magento to reduce memory usage on large data sets.
<?php
require_once 'abstract.php';
class Cmtickle_Demo_Shell_Tool extends Mage_Shell_Abstract
{
private $_readConnection = null;
protected function _getReadConnection()
{
@m0n5t3r
m0n5t3r / varnishgrep
Last active August 29, 2015 14:09
Filter varnishlog output and only display those requests that match a regexp pattern; match is against the whole text, not on indivicual fields; requires gawk (Debian derivatives seem to hate gawk, it's not installed by default)
#!/bin/bash
# Copyright: 2014 Sabin Iacob
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
@m0n5t3r
m0n5t3r / setup.sh
Last active December 16, 2015 07:50
script to install Magento-related essentials on Ubuntu 14.04 servers without puppet
#!/bin/bash
# percona repo
echo 'deb http://repo.percona.com/apt trusty main
deb-src http://repo.percona.com/apt trusty main
' > /etc/apt/sources.list.d/percona.list
apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 1C4CBDCDCD2EFD2A
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@m0n5t3r
m0n5t3r / truncate_logs.sh
Created February 19, 2013 12:00
Magento log cleanup
echo "dataflow_batch_export
dataflow_batch_import
log_customer
log_quote
log_summary
log_summary_type
log_url
log_url_info
log_visitor
log_visitor_info