Output 1 sample to a file
top -n 1 -b > top-output.txt
Output 1 sample to an email
top -n 1 -b | mail -s “Here’s my top” me@jamesborder.com
here is the mac version
top -l 1 | mail -s “Here’s my top mac” me@jamesborder.com
Output 1 sample to a file
top -n 1 -b > top-output.txt
Output 1 sample to an email
top -n 1 -b | mail -s “Here’s my top” me@jamesborder.com
here is the mac version
top -l 1 | mail -s “Here’s my top mac” me@jamesborder.com
I wouldn’t deploy this as is but here is a good starting point. Tweek to fit and cron.
#!/bin/bash
### MySQL Server Login Info ###
MUSER="USER"
MPASS="PASSWORD"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
BAK="./dumps"
GZIP="$(which gzip)"
NOW=$(date +"%Y-%m-%d")
[ ! -d $BAK ] && mkdir -p $BAK/$NOW || /bin/rm -f $BAK/*
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
FILE=$BAK/$NOW/$db.$NOW.gz
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done
Send email while your at the teminal….
echo "The body of your email here" | mail -s "The Subject of your email here" me@jamesborder.com
A couple of “useful examples”?
send the last 100 line of the error log to yourself (or to a client that needs to see them but doesn’t know how to get to them)
tail -100 /opt/local/apache2/logs/error_log | mail -s "From error_log" me@jamesborder.com
send the last 10 lines of your command line history to your self
history | tail -10 | mail -s "Howd I do that" me@jamesborder.com
import fl.motion.Color;
var rmColorTransform:Color;
var bgColorTransform:Color;
function highlight_pad(mc):void {
bgColorTransform = new Color();
bgColorTransform.setTint(0x666666, 1); //alpha is second parameter
mc.transform.colorTransform = bgColorTransform;
}
function clear_pad(mc):void {
rmColorTransform = new Color();
rmColorTransform.setTint(0xFF0000 , 0); //alpha is second parameter
mc.transform.colorTransform = rmColorTransform;
}