[Linux-Biella] mini script per ammazzare firefox...
PaulTT
paultt a bilug.linux.it
Ven 29 Lug 2011 19:16:38 CEST
...che quando non usato, occupa troppa cpu, e flash rompe pesantemente
le balle
miniscript che ammazza flash e limita cpu al 3%
PS si' e' ottimizzabile, ma torna utile anche grezzo cosi'....
#!/bin/sh
PTT_GREP=$1
if [ "x$PTT_GREP" == "x" ]; then
$PTT_GREP="firefox"
fi
PTT_PID=`ps ax | grep fire | grep -v plugin-container | grep $1`
echo $PTT_PID
PTT_PID=`echo $PTT_PID | awk '{ print $1 }'`
PTT_FPID=`ps ax | grep libflash | grep plugin-container | grep $PTT_PID`
if [ "x$PTT_FPID" != "x" ]; then
PTT_FPID=`echo $PTT_FPID | awk '{ print $1 }'`
echo "Killing flash at $PTT_FPID..."
kill -9 $PTT_FPID
fi
echo "Limiting browser at $PTT_PID..."
cpulimit -l 3 -p $PTT_PID 2>&1 > /dev/null
--
This is probably one big reason why GIT and I don’t get on so well;
it’s written for somebody else’s use case where the most common use
case is committing nothing.
Maggiori informazioni sulla lista
Linux