Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🍳
magento 2 ecommerce web stack

MagenX magenx

👨‍🍳
magento 2 ecommerce web stack
View GitHub Profile
View delete_admin.sh
#!/bin/bash
## get n98-magerun2
curl -o /usr/local/bin/magerun2 https://files.magerun.net/n98-magerun2.phar
## reset magento admin password
MAGE_NEW_ADMIN_PASS="$(head -c 500 /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&?=+_[]{}()<>-' | fold -w 15 | head -n 1)${RANDOM}"
read -e -p "---> Enter admin old login: " -i "admin" MAGE_OLD_ADMIN_NAME
@magenx
magenx / gist:9604368
Last active Aug 29, 2015
Clear apc cache
View gist:9604368
#!/bin/bash
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
## monitor app folder and clear apc/opcode cache
/usr/bin/inotifywait -e modify \
-mrq /var/www/html/magento/app | while read line; do
echo -n "$line " >> /var/log/app_monitor.log
echo `date | cut -d " " -f1-4` >> /var/log/app_monitor.log
wget -O /dev/null http://$myip/apc_opcache/apc_clear.php >/dev/null 2>&1
done
@arosenhagen
arosenhagen / index.php
Last active Feb 21, 2020
[magento] multidomain-multistore-multistoreview setup with visible language codes
View index.php

Use these snippets to setup a magento installation with the following structure:

@ck-on
ck-on / ocp.php
Last active Aug 9, 2020
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
View ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@magento-team
magento-team / 2500 config products
Created Nov 8, 2012
Create 2500 configurable products, Magento CE 1.7.0.1
View 2500 config products
<?php
/**
* Error reporting
*/
error_reporting(E_ALL | E_STRICT);
/**
* Compilation includes configuration file
*/
define('MAGENTO_ROOT', getcwd());
You can’t perform that action at this time.