Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Marko-M's full-sized avatar

Marko Martinović Marko-M

View GitHub Profile
@Marko-M
Marko-M / gist:e8a7367b8c8699af0346
Last active December 10, 2015 14:16
Redis/Magento 1.x - Current Full Page Cache size in bytes
redis-cli -p 6379
127.0.0.1:6380> SELECT 0
OK
127.0.0.1:6380> KEYS *CAHCE*
1) "zc:k:446_FPC_CACHE_SIZE_CAHCE_KEY"
127.0.0.1:6380> HGET zc:k:446_FPC_CACHE_SIZE_CAHCE_KEY d
"3439338"
@Marko-M
Marko-M / wpa_wlan.sh
Last active December 21, 2015 16:49
Debian based wireless with WPA/WPA2 from CLI
#!/bin/bash
# One time only, to create wpa.conf:
# wpa_passphrase ESSID secret > wpa.conf
# su to root, or use sudo for following commands
su
# Bring the wlan interface up
ifconfig wlan0 up
@Marko-M
Marko-M / git_amend_change_author.sh
Created September 7, 2013 20:19
Git - Amend previous commit to change author
#!/bin/bash
git commit --amend --author="You <you@example.com>"
#!/bin/bash
# magento-transfer-1.sh
# Marko Martinovic
#
# Initiate on a new web server
# Maintenance mode not required
# Prints command traces
set -x
#!/bin/bash
# magento-transfer-2.sh
# Marko Martinovic
#
# Initiate on a destination web server
# Maintenance mode required
# Prints command traces
set -x
@Marko-M
Marko-M / product_attribute_installer.php
Created January 21, 2016 09:03 — forked from antoinekociuba/product_attribute_installer.php
Magento Product Attribute installer script.
<?php
/**
* Product Attribute Installer
*/
try {
/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
@Marko-M
Marko-M / gist:b908556ef3e214129bc5
Last active February 7, 2016 11:23
Magento 2 console install
# Console setup
magento setup:install --base-url=http://magento2.loc/ \
--db-host=localhost --db-name=magento2 --db-user=magento2 --db-password=magento2 \
--admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \
--admin-user=admin --admin-password=magento2 --language=en_US \
--currency=USD --timezone=Europe/Zagreb --use-rewrites=1
@Marko-M
Marko-M / magento_dump_ssh.sh
Last active February 8, 2016 11:00
One-liner dump Magento database trough SSH directly to your machine
#!/bin/bash
# Marko Martinović
# Print command traces
set -x
# SSH user
SSHUSER=""
# SSH host
@Marko-M
Marko-M / magento-template-check.sh
Last active February 19, 2016 08:32
Magento Template Check
#!/bin/bash
grep -Ein "get(Singleton|(Resource)?Model)" $(find -name "*.phtml")
@Marko-M
Marko-M / fpc-block-html-optimize.patch
Last active March 25, 2016 13:44
Magento improvement targeting FPC/block_html compatibility causing one cache storage access per layout block issue
--- app/code/core/Mage/Core/Block/Abstract.php 2016-03-25 14:22:51.934883000 +0100
+++ app/code/local/Mage/Core/Block/Abstract.php 2016-03-25 14:39:53.806883000 +0100
@@ -1,4 +1,17 @@
<?php
+/*
+ * Prevent unnecessary requests to cache storage on
+ *
+ * core_block_abstract_to_html_after
+ *
+ * due to