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 / phpmyadmin-localhost-autologin.php
Last active August 29, 2015 14:04
PhpMyAdmin@localhost autologin
<?php
/**
* No activity within 1440 seconds; please log in again >>no more<<
*
* /etc/phpmyadmin/config.inc.php or wherever your PhpMyAdmin config file is
*
*/
$cfg['Servers'][$i]['auth_type']= 'config';
$cfg['Servers'][$i]['user'] = 'whatever';
@Marko-M
Marko-M / Processor.php
Last active August 29, 2015 14:07
Magento Enterprise edition block_html cache ban bugfix
<?php
class Whatever_Whatever_Model_Pagecache_Processor extends Enterprise_PageCache_Model_Processor
{
/**
* Do additional validation for request to be cached. Add condition that request must
* have request subprocessor implemented in order to be considered cacheable.
* Deals with bug found by @tim_bezhashvyly.
*
@Marko-M
Marko-M / magento2-maintenance-mode.sh
Last active February 21, 2017 17:56
Activate maintenance mode on Magento 2 w/ IP address exclusion list
#!/bin/bash
# Comma separated list of IPs to be excluded
echo "123.123.123.123,234.234.234.234">var/.maintenance.ip
# For the rest of the world we go down for maintenance NOW
touch var/.maintenance.flag
@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 / config.php
Created November 29, 2014 17:54
Magento 2 Alpha 106 app/etc/config.php
<?php
return array (
'backend' =>
array (
'frontName' => 'backend',
),
'db' =>
array (
'table_prefix' => '',
'connection' =>
@Marko-M
Marko-M / ubuntu_install_compass.sh
Created December 17, 2014 14:46
Ubuntu install foundation, compass and sass
# Verified: Ubuntu 14.10
sudo apt-get install ruby ruby-dev
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs
sudo npm install -g bower grunt-cli
@Marko-M
Marko-M / varnish-3.x-ubuntu-14.10.sh
Last active August 29, 2015 14:12
Varnish 3.x for Ubuntu 14.10
#!/bin/bash
# Varnish 3.x for Ubuntu 14.10
# Add repository
sudo add-apt-repository ppa:marko-techytalk.info/varnish-3.0
# Update sources
sudo apt-get update
# Install Varnish 3.x
@Marko-M
Marko-M / iptables-port-forward.sh
Last active May 7, 2016 07:08
Forward Vagrant forwarded ports to standard ports using iptables
#!/bin/bash
# Forward relevant Vagrant forwarded ports to standard ports using iptables (adjust 8080, 8443).
# To make persistent install and use "iptables-persistent" package. Just do a
# "sudo iptables-persistent save" and service will reload saved rules on each boot.
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 8443
@Marko-M
Marko-M / magento2-performance-toolkit.sh
Last active March 28, 2023 17:27
Magento2 performance toolkit
#!/bin/bash
# Generate sample data and trigger Magento2 performance toolkit jMeter test plan.
HOST="magento2.loc"
BASE_PATH="/"
USERS=100
RAMP_PERIOD=300
LOOPS=1
ADMIN_USER="magento2"
ADMIN_PASSWORD="magento2"
@Marko-M
Marko-M / magento2-1.0.0-beta-fixed-benchmark.jmx
Last active June 9, 2021 18:09
Magento 2 Merchant Beta fixed performance toolkit benchmark.jmx
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Toolkit" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="host" elementType="Argument">