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 / 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
@magenx
magenx / gist:9604286
Created March 17, 2014 17:37
Get firewall messages sorted
grep Firewall messages | sed -r 's/.*SRC=(\S+).*PROTO=(\S+).*DPT=(\S+).*/\1 \2 \3/' | sort | uniq -c | sort -r -n