cyo  [ Profile ]

Sort by: Date / Title /

  1. 6 months ago
    1. $videofile = "fichier.flv";
    2.  
    3. passthru("ffmpeg -i "{$videofile}" 2>&1");
    4. $duration = ob_get_contents();
    5.  
    6. $search='/Duration: (.*?),/';
    7. $duration=preg_match($search, $duration, $matches, PREG_OFFSET_CAPTURE, 3);
    8.  
    9. echo $matches[1][0];
    10.  
    11.  
    12. Pour récupérer la durée, en seconde, on peut utiliser cette fonction :
    13.  
    14. echo hms2sec($matches[1][0]);
    15.  
    16.  
    17. function hms2sec ($hms) {
    18.         list($h, $m, $s) = explode (":", $hms);
    19.         $seconds = 0;
    20.         $seconds += (intval($h) * 3600);
    21.         $seconds += (intval($m) * 60);
    22.         $seconds += (intval($s));
    23.         return $seconds;
    24. }
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2052"></script>
  2. 6 months ago
    1. 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>
  3. 1 year ago
    1. mysql -u root -p
    2. mysql> show databases;
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1693"></script>
  4. sponsorised links
  5. 1 year ago
    1. mysql -u root -p -D nom_de_la_base
    2. mysql> status;
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1692"></script>
  6. 1 year ago
    1. Exemple avec des fichiers nommés "cp-2008-...." :
    2. for files in cp-2008-* ; do rm -f $file ; done
    3.  
    4. Autre solution :
    5. find . -name "*.toto" -exec rm {} \;
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1654"></script>
  7. 1 year ago
    1. du -sh
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1560"></script>
  8. 1 year ago
    1. wget --timeout=0 -q -t 1 -O -  http://127.0.0.1/path/file.php >result.txt 2>result.txt
    2. SORTIE=`cat result.txt | tr '\015\012' ' '`
    3. echo $SORTIE
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1395"></script>
  9. 1 year ago
    Sous Windows, il faut utiliser Cygwin ou les GNU utilities for Win32 (http://unxutils.sourceforge.net/) :
    1. Mettre les fichiers à "merger" dans un sous-répertoire. Aller dans ce répertoire puis exécuter la commande :
    2.  
    3. cat * > ../nouveau_fichier.txt
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1373"></script>
  10. 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>
  11. 1 year ago
    1. wget http://exemple.com/index.php >result.txt 2>result.txt
    2. FICHIER=`sed '/^$/d' result.txt | head -1 | cut -d" " -f2-20`
    3. RETOUR=`sed '/^$/d' result.txt | tail -1`
    4. DATEHEURE=`date "+%Y-%m-%d %H:%m:%S"`
    5. touch flux.log
    6. echo "$DATEHEURE -$FICHIER : $RETOUR" >>flux.log
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1371"></script>

First / Previous / Next / Last / Page 1 of 4 (36 posteets)