Skip to content

Instantly share code, notes, and snippets.

@JeroenBoersma
JeroenBoersma / Amasty Product Feed - Local File disclosure.md
Last active October 21, 2016 01:05
Amasty Product Feed - Local file disclosure

Amasty Product Feed - Local file disclosure

  • Affects: Amasty (Product-) Feed (Magento 1)
  • Date: 2016-07-20 (updated: 2016-07-26)
  • Author: Jeroen Boersma

Affected versions:

@jhoelzl
jhoelzl / .bashrc
Last active August 9, 2016 16:32
Generate modman mapping file for each module file individually
# Add this command to your .bashrc and then use "gm" in your Magento modman folder to create a modman mapping file
# Generate modman
function gm() {
for i in `find . -type f | grep -v \.git/ | grep -v "^.$" | grep -v "modman" | sed 's/\.\///'`; do echo -e ${i}' '${i};done > modman
}
@raybogman
raybogman / SupportDesk_FixAcl.php
Last active July 6, 2018 19:00
SupportDesk_FixAcl
<?php
/**
* SupportDesk_FixAcl.php v1.1
* SupportDesk (www.supportdesk.nu)
* 10/7/2015
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL:
@schmengler
schmengler / PATCH_SUPEE-5994_EE_1.14.1.0_v1-2015-05-14-05-05-02-without-downloader.sh
Created May 15, 2015 09:11
Magento Security Patch SUPEE-5994 (Magento CE 1.6 - 1.9 / EE 1.11 - 1.14) WITHOUT DOWNLOADER PATCHES
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@navarr
navarr / template\page\html\breadcrumbs.phtml
Last active April 30, 2019 13:55
Magento Semantic Breadcrumbs
<?php
if (empty($crumbs) || !is_array($crumbs)) {
return;
}
$_crumbItems = array();
$_crumbCount = 1;
$_crumbTotal = count($crumbs);
@fbrnc
fbrnc / gist:a758315e2d9af024ab0f
Last active March 11, 2018 07:49
What's wrong with Catalogrule's cron job?

catalogrule/observer::dailyCatalogUpdate called by the catalogrule_apply_all cron job will delete block caches every night:

https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/code/core/Mage/CatalogRule/Model/Rule.php#L319

What's wrong with this?

  1. It shouldn't do this if there are no catalog rules in the first place.
  2. Even if there are catalog rules it should check if the current execution time is close to any job's start or stop date and only flush caches then.
  3. The configuration (https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/code/core/Mage/CatalogRule/etc/config.xml#L102-104) basically only allows adding caches, but not removing any caches.
  4. Cleaning caches - if actually required - should happen after reindexing. It's not safe to assume that noone will hit any affected page after it was cleaned and before the indexers are done.
@aleron75
aleron75 / shell_delete_unused_images
Last active August 22, 2024 16:57
Delete no more used Product Images on Magento 1
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
@avoelkl
avoelkl / gist:49563c516d6cb318eb34
Last active June 5, 2024 12:41
Non-blocking and quick database dumps for large databases

How-to

Add --single-transaction and --quick to your mysqldump command.

--single-transaction

sets the isolation mode to REPEATABLE READ and starts a transaction before dumping data. useful for InnoDB tables, dumps the consistent state without blocking any applications.

--quick

@tobi-pb
tobi-pb / migrate.sh
Last active March 3, 2023 23:34
Upgrade MAMP to Mysql 5.6
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.tar.gz
tar xfvz mysql-5.6*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@colinmollenhour
colinmollenhour / Config.php
Last active April 22, 2020 09:45
Stampede-resistant Config Cache
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php