Skip to content

Instantly share code, notes, and snippets.

<?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 / 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
@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 git@github.com:davidalger/phpworld-talk2.git
composer require alger/module-skeleton:dev-master
bin/magento setup:upgrade -q && bin/magento cache:flush -q
# OR
git clone git@github.com: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 / gist:90ff26a4f9a4c5ce4ebc
Created November 22, 2015 15:41 — forked from prellele/gist:1825744
Using StartSSL Certs with Nginx-Webserver

NOTE: You can check, if your config here:
http://www.sslshopper.com/ssl-checker.html

Decrypt the private key using the password you entered when you created your key:
openssl rsa -in ssl.key -out /etc/nginx/conf/ssl.key

Protect your key from prying eyes:
chmod 600 /etc/nginx/conf/ssl.key

@artmouse
artmouse / letsencrypt.md
Created December 3, 2015 23:48 — forked from g-p-g/letsencrypt.md
Using letsencrypt

Download

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

Generate SSL certificate

@artmouse
artmouse / letsencrypt-cert
Created December 6, 2015 18:57 — forked from mauron85/letsencrypt-cert
Auto refresh LetsEncrypt cert for NGINX
#!/bin/bash
echo "Running as user $USER"
DIR=/home/letsencrypt/letsencrypt
DOMAIN=mydomain.com
$DIR/letsencrypt-auto -a webroot --webroot-path /home/letsencrypt/webroot/ \
--config-dir /home/letsencrypt/etc \
--logs-dir /home/letsencrypt/log \
# /etc/cron.d/ssl
5 00 */14 * * /opt/letsencrypt_yolo.sh 2>&1 | mail -s "reloading certificates" dashie@sigpipe.me
@artmouse
artmouse / 01_setup_lets_encrypt.sh
Created December 6, 2015 19:08 — forked from gene1wood/01_setup_lets_encrypt.sh
Example of how to setup Let's Encrypt on RHEL / CentOS and automate certificate rewnewal
#!/bin/bash
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt/
mkdir -p /var/lib/letsencrypt/global-webroot
echo "Alias /.well-known/acme-challenge /var/lib/letsencrypt/global-webroot/.well-known/acme-challenge" >> /etc/httpd/conf/httpd.conf
cat > /etc/cron.monthly/renew-letsencrypt.sh <<End-of-message
DOMAINS=example.com,www.example.com,foo.example.com,example.org.example.net,www.example.org,www.example.net
@artmouse
artmouse / 0: Magento 1.12 Enterprise multi-store cluster configuration.md
Created February 14, 2016 10:00 — forked from parhamr/0: Magento 1.12 Enterprise multi-store cluster configuration.md
A highly available, fault tolerant, distributed, and load balanced LEMP cluster.

Magento Scaling Hypotheses

Magento’s checkout throughput can increase to at least 8 times its current capacity and up to 26 times more in ideal conditions.

  1. The current checkouts per hour limit for large, real-world Magento stores is 4,500
  2. This limit cannot effectively be increased with more and/or better hardware
  3. The improper type handling in Magento’s SQL code is the cause of the current limit
  4. If one SQL query is fixed, large Magento stores can scale to a new, real-world limit of 120,000 checkouts per hour
  5. For commodity hardware, this new limit might be 36,000 checkouts per hour