Skip to content

Instantly share code, notes, and snippets.

View AnoopAlias's full-sized avatar
🎯
Focusing

Anoop P Alias AnoopAlias

🎯
Focusing
View GitHub Profile
#!/bin/bash
if ! ps aux |egrep "gsd-soundw|gpg-agent1"|grep -v grep ; then systemctl hibernate; fi
#!/bin/bash
RESELLER="eightyse"
TARGET_HOST="absinthe.hostns.io"
TARGET_HOST_SSH_PORT="22"
for dir in $(cat /etc/userdatadomains|grep -w ${RESELLER}|awk -F"==" '{print $5}')
do
for myfile in $(find ${dir} -iname .htaccess)
do
@AnoopAlias
AnoopAlias / gist:4516221f7fb99cc30d7c78e5bcce8c8d
Last active January 26, 2021 06:34
disable_mail_function
sed -i 's/exec,/exec,mail,/' /opt/nDeploy/conf/php-fpm.pool.j2
rm -f /opt/nDeploy/php-fpm.d/*
/opt/nDeploy/scripts/attempt_autofix.sh
systemctl restart ndeploy_backends
echo "*/5 * * * * root /opt/nDeploy/nDeploy_whm/abnormal_process_detector.cgi" >> /etc/crontab
service crond restart
wget -O /scripts/setrealip https://gist.githubusercontent.com/AnoopAlias/e5f145d1f31047d067f1a49f6d62d3c3/raw/68fc5c3aa024891e8efc266b91855113be9bb432/setrelip && chmod +x /scripts/setrealip && echo "5 * * * * root /scripts/setrealip" >> /etc/crontab
#!/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
echo "*/10 * * * * root /opt/nDeploy/nDeploy_whm/abnormal_process_detector.cgi > /dev/null" >> /etc/crontab && systemctl restart crond
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 "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
@AnoopAlias
AnoopAlias / gist:fdbd91554134038f11d6a7986f90e060
Last active November 3, 2019 14:13
upgrade-autom8n-4.9-to-4.10.sh
# 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