6 months ago
$videofile = "fichier.flv";
passthru("ffmpeg -i "{$videofile}" 2>&1");
$search='/Duration: (.*?),/';
$duration=
preg_match($search,
$duration,
$matches, PREG_OFFSET_CAPTURE,
3);
Pour récupérer la durée, en seconde, on peut utiliser cette fonction :
echo hms2sec
($matches[1][0]);
function hms2sec ($hms) {
$seconds = 0;
$seconds +=
(intval($h) *
3600);
$seconds +=
(intval($m) *
60);
return $seconds;
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2052"></script>
6 months ago
tar cvfz myproject.tgz --exclude='path/dir_to_exclude1' --exclude='path/dir_to_exclude2' myproject
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2049"></script>
1 year ago
mysql -u root -p
mysql> show databases;
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1693"></script>
1 year ago
mysql -u root -p -D nom_de_la_base
mysql> status;
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1692"></script>
1 year ago
Exemple avec des fichiers nommés "cp-2008-...." :
for files in cp-2008-* ; do rm -f $file ; done
Autre solution :
find . -name "*.toto" -exec rm {} \;
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1654"></script>
1 year ago
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1560"></script>
1 year ago
wget --timeout=0 -q -t 1 -O - http://127.0.0.1/path/file.php >result.txt 2>result.txt
SORTIE=`cat result.txt | tr '\015\012' ' '`
echo $SORTIE
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1395"></script>
1 year ago
Sous Windows, il faut utiliser Cygwin ou les GNU utilities for Win32 (http://unxutils.sourceforge.net/) :
Mettre les fichiers à "merger" dans un sous-répertoire. Aller dans ce répertoire puis exécuter la commande :
cat * > ../nouveau_fichier.txt
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1373"></script>
1 year ago
Expression POSIX pour supprimer les lignes paires :
Rechercher : ^(.*)\n.*
Remplacer par : \1
Expression POSIX pour supprimer les lignes impaires :
Rechercher : ^.*\n(.*)
Remplacer par : \1
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1372"></script>
1 year ago
wget http://exemple.com/index.php >result.txt 2>result.txt
FICHIER=`sed '/^$/d' result.txt | head -1 | cut -d" " -f2-20`
RETOUR=`sed '/^$/d' result.txt | tail -1`
DATEHEURE=`date "+%Y-%m-%d %H:%m:%S"`
touch flux.log
echo "$DATEHEURE -$FICHIER : $RETOUR" >>flux.log
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1371"></script>