Skip to content

Instantly share code, notes, and snippets.

View magenx's full-sized avatar
👨‍🍳
magento 2 open source web stack

MagenX magenx

👨‍🍳
magento 2 open source web stack
View GitHub Profile
@magenx
magenx / build.sh
Last active February 23, 2024 05:35
#!/bin/bash
## install docker
dpkg-query -l docker >/dev/null || {
curl -fsSL https://get.docker.com -o get-docker.sh
bash get-docker.sh
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 \
-o ~/.docker/cli-plugins/docker-compose
{
"name": "magento/product-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"keywords": [],
"homepage": "",
"version": "2.4.3",
"version_normalized": "2.4.3.0",
"license": ["OSL-3.0", "AFL-3.0"],
"authors": [],
"type": "metapackage",
@magenx
magenx / mage2spam
Last active December 11, 2020 11:24
magento 2 light spammer
#!/bin/bash
curl -k -X POST "$1/rest/V1/customers" \
-H "Content-Type:application/json" \
--data @<(cat <<EOF
{
"customer": {
"extension_attributes": {
"is_subscribed": true
@magenx
magenx / carding.sh
Last active February 10, 2024 04:52
#!/bin/bash
MAGE_BASE_URL="$1"
MAGE_SKU="$2"
PAYMENT_KEY="$3"
PAYMENT_METHOD="$4"
STORE_VIEW="$5"
CREDIT_CARD="$6"
CREDIT_CARD_CVC="$7"
#!/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
Option Meaning
-h, --help Show this message
-l, --status List/Show iptables configuration
-l6, --status6 List/Show ip6tables configuration
-s, --start Start firewall rules
-f, --stop Flush/Stop firewall rules (Note: lfd may restart csf)
-r, --restart Restart firewall rules
-q, --startq Quick restart (csf restarted by lfd)
-sf, --startf Force CLI restart regardless of LFDSTART setting
-a, --add ip Allow an IP and add to /etc/csf.allow
#!/bin/bash
### System Setup ###
DIRS="/var/www/shop/public_html"
BACKUP=/tmp/backup.$$
NOW=$(date +"%d-%m-%Y")
DELDATE=$(date -d "-7 days" +"%d-%m-%Y")
### MySQL Setup ###
MUSER="xxx"
@magenx
magenx / gist:31522a152bd93650022b
Created July 10, 2014 19:24
CIDR -> IP -> MATCH
$cidrs = array(
'192.168.1.20/27',
'192.168.0.10/32'
);
function cidr_match($ip, $range)
{
list ($subnet, $bits) = explode('/', $range);
$ip = ip2long($ip);
$subnet = ip2long($subnet);
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>error</title>
<style>
body {background:#eee;font-size:1em;line-height:1.3;font-family:arial,sans-serif;}
.error {position:relative;width:530px;margin:50px auto;padding:20px 40px;background:#fff;border:10px solid #e0e0e0;box-shadow:0 2px 8px -6px rgba(0,0,0,.2);border-radius:10px;text-align:center}
@magenx
magenx / gist:9604368
Last active August 29, 2015 13:57
Clear apc cache
#!/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