Skip to content

Instantly share code, notes, and snippets.

@artmouse
artmouse / m2-module-install-2.sh
Created November 20, 2015 23:19 — forked from davidalger/m2-module-install-2.sh
Install module directly or via composer
composer config repositories.alger/phpworld-talk2 vcs [email protected]:davidalger/phpworld-talk2.git
composer require alger/module-skeleton:dev-master
bin/magento setup:upgrade -q && bin/magento cache:flush -q
# OR
git clone [email protected]:davidalger/phpworld-talk2.git app/code/Alger/Skeleton
bin/magento module:enable Alger_Skeleton
bin/magento setup:upgrade -q && bin/magento cache:flush -q
@artmouse
artmouse / magento2-maintenance-mode.sh
Created November 20, 2015 21:06 — forked from Marko-M/magento2-maintenance-mode.sh
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
<?php
/**
* Generate modman file from Magento Connect 2.0 package.xml
*
* Usage:
*
* php package2modman.php path/to/package.xml > path/to/modman
*
*/
require_once(__DIR__ . "/../www/app/Mage.php");
@artmouse
artmouse / local.xml
Created November 9, 2015 23:17 — forked from MikeWilkie/local.xml
Magento – Disable Excessive Logging and Reporting in app/etc/local.xml
<?xml version="1.0"?>
<!-- license -->
<config>
<global>
<!-- global config -->
</global>
<frontend>
<events>
<!-- disble logs -->
<controller_action_predispatch>
@artmouse
artmouse / amshopby-ajax.js
Created November 6, 2015 11:11 — forked from dangtrinhtran/amshopby-ajax.js
Add ajax loading
Amasty_Shopby Extension: js\amasty\amshopby\amshopby-ajax.js
<script type="text/javascript">
//Line 116
/*$$('div.amshopby-overlay').each(function(e){
e.show();
});*/
//Call function at here
jQuery(document).configurationAjax('createLoading');
@artmouse
artmouse / performance.patch
Created November 5, 2015 13:27 — forked from DimaSoroka/performance.patch
Performance improvement for Magento Patch SUPEE-6788
Index: app/code/core/Mage/Admin/Model/Variable.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/code/core/Mage/Admin/Model/Variable.php (revision 2bd128c1f190cd9ea63269824f09789199565251)
+++ app/code/core/Mage/Admin/Model/Variable.php (revision )
@@ -30,6 +30,13 @@
class Mage_Admin_Model_Variable extends Mage_Core_Model_Abstract
{
@artmouse
artmouse / yoast-nulled.php
Created October 16, 2015 19:54 — forked from mihdan/yoast-nulled.php
Занулить yoast-seo-premium
<?php
/**
* 1. В таблице wp_options находим ключ yoast-seo-premium_license или wordpress-seo-premium_license
* и меняем его значение на `a:3:{s:3:"key";s:6:"zalupa";s:6:"status";s:5:"valid";s:11:"expiry_date";s:19:"2970-01-01 00:00:00";}`
*
* 2. Чтобы не слетали все ваши махинации после захода на страницу обновления или проверки лицензии,
* достаточно запретить плагину ломиться по своему АПИ на свой сайт.
* Я это сделал просто: в файле \wordpress-seo-premium\vendor\yoast\license-manager\class-update-manager.php
*/

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
failed (104: Connection reset by peer) while reading response header from upstream, client:
If you are getting the above error in nginx logs running in from of upstream servers you may consider doing this as it worked for me:
check the ulimit on the machines and ensure it is high enough to handle the load coming in. 'ulimit' on linux, I am told determines the maximum number of open files the kernel can handle.
The way I did that?
modifying limits: for open files:
--------------------------------
add or change this line in /etc/systcl.conf
fs.file-max = <limit-number>