Julienl's Blog

un blog de plus ou pas

Aller au contenu | Aller au menu | Aller à la recherche

vendredi, décembre 11 2009

Statistiques Folding@Home sur Conky

Je viens de finir de faire un script pour avoir mes statistiques de Folding@Home dans mon conky.

voici le script {{{ bash cd /tmp #on va dans le répertoire /tmp

wget "http://fah-web.stanford.edu/teamstats/team51.html" && on télécharge la page des stats de la team

  1. récupération des informations qui nous interessent

rank=`cat team51.html | grep julienl | sed -e 's/<^<>*>/ /g' | cut -d' ' -f3` rank_team=`cat team51.html | grep julienl | sed -e 's/<^<>*>/ /g' | cut -d' ' -f5` name=`cat team51.html | grep julienl | sed -e 's/<^<>*>/ /g' | cut -d' ' -f7` points=`cat team51.html | grep julienl | sed -e 's/<^<>*>/ /g' | cut -d' ' -f9` wu=`cat team51.html | grep julienl | sed -e 's/<^<>*>/ /g' | cut -d' ' -f11` team=`cat team51.html | grep julienl | sed -e 's/<^<>*>/ /g' | cut -d' ' -f13`

echo "$rank $rank_team $name $points $wu $team" > /home/julienl/scripts/conkys/folding #on envoi les valeurs dans le fichier pour notre conky

rm /tmp/team51.html

}}}

Nous avons donc notre fichier folding qui contient nos informations, on ajoute ce qu'il faut dans notre .conkyrc

voici par exemple ma partie folding.

{{{ conky

${color lightgrey}Folding@Home :

Name ${alignr}${exec cat /home/julienl/scripts/conkys/folding | cut -d' ' -f3}
Score ${alignr}${exec cat /home/julienl/scripts/conkys/folding | cut -d' ' -f4}
Position mondiale ${alignr}${exec cat /home/julienl/scripts/conkys/folding | cut -d' ' -f1}
Position équipe ${exec cat /home/julienl/scripts/conkys/folding | cut -d' ' -f6} ${alignr}${exec cat /home/julienl/scripts/conkys/folding | cut -d' ' -f2}
Nombres de WU ${alignr}${exec cat /home/julienl/scripts/conkys/folding | cut -d' ' -f5}

}}} et le rendu :

Comme toujours si vous avez des améliorations à apporter à mon script ou autre, les commentaires sont les bienvenus

mercredi, septembre 30 2009

Bannir toutes les IPs bannis par fail2ban totallement

Je voulais bannir toutes les IPs bannis "temporairement" par Fail2ban, donc j'ai fait un petit script bash:

#!/bin/bash

echo "#################Banneuse moulinette#####################\n\n";
echo "creation du fichier temporaire\n";
cat /var/log/fail2ban.log | grep Ban | cut -d" " -f7 > /tmp/iptmp;

for ligne in `cat /tmp/iptmp`;
do
iptables -A INPUT -s $ligne -j DROP;
done

rm /tmp/iptmp;

dimanche, juin 14 2009

Script Bash pour télécharger les RFC en .txt

Souhaitant récupérer toutes les RFC j'ai fait un petit script en bash pour automatiser les téléchargements sur le site de IETF.

#!/bin/bash

for ((i = 1; i < 6000; i++))

do

wget http://www.ietf.org/rfc/rfc$i.txt

done

echo 'Download OK :-)'

S'il y a plus simple ou des améliorations, n'hésitez pas à le dire.