Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Anoop P Alias AnoopAlias

🎯
Focusing
View GitHub Profile
View cronaddsetrealip
wget -O /scripts/setrealip https://gist.githubusercontent.com/AnoopAlias/e5f145d1f31047d067f1a49f6d62d3c3/raw/68fc5c3aa024891e8efc266b91855113be9bb432/setrelip && chmod +x /scripts/setrealip && echo "5 * * * * root /scripts/setrealip" >> /etc/crontab
View setrelip
#!/bin/bash
echo > /etc/nginx/conf.d/custom_include.conf
echo "set_real_ip_from 192.168.0.0/16;" >> /etc/nginx/conf.d/custom_include.conf
echo "set_real_ip_from 127.0.0.0/8;" >> /etc/nginx/conf.d/custom_include.conf
echo "set_real_ip_from $(hostname -i);" >> /etc/nginx/conf.d/custom_include.conf
for ip in $(cat /etc/ips|cut -d: -f1)
do
echo "set_real_ip_from $ip;" >> /etc/nginx/conf.d/custom_include.conf
done
nginx -s reload
View malware check
echo "*/10 * * * * root /opt/nDeploy/nDeploy_whm/abnormal_process_detector.cgi > /dev/null" >> /etc/crontab && systemctl restart crond
View nDeploy-4.10-51 upgrade standalone
yum -y --enablerepo=ndeploy upgrade
/opt/nDeploy/scripts/attempt_autofix.sh
systemctl restart nginx
View nDeploy-4.10-51 upgrade cluster
ansible -i /opt/nDeploy/conf/nDeploy-cluster/hosts ndeployslaves -m shell -a "yum -y --enablerepo=ndeploy upgrade"
yum -y --enablerepo=ndeploy upgrade
/opt/nDeploy/scripts/attempt_autofix.sh
systemctl restart nginx
ansible -i /opt/nDeploy/conf/nDeploy-cluster/hosts ndeployslaves -m shell -a "systemctl restart nginx"
cd /opt/nDeploy/conf/nDeploy-cluster/
ansible-playbook -i ./hosts cluster.yml
View gist:fdbd91554134038f11d6a7986f90e060
# Do on master
yum -y --enablerepo=ndeploy upgrade *nDeploy* gnusys-monitoring
rm -f /opt/nDeploy/conf/XTENDWEB_MAXSCALE_SETUP_LOCK_DO_NOT_REMOVE
ansible -i /opt/nDeploy/conf/nDeploy-cluster/hosts ndeployslaves -a "yum -y --enablerepo=ndeploy upgrade *nDeploy* gnusys-monitoring"
ansible -i /opt/nDeploy/conf/nDeploy-cluster/hosts ndeployslaves -a "rm -f /opt/nDeploy/conf/XTENDWEB_MAXSCALE_SETUP_LOCK_DO_NOT_REMOVE"
cp -p /opt/nDeploy/conf/nDeploy-cluster/hosts /opt/nDeploy/conf/nDeploy-cluster/hosts.orig
/opt/nDeploy/scripts/ini2yaml < /opt/nDeploy/conf/nDeploy-cluster/hosts > /opt/nDeploy/conf/nDeploy-cluster/hosts.yaml
cp -p /opt/nDeploy/conf/nDeploy-cluster/hosts.yaml /opt/nDeploy/conf/nDeploy-cluster/hosts
View csf
echo "1 * * * * /usr/sbin/csf -e > /dev/null" >> /var/spool/cron/root
View sample_nginx.conf
user nobody;
worker_processes 1;
worker_rlimit_nofile 69152;
worker_shutdown_timeout 10s;
timer_resolution 1s;
thread_pool iopool threads=32 max_queue=65536;
pcre_jit on;
pid /var/run/nginx.pid;
error_log /var/log/nginx/error_log;
View install libmodsecurity
#!/bin/bash
#Author: Anoop P Alias
##Vars
MODSEC_VERSION="3.0"
MODSEC_RPM_ITER="1.el7"
rm -rf /opt/libmodsec ModSecurity
yum install gcc-c++ flex bison yajl yajl-devel curl-devel curl GeoIP-devel doxygen zlib-devel pcre-devel
git clone https://github.com/SpiderLabs/ModSecurity
View keybase.md

Keybase proof

I hereby claim:

  • I am AnoopAlias on github.
  • I am gnusys (https://keybase.io/gnusys) on keybase.
  • I have a public key whose fingerprint is 3EDA E5B4 A4D8 E5A1 456E C3E3 3AE2 64F9 8754 DDD7

To claim this, I am signing this object:

You can’t perform that action at this time.