This file contains hidden or 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
#!/usr/bin/perl | |
%accounts = (); | |
$lines = `grep ^# /var/log/mysql_slow_query.log`; | |
$correctMonth = 0; | |
foreach (split("\n", $lines)) { | |
chomp; | |
if ($_ =~ /# User\@Host: ([a-z0-9_]+)/) { |
This file contains hidden or 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/sh | |
netstat -ntap | awk '{print $5}' | cut -d ":" -f1 | sort | uniq -c | sort -n |
This file contains hidden or 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/sh | |
ps aux | awk '{print $1}' | sort | uniq -c | sort -n |
This file contains hidden or 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 | |
if [ $# -lt 2 ]; then | |
echo "No arguments supplied" | |
echo "usage: sh raise_php_mem_limit.sh <username> <new memory limit value> i.e. raise_php_mem_limit.sh username 64" | |
exit 1 | |
fi | |
if [ ! -d /home/$1 ]; then | |
echo "User doesn't exist" |
This file contains hidden or 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 | |
# Directory to store log files in | |
DST=/root/autotermination_logs | |
# Create DST if it doesn't exist | |
if [ ! -d "$DST" ]; then | |
mkdir -p $DST | |
fi |
This file contains hidden or 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/sh | |
USERS_PATH="/var/cpanel/users" | |
for l in `ls -A $USERS_PATH | grep -v hpspprt` | |
do | |
sed -i '/OWNER=root/s//OWNER=hpspprt/' $USERS_PATH"/"$l | |
done | |
/scripts/updateuserdomains |
This file contains hidden or 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 | |
for rspaths in `grep path /etc/rsyncd.conf |awk '{print $3}'`; do | |
username=`echo $rspaths|awk -F/ '{print $3}'`; | |
realpath=`grep $username /etc/passwd|awk -F: '{print $6}'`; | |
#echo "DEBUG: realpath variable = $realpath"; | |
#echo "DEBUG: rspaths variable = $rspaths"; |
This file contains hidden or 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 | |
if [ $# -lt 1 ]; then | |
echo "No arguments supplied" | |
echo "usage: sh setup_custom_php_ini.sh <username>" | |
exit 1 | |
fi | |
homedir=`grep $1 /etc/passwd|awk -F: '{print $6}'` |
This file contains hidden or 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 | |
# | |
# Bronco May 2014 | |
# | |
CONF=/etc/exim.conf.local | |
CHANGE=0 | |
main() { | |
if [ -n "$(diff $CONF /tmp/exim.conf.local)" ] && [ -f "/tmp/exim.conf.local" ]; then | |
echo "Replacing the config..." | |
mv $CONF /home/bronco/exim.conf.local.$(date +%s) |
This file contains hidden or 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/sh | |
cd /var/clamav/;rm -f daily.cvd;wget http://db.local.clamav.net/daily.cvd; chown clamav: daily.cvd; |