This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -k -X POST "$1/rest/V1/customers" \ | |
-H "Content-Type:application/json" \ | |
--data @<(cat <<EOF | |
{ | |
"customer": { | |
"extension_attributes": { | |
"is_subscribed": true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
NewerOlder