Fortune with 10% chance of displaying


Requirements



Skrypt


ckfortune1-10.php (line 1)
  1. #!/usr/bin/php -q
  2.  
  3. <?php
  4.  
  5. /*
  6.         CkFortune1-10 - displays fortunes with 10% chance of appearing
  7.         Copyright (C) 2010 Ɓukasz "Cyber Killer" Korpalski
  8.  
  9.         This program is free software: you can redistribute it and/or modify
  10.         it under the terms of the GNU General Public License as published by
  11.         the Free Software Foundation, either version 3 of the License, or
  12.         (at your option) any later version.
  13.  
  14.         This program is distributed in the hope that it will be useful,
  15.         but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.         GNU General Public License for more details.
  18.  
  19.         You should have received a copy of the GNU General Public License
  20.         along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21. */
  22.  
  23. //runs the fortune program with 10% probability as not to lower admin productivity by reading too many fortunes ;-)
  24. //append to ~/.bashrc
  25.  
  26. if(rand(1,10)==1)
  27. {
  28.                 system("fortune -a");
  29.                 echo("\n");
  30. }
  31.  
  32. ?>



 
CategoryProjekty

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki