cyo  [ Profile ]

Sort by: Date / Title /

  1. 3 days ago
    1. Exemple pour créer un fichier compressé à partir d’un répertoire de log (il s’agit du dernier paramètre, ici le nom du répertoire est la date au format YYYY-MM-DD) :
    2.  
    3. tar czf archives-log-2008-10-02.tgz 2008-10-02
  2. 1 week ago
    1. //Insérer les fonctions javascript (dans l'en-tête de vos pages, directement ou dans un fichier .js).
    2. //---------------------------------------------------------------------------------------------------
    3.  
    4. function ecrire_cookie(nom, valeur, expires) {
    5.   document.cookie=nom+"="+escape(valeur)+
    6.   ((expires==null) ? "" : ("; expires="+expires.toGMTString()));
    7. }
    8.  
    9. function arguments_cookie(offset){
    10.   var endstr=document.cookie.indexOf (";", offset);
    11.   if (endstr==-1) endstr=document.cookie.length;
    12.   return unescape(document.cookie.substring(offset, endstr));
    13. }
    14.  
    15. function lire_cookie(nom) {
    16.   var arg=nom+"=";
    17.   var alen=arg.length;
    18.   var clen=document.cookie.length;
    19.   var i=0;
    20.   while (i<clen){
    21.     var j=i+alen;
    22.     if (document.cookie.substring(i, j)==arg)
    23.        return arguments_cookie(j);
    24.     i=document.cookie.indexOf(" ",i)+1;
    25.     if (i==0) break;
    26.   }
    27.   return null;
    28. }
    29.  
    30.  
    31. //Faire appel aux fonctions : écrire un cookie avec javascript.
    32. //-------------------------------------------------------------
    33.  
    34. // Création d'un cookie non persistant (pas de date)
    35. // ce cookie s'effacera à la fin de la session
    36.   ecrire_cookie("deja_venu", "oui");
    37.  
    38. // Création d'un cookie persistant (la date est fixée)
    39. // le cookie s'effacera dans x jours, x mois etc.
    40. // ici le cookie restera 1 mois.
    41.   date=new Date;
    42.   date.setMonth(date.getMonth()+1); // expire dans un mois
    43.   ecrire_cookie("deja_venu", "oui", date);
    44.  
    45.  
    46. //Faire appel aux fonctions : lire un cookie avec javascript.
    47. //-----------------------------------------------------------
    48.  
    49.   deja_venu = lire_cookie("deja_venu");
  3. 1 week ago
    en ligne de commande :
    
    php -v
    ou :
    php5 -v
  4. sponsorised links
  5. 1 week ago
    1. Note : Dans tous les cas, ajouter l’option -p si un mot de passe est nécessaire après le nom du compte. Dans les exemples, on utilise le compte 'root'. ATTENTION : Il ne faut pas mettre d’espace entre l’option -p et le mot de passe.
    2.  
    3. Pour exporter avec l’utilitaire mysqldump.exe :
    4.  
    5. mysqldump -u root database > backup-file.sql
    6.  
    7. Pour importer, cliquer "démarrer/executer", puis taper ’cmd’. Ensuite lancer pour Wamp :
    8.  
    9. c:\wamp\mysql\bin\mysql.exe -u root nom_de_la_base < c:\fichier.sql
  6. 2 weeks ago
    Regarder dans le répertoire :
    /var/log/httpd
  7. 2 weeks ago
    1. Le chemin est renseigné dans le fichier php.ini :
    2.  
    3. session.save_path = /var/lib/php/session
  8. 2 weeks ago
    1. On peut afficher les dernières lignes d’un fichier ou afficher en continu les ajouts à un fichier, ce qui peut être très utile pour surveiller un fichier de log (anglais: logfile), respectivement:
    2.  
    3. tail nom_fichier
    4. tail -f nom_fichier
    5.  
    6. Dans ce dernier cas, on interrompt la commande avec CTRL-C.
  9. 1 month ago
    Pour utiliser sous Windows, installer find : http://gnuwin32.sourceforge.net/packages/findutils.htm et renommer 'find.exe' différemment pour qu'il ne soit pas en conflit avec la commande DOS du même. Nécessite aussi http://gnuwin32.sourceforge.net/packages/libintl.htm et http://gnuwin32.sourceforge.net/packages/libiconv.htm
    find -type f -mtime -1 -print0 | xargs -0 ls -lt>_dernieres_modifs.txt
  10. 1 month ago
    Code à placer à la fin du fichier jquery.js
    1. ;(function($) {
    2.  
    3. /**
    4. * Selects an option by text
    5. *
    6. * @name     selectOptionsByText
    7. * @author   Mathias Bank (http://www.mathias-bank.de), original function
    8. * @author   Sam Collett (http://www.texotela.co.uk), addition of regular expression matching
    9. * @author   Christophe (version modifiée : recherche sur le texte au lieu de rechercher sur la valeur du champ option)
    10. * @type     jQuery
    11. * @param    String|RegExp value  Which options should be selected
    12. * can be a string or regular expression
    13. * @param    Boolean clear  Clear existing selected options, default false
    14. * @example  $("#myselect").selectOptions("val1"); // with the text 'val1'
    15. * @example  $("#myselect").selectOptions(/^val/i); // with the text starting with 'val', case insensitive
    16. *
    17. */
    18. $.fn.selectOptionsByText = function(text, clear)
    19. {
    20.     var v = text;
    21.     var vT = typeof(text);
    22.     var c = clear || false;
    23.     // has to be a string or regular expression (object in IE, function in Firefox)
    24.     if(vT != "string" && vT != "function" && vT != "object") return this;
    25.     this.each(
    26.         function()
    27.         {
    28.             if(this.nodeName.toLowerCase() != "select") return this;
    29.             // get options
    30.             var o = this.options;
    31.             // get number of options
    32.             var oL = o.length;
    33.             for(var i = 0; i<oL; i++)
    34.             {
    35.                 if(v.constructor == RegExp)
    36.                 {
    37.                     if(o[i].text.match(v))
    38.                     {
    39.                         o[i].selected = true;
    40.                     }
    41.                     else if(c)
    42.                     {
    43.                         o[i].selected = false;
    44.                     }
    45.                 }
    46.                 else
    47.                 {
    48.                     if(o[i].text == v)
    49.                     {
    50.                         o[i].selected = true;
    51.                     }
    52.                     else if(c)
    53.                     {
    54.                         o[i].selected = false;
    55.                     }
    56.                 }
    57.             }
    58.         }
    59.     );
    60.     return this;
    61. };
    62.  
    63. })(jQuery);
  11. 1 month ago
    Pour écrire ces informations dans un fichier : > dir *.* /b /s >liste.txt
    1. dir *.* /b /s

First / Previous / Next / Last / Page 1 of 3 (23 posteets)