dimanche 27 janvier 2013

Rotation de vidéos


RAAHHH, ces vidéos mal tournées, ça fait flipper ! ;)
Et hop un petit script pour roter ;) automatiquement et encoder ces sa***** de .MOV de nos IPhone ch**** !



#!/bin/bash 
OIFS="$IFS"
IFS=$'\n' 
FAILED="";

for FILE in `find ./ -iname \*.MOV` ;
do
DATE=`stat -c %y $FILE |cut -c1-17|sed 's/[- :]//g'`
DATE="$DATE.00"
echo "Traitement de $FILE ($DATE)"
ROTATION=`mediainfo  --Inform="Video;%Rotation%" $FILE`
case "$ROTATION" in
"0.000")
mencoder -really-quiet -oac mp3lame -lameopts abr:br=56 -ovc x264 -x264encopts subq=5:partitions=all:8x8dct:frameref=2:bframes=3:b_pyramid=normal:weight_b $FILE -o $FILE.avi
RES=$?
;;
"90.000")
echo "=> Rotation 90° !"
mencoder -really-quiet -oac mp3lame -lameopts abr:br=56 -ovc x264 -x264encopts subq=5:partitions=all:8x8dct:frameref=2:bframes=3:b_pyramid=normal:weight_b -vf rotate=0 $FILE -o $FILE.avi
RES=$?
;;

"180.000")
echo "=> Retournement !"
mencoder -really-quiet -oac mp3lame -lameopts abr:br=56 -ovc x264 -x264encopts subq=5:partitions=all:8x8dct:frameref=2:bframes=3:b_pyramid=normal:weight_b -vf flip,mirror $FILE -o $FILE.avi
RES=$?
;;

*)
echo "=> Rotation $ROTATION non gérée !"
RES=1;
;;
esac
echo "Résultat : $RES";
touch -t $DATE $FILE.avi
if [ $RES == 0 ]; then
vlc $FILE.avi
echo "OK ? (O/n)"
read rep
REP=`echo $rep| tr -s a-z A-Z`
if [ $rep == "N" ]; then
FAILED="$FAILED \n $FILE";
rm $FILE.avi
else
rm $FILE
fi
fi
done
echo -e "Fichiers en échec : \n $FAILED"
rename 's/MOV\.avi/avi/' *.MOV.avi
IFS=$OIFS

mercredi 16 janvier 2013

Checking pfSense with SNMP


Checking pfSense with SNMP

Command examples for monitoring a pfSense router using SNMP.
snmpwalk -v 1 -c public
Interface list
snmpwalk -v 1 -c public | grep ifDescr
Interface status
snmpwalk -v 1 -c public | grep ifOperStatus
Source : Production Monkeys  

AMHA, ça sert à rien sans un bon Zabbix...