Recent posteets

Sort by: Date / Title /

  1. 1 day ago by bobuse
    1. dcop --user $USER --session `dcop --user $USER --list-sessions | grep DCOP`  ksmserver ksmserver logout 0 0 0
  2. 1 day ago by spirit
    quick tutorial
    1. # Enable ssl
    2. a2enmod ssl
    3.  
    4. # Edit /etc/apache2/ports.conf and add "Listen 443"
    5.  
    6. # Generate certs: use your domain as Common Name or *.domain.tld for multiple domains
    7. openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /etc/apache2/server.crt -keyout /etc/apache2/server.key
    8.  
    9. # In the virtualhost, use the following code:
    10. <VirtualHost 192.168.0.1:443>
    11.         SSLEngine On
    12.         SSLCertificateFile /etc/apache2/server.crt
    13.         SSLCertificateKeyFile /etc/apache2/server.key
    14. </VirtualHost>
    15.  
    16. # Reload apache2
    17. /etc/init.d/apache2 reload
  3. 2 days ago by spirit
    By default, MySQL's datadir is placed in the /var/lib/mysql directory. However, if you are planning on using MySQL tables to store a lot of data and your /var partition is small, it might cause you problem at a later stage. In such a scenario, it is better to move the MySQL's datadir to another partition
    Steps:
       1. Stop your mysql server before starting this operation
       2. Create the directories that will be new datadir
       3. chown the directory to the mysql:mysql user
       4. copy the files from the old datadir to the new location (cp -p : preserves ownership). However, make sure that the files
           named ib_arch_log_0000000000, ib_logfile0 etc. are not copied to the newer location
       5. Make sure that the files and directories are owned by mysql user
       6. Make changes in the my.cnf to point the new datadir (datadir = /my/new/dir/)
       7. Restart the MySQL database
       8. Create a new database and verify that the files for this database are getting created in the new datadir (create database test)
       9. After the server is running for a few days properly, get rid of the old data.
  4. 2 days ago by spirit
    1. if (PHP_SAPI === 'cli')
    2.     // In CLI mode
  5. 2 days ago by spirit
    1. # If you have never set a root password for MySQL
    2. mysqladmin -u root password MYPASS
    3.  
    4. # if you want to change (or update) a user password
    5. mysqladmin -u MYUSER -p OLDPASS NEWPASS
  6. 1 week ago by jacinmontava
    1. $tiempo_inicio = microtime(true);
    2.  
    3. mifunciondelaostia();
    4.  
    5. $tiempo_final = microtime(true);
    6. $tiempo = $tiempo_final - $tiempo_inicio;
    7.  
    8. echo "Ha tardado ",$tiempo," segundos";
  7. 1 week ago by matt
    -e filename
        True if filename exists.
    -d filename
        True if filename exists and is a directory.
    -f filename
        True if filename exists and is a plain file.
    -h filename
        True if filename exists and is a symbolic link.
    -r filename
        True if filename exists and is readable.
    -w filename
        True if filename exists and is writable.
    -n string
        True if the length of string is non-zero.
    -z string
        True if the length of string is zero.
    string
        True if string is not the empty string.
    s1 = s2
        True if the strings s1 and s2 are identical.
    s1 != s2
        True if the strings s1 and s2 are not identical.
    n1 -eq n2
        True if the numbers n1 and n2 are equal.
    n1 -ne n2
        True if the numbers n1 and n2 are not equal.
    n1 -gt n2
        True if the number n1 is greater than n2.
    n1 -ge n2
        True if the number n1 is greater than or equal to n2.
    n1 -lt n2
        True if the number n1 is less than n2.
    n1 -le n2
        True if the number n1 is less than or equal to n2.
    ! expression
        Negates expression, that is, returns true iff expression is false.
    expr1 -a expr2
        True if both expressions, expr1 and expr2 are true.
    expr1 -o expr2
        True if either expression, expr1 or expr2 is true.
    ( expression )
        True if expression is true. This allows one to nest expressions.
  8. sponsorised links
  9. 1 week ago by jacinmontava
    1. <?php
    2.  
    3.    if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Googlebot' ) !== false )
    4.    {
    5.          // Tu direccecion de correo
    6.          $email_address = 'tu@tudominio.com ';
    7.  
    8.          // Enviate el email
    9.          mail($email_address,'Alerta de Googlebot',
    10.          'El Googlebot ha visitado tu pagina: '.$_SERVER['REQUEST_URI']);
    11.    }
    12. ?>
  10. 2 weeks ago by benoitbalon
    1. mencoder -vf pp=ci -oac mp3lame -lameopts cbr:br=128 -ovc xvid -xvidencopts bitrate=1200 video_en_entree.avi -o video_en_sortie.avi
  11. 2 weeks ago by benoitbalon
    Ce petit script permet de renommer des photos avec leurs date et heure de prise. Dans le cas de photos prises par différents appareils, cela permet de toutes les réordonner par heure de prise de vue (si toutefois les appareils photos sont tous configurés à la bonne date et à la bonne heure).
    1. #!/bin/bash
    2.  
    3. repertoire=$1
    4. nomsortie=$2
    5.  
    6. # Lancement de l'outil d'ImageMagick
    7. traite_exif ()
    8. {
    9.         exif=`identify -verbose -quiet "$i" 2>> /dev/null | grep 'xif:DateTime:' | tr -d ' '`
    10.         if test "$exif" = "";then continue;fi
    11.         annee=`echo $exif | cut -d ':' -f3`
    12.         mois=`echo $exif | cut -d ':' -f4`
    13.         jour=`echo $exif | cut -d ':' -f5 | cut -c1-2`
    14.         heure=`echo $exif | cut -d ':' -f5 | cut -c3-4`
    15.         minute=`echo $exif | cut -d ':' -f6`
    16.         seconde=`echo $exif | cut -d ':' -f7`
    17.         date_complete=`printf '%s_%s_%s_%sh%sm%s_%s.jpg' $annee $mois $jour $heure $minute $seconde "$nomsortie"`
    18.         echo "${date_complete}"
    19.         cp $i $repertoire/$nomsortie/$date_complete
    20. }
    21.  
    22. # On verifie qu'un repertoire a ete entre
    23. if test "$repertoire" = ""
    24. then
    25.         echo "Veuillez preciser le repertoire de photos a traiter !"
    26.         exit 1
    27. fi
    28.  
    29. # On verifie qu'un nom a ete entre
    30. if test "$nomsortie" = ""
    31. then
    32.         echo "Veuillez preciser un nom de fichier generique a donner a vos photos !"
    33.         exit 2
    34. fi
    35.  
    36. # On verifie que le programme identify existe
    37. which identify >> /dev/null 2>> /dev/null
    38. identify_exists=`echo $?`
    39. if test $identify_exists -ne 0
    40. then
    41.         echo "Veuillez installer ImageMagick !"
    42.         exit 1
    43. fi
    44.  
    45. mkdir $repertoire/$nomsortie
    46.  
    47. ls -b1 $repertoire/* | while read i
    48. do
    49.         nb_char=`echo -n "$i" | wc -c`
    50.         prem_char=`expr $nb_char - 3`
    51.         extension=`echo "$i" | cut -c${prem_char}-${nb_char} | tr a-z A-Z`
    52.         if test "JPEG" = "$extension" || test ".JPG" = "$extension"
    53.         then
    54.                 traite_exif "$i"
    55.         fi
    56. done

First / Previous / Next / Last / Page 1 of 45 (448 posteets)