Skip to content

Instantly share code, notes, and snippets.

View piotrekkaminski's full-sized avatar

Piotr Kaminski piotrekkaminski

View GitHub Profile
@piotrekkaminski
piotrekkaminski / gist:9bc45ec84028611d621e
Last active August 8, 2023 08:38
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/help
4) Profit!
(function() {
document.cookie = "username=John Doe";
alert("Setting cookie");
})();
@piotrekkaminski
piotrekkaminski / MPERF-10565.diff
Created April 8, 2019 18:04
MPERF-10565.diff - logging to a file that does not exist issue
diff --git a/app/Mage.php b/app/Mage.php
index 0e650eebb4f..9c18e222689 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
',',
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
);
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
$logDir = self::getBaseDir('var') . DS . 'log';
@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Created September 5, 2014 20:18
SUPEE-389: Every time the catalog URL is rendexed, a new custom rewrite is created
#!/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=""
@piotrekkaminski
piotrekkaminski / MPERF-10509.diff
Last active March 12, 2019 20:16
MPERF-10509.diff
diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
index d402b7512dd..8f58e873b46 100644
--- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
+++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
@@ -19,7 +19,7 @@ class Mage_Adminhtml_Block_Dashboard_Graph extends Mage_Adminhtml_Block_Dashboar
/**
* Api URL
*/
- const API_URL = 'http://chart.apis.google.com/chart';
+ const API_URL = 'https://image-charts.com/chart';

Fixed a Redis configuration issue that incorrectly enabled session locking for Magento Commerce v2.1.11+ and v2.2.1+, which can cause slow performance and timeouts. Now, session locking is disabled by default. The issue was caused by a change in the default behavior of the disable_locking parameter introduced in v1.3.4 of the Redis session handler package, colinmollenhour/php-redis-session-abstract. Background:

In Magento 2.2.1+, 2.1.11+, 2.3.0+ colinmollenhour/php-redis-session-abstract composer dependency has been updated and as a result Redis setting "disable_locking" became disabled. It causes a lot of issues (list of customer tickets) To Do:

This setting should be enabled for all clients by default: in the php-redis-session-abstract-1.3.3 and earlier versions "disable_locking=1" means "use locking" (https://github.com/colinmollenhour/php-redis-session-abstract/blob/v1.3.3/src/Cm/RedisSession/Handler.php#L131) in the php-redis-session-abstract-1.3.4 and higher "disable_locking=1" means "do not use lo

@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-11043_EE_1.14.4.0_v1.sh
Created December 4, 2018 16:03
PATCH_SUPEE-11043_EE_1.14.4.0_v1.sh
#!/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=""
@piotrekkaminski
piotrekkaminski / invalid_session_fix.patch
Created March 14, 2018 17:08
Revert guest checkout account registration problem introduced by patch SUPEE-10570. Note: this does not protect against security issues related to session lifetime.
diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
index 59b3ea8..35155f1 100644
--- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
+++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
@@ -485,7 +485,7 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object
&& isset($validatorData[self::VALIDATOR_PASSWORD_CREATE_TIMESTAMP])
&& isset($sessionData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP])
&& $validatorData[self::VALIDATOR_PASSWORD_CREATE_TIMESTAMP]
- > $sessionData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP] - $this->getCookie()->getLifetime()
+ > $sessionData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP]
#!/bin/bash
docker-compose exec --user magento2 web bash -c "cd /var/www/magento2 ; $*"
@piotrekkaminski
piotrekkaminski / PR38.patch
Last active December 1, 2017 20:59
PR38 - Jan14 hackathon
From 3fdfd8454165c89d002da943e79d7aff9c1f560d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Manuel=20Marti=CC=81nez=20Garci=CC=81a?=
<jose@theagilemonkeys.com>
Date: Thu, 20 Feb 2014 00:05:06 +0000
Subject: [PATCH] The fields taxvat and email have been added to
shoppingCartCustomerEntity and shoppingCartCustomerAddressEntity
respectively, inside SOAP API files for Checkout
---
app/code/core/Mage/Checkout/etc/wsdl.xml | 2 ++