Skip to content

Instantly share code, notes, and snippets.

@rushipkar90
rushipkar90 / rushi.txt
Last active June 1, 2023 19:07
rushi.txt
prestashop - 500 error
===================
https://www.prestashop.com/forums/topic/421126-request-exceeded-the-limit-of-10-internal-redirects-due-to-probable-configuration-error/
===================
CloudFlare installation:
==========
http://www.cpanelkb.net/cloudflare-plugin-install/
http://crybit.com/install-cloudflare-plugin-on-cpanel/
http://stackoverflow.com/questions/23860877/how-to-install-cloudflare-on-cpanel-servers
@rushipkar90
rushipkar90 / gist:e3a724885664420215c2
Created September 11, 2015 15:12
OpenVZ Commands
For OpenVZ refer this URL: (https://openvz.org/User_Guide/Operations_on_Containers)
=======================
vzlist -a ------ To list all the containers on OpenVZ including running and stopped.
vzlist -a 101 ----- To check specific container is present or not (101 => Container ID)
/vz/template/cache ------ Contains all the OS templates
/vz/private/ ----- it contains list of all the existing containers.
@rushipkar90
rushipkar90 / gist:ad4ddcb000e8cc38b9cd
Created September 11, 2015 15:15
MySqladmin commands
URL: http://www.tecmint.com/mysqladmin-commands-for-database-administration-in-linux/
20 MySQL (Mysqladmin) Commands for Database Administration in Linux
========================
1. How to set MySQL Root password?
=> # mysqladmin -u root password YOURNEWPASSWORD
2. How to Change MySQL Root password?
=> mysqladmin -u root -p123456 password 'xyz123'
mysql -u root -p
Enter server root password ( #cat /root/.my.cnf)
CREATE DATABASE databasename;
CREATE USER username@localhost;
SET PASSWORD FOR username@localhost= PASSWORD("password");
@rushipkar90
rushipkar90 / gist:3776a191adaa860a8c5e
Created September 11, 2015 15:17
Installing CDP Agent (R1Soft slave)
Installing Agent on CentOS, RHE and Fedora (Refer this URL: http://wiki.r1soft.com/display/CDP3/Installing+Agent+on+CentOS,+RHE+and+Fedora)
Please do the below steps on the slave server on which we would like to install CDP agent
========================================
There two ways by using which you can install the agent
1) Installing Agent Using YUM
2) Install Agent Manually (Using RPM)
@rushipkar90
rushipkar90 / accountdetails.sh
Created September 25, 2015 16:12
accountdetails.sh
#/bin/bash
echo > accountdetails;
read -p "Enter the Post Migration username : " prompt
echo "===========================" >> accountdetails;
echo "----- Account Size -----" >> accountdetails;
echo "===========================" >> accountdetails;
du -sh /home/$prompt >> accountdetails;
du -sm /home/$prompt >> accountdetails;
echo "===========================" >> accountdetails;
echo "----- File Count -------" >> accountdetails;
@rushipkar90
rushipkar90 / capped_bwlimit.sh
Created September 25, 2015 16:13
capped_bwlimit.sh
#/bin/bash
hname=`hostname`;
echo > /usr/local/src/bw_limit.txt;
echo > /usr/local/src/bw_limit1.txt;
echo > /usr/local/src/cappedresults.txt;
find /usr/local/apache/conf/userdata/*/*/*/*/ -name "cp_bw_all_limit.conf" > /usr/local/src/bw_limit.txt
find /usr/local/apache/conf/userdata/*/*/*/ -maxdepth 1 -name "cp_bw_all_limit.conf" > /usr/local/src/bw_limit1.txt
echo "Hostname" ";" "Username" ";" "Domain Name" ";" "Bandwidth Limit" >> capped.csv
for i in `cat /usr/local/src/bw_limit.txt`; do
{
@rushipkar90
rushipkar90 / maliciousmail-mod.sh
Created September 25, 2015 16:13
maliciousmail-mod.sh
#/bin/bash
echo > /usr/local/src/temp_eximlog
echo > /usr/local/src/maliciousresults
echo > /usr/local/src/maliciousfiles
a=`date --date="5 hours ago" +%Y-%m-%d\ %H`
b=`date +%Y-%m-%d\ %H`
awk -v s="$a" -v e="$b" '$0~s,$0~e' /var/log/exim_mainlog >> /usr/local/src/temp_eximlog
cat /usr/local/src/temp_eximlog | awk '{print $3}' | grep /home | sort | uniq -c | sort -nr > scanmaillogdir.txt
for i in `cat /usr/local/src/scanmaillogdir.txt | cut -d= -f2` ; do
find $i -type f -name '*.php' -exec egrep -q 'yMxbgVDJ96|wUu2jGoB|$xYEzDu6r3EZT|$ZR2%tuMpYFr|$knmui74|x47LOBA|EWnBCG-hUfK|vC82XHO|rOqYibX4WA|ALaEJ!Pw|vHHEE8M|v08X2QH|vO5CQ7A' {} \; -print >> /usr/local/src/maliciousfiles
@rushipkar90
rushipkar90 / maliciousmail.sh
Created September 25, 2015 16:14
maliciousmail.sh
#/bin/bash
echo > /usr/local/src/temp_eximlog
echo > /usr/local/src/maliciousresults
echo > /usr/local/src/maliciousfiles
a=`date --date="5 hours ago" +%Y-%m-%d\ %H`
b=`date +%Y-%m-%d\ %H`
awk -v s="$a" -v e="$b" '$0~s,$0~e' /var/log/exim_mainlog >> /usr/local/src/temp_eximlog
cat /usr/local/src/temp_eximlog | awk '{print $3}' | grep /home | sort | uniq -c | sort -nr > scanmaillogdir.txt
for i in `cat /usr/local/src/scanmaillogdir.txt | cut -d= -f2` ; do
find $i -type f -name '*.php' -exec egrep -q 'yMxbgVDJ96|wUu2jGoB|$xYEzDu6r3EZT|$ZR2%tuMpYFr|$knmui74|x47LOBA|EWnBCG-hUfK|vC82XHO|rOqYibX4WA|ALaEJ!Pw|vHHEE8M|v08X2QH|vO5CQ7A' {} \; -print >> /usr/local/src/maliciousfiles
@rushipkar90
rushipkar90 / modsecuritycheck.sh
Created September 25, 2015 16:14
modsecuritycheck.sh
#/bin/bash
read -p "Enter the IP address/domain : " prompt
konta=`find /usr/local/apache/logs -name "error_*" -mtime -1 | grep -v "gz"`
for i in $konta ; do
echo $i;
grep Security "$i" | grep $prompt > /usr/local/src/mod_security.txt;
total=`cat /usr/local/src/mod_security.txt | wc -l`;
#results=`cat $i | grep Security | grep $prompt`
#echo $results;
echo $total