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 | |
# Directory to store log files in | |
DST=/root/logs | |
# Any logs older than this will be deleted first | |
KEEPDAYS=14 | |
# Create DST if it doesn't exist | |
if [ ! -d "$DST" ]; then |
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 [ -z "$1" ]; then | |
LIST=/tmp/symlink-list.txt | |
echo "Looking for links..." | |
nice -n 19 ionice -c3 find /home -type l -exec ls -ld {} \; > $LIST | |
else | |
LIST=$1 | |
fi | |
NFOWNERS="" | |
NFCNT=0 |
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 | |
if [ $# -lt 1 ]; then | |
echo "No arguments supplied" | |
echo "usage: sh $0 <username>" | |
exit 1 | |
fi | |
if [ ! -d /home/$1 ]; then | |
echo "User doesn't exist" | |
echo "usage: sh $0 <username>" |
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 | |
use warnings; | |
use strict; | |
use Getopt::Long; | |
use Data::Dumper; | |
my $file = ''; | |
my $csv = 0; | |
my $all = 0; | |
GetOptions( |
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/logs | |
# Any logs older than this will be deleted first | |
KEEPDAYS=5 | |
# Create DST if it 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 | |
for i in 1 2; do X=$Y; sleep 1; Y=$(/sbin/ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X ))"; done | tail -1 |
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 i in 1 2; do X=$Y; sleep 1; Y=$(/sbin/ifconfig eth0|grep TX\ bytes|awk '{ print $6 }'|cut -d : -f 2); echo "$(( Y-X ))"; done | tail -1 |
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 | |
/sbin/ifconfig eth0 |grep bytes|cut -d":" -f2|cut -d" " -f1 | |
/sbin/ifconfig eth0 |grep bytes|cut -d":" -f3|cut -d" " -f1 |
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 | |
ps aux | grep $1 | grep -v root | awk '{print $2}' | xargs kill -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 | |
for i in `cat /etc/userdomains| cut -d":" -f1 | grep -v \*`; do grep $i.zip /var/log/messages; done |