In: , , On: 2003 / 12 / 20 Short URL: http://ozh.in/f

This line displays top 5 processes, sorted by CPU usage.

  1. echo "  PID USER     %CPU COMMAND" &&  ps -eo pid,user,pcpu,args --sort pcpu | tail -n 5 | sort -r
In: , On: 2003 / 12 / 12 Short URL: http://ozh.in/e

This script will deop, kick and ban anyone trying to ban you (if you're a chanop, of course)

  1. on @!*:ban:#: {
  2.   if ($banmask iswm $address($me,5)) {
  3.     mode # -ob $nick $banmask
  4.     ban # $nick 2
  5.     kick # $nick But yes.
  6.   }
  7. }
In: , , On: 2003 / 12 / 07 Short URL: http://ozh.in/d

This perl script prints modification time of a file, in various format.
Examples :

datemodif y-m-d mystuff.log → 2003-30-06
datemodif d/M/Y-h.m.s mystuff.log → 06/12/03-21.30.02
datemodif X d O Y mystuff.log → Samedi 06 Décembre 03

Read More

Francophonie for ever ! Le Ministère de la Culture a officiellement adopté le terme courriel pour remplacer email.

Tout droit importé de chez nos crisses de cousins du Quebec qui sont si rigolos quand ils parlent, courriel succède officiellement à mél, grotesquerie qu'il était question d'officialiser mais qui n'a jamais marché. Le Ministère hésiterait même à adopter quelques dérivés : pourriel pour spam notamment, amalgame québecquois pour "pourriture électronique" :)

S'il faut vraiment franciser, je trouve que c'est un bon choix, en tous cas bien meilleur que ce minable "mél" qui ne veut rien dire. Faudrait maintenant trouver quelque chose digne de ce nom à ce grotesque cédérom :)

In: , , , On: 2003 / 07 / 18 Short URL: http://ozh.in/b

This is the perl version of my "famous" KIKOO Script for mIRC. Written for a psybnc bouncer, you can adapt it for XChat (see the kikoo script).

  1. #!/usr/bin/perl
  2. $nick = uc join(' ', @ARGV);
  3. $front = int(rand(13))+1;
  4. $back = int(rand(13))+1;
  5. while($back == $front) {
  6.         $back = int(rand(13))+1;
  7. }
  8. $xclam = int(rand(11))+2;
  9. $oo = int(rand(11))+2;
  10. $par = int(rand(11))+2;
  11.  
  12. $output = "\002\003" . "$front,$back" . " KIKOO" . "O" x $oo . " $nick " . "!" x $xclam . " :o" . ")" x $par ." ";
  13. print "PRIVMSG &&partyline :$output\n";
In: , , , On: 2003 / 03 / 23 Short URL: http://ozh.in/a

This script queries Google and returns the first result (the one you'd get hitting the "I Feel Lucky" button). I did it because I wanted not to use LWP::Simple on a computer where the lib was missing. Consider this as is my minimalistic web client example.
(the fancy stuff that might confuse you, as "print NOTICE", are for a PsyBNC integration. Ignore them)

  1. #!/usr/bin/perl
  2.  
  3. use IO::Socket;
  4. $nick = shift (@ARGV);
  5.  
  6. if ($#ARGV < 0 ) {
  7. print ":g00gle NOTICE $nick :Err…. google what ffs m8 ?\n" ;
  8. exit;
  9. }
  10.  
  11. $host = "www.google.com";
  12. $document = "/search?btnI=\&q=" . join ("+", @ARGV);
  13. $kikoo=0;
  14.  
  15. $EOL = "\015\012";
  16. $BLANK = $EOL x 2;
  17.  
  18. $remote = IO::Socket::INET->new(
  19. Proto => "tcp",
  20. PeerAddr => $host,
  21. PeerPort => "http(80)",
  22. );
  23.  
  24. unless ($remote) { die "cannot connect to http daemon on $host"; }
  25. $remote->autoflush(1);
  26. print $remote "GET $document HTTP/1.0" . $BLANK;
  27. while ( <$remote> ) {
  28. if (m/^location/i ) {
  29. $tutu = $_ ;
  30. $tutu=~s/^location: //i;
  31. print ":g00gle NOTICE $nick :$tutu"; $kikoo = 1;
  32. } ;
  33. }
  34. close $remote;
  35.  
  36. print ":g00gle NOTICE $nick :No result ffs m8 !\n" unless $kikoo;
In: , , , On: 2003 / 02 / 02 Short URL: http://ozh.in/9

The "Very Polite Script" is always a true success :-P

  1. on 1!:TEXT:!fraises:#:/msg $nick DON%T YOU FRAISES MEH, YUO FAGGOT !!!!1
  2. on 1:OP:#:if (($me != $nick) && ($me == $opnick)) /notice $nick thx $nick ! (VeryPolite Script v 1.00)
  3. ctcp 1:ping:/notice $nick 4 [PING reply]: 2 months, 5 days, 7 hours, 12 minutes 43 seconds | halt
  4. ctcp 1:version:/notice $nick 4 [VERSION reply]: ozhIRC v0.01 | halt
  5. ctcp 1:time:/notice $nick 4 [TIME reply]: Tue June 01 12:00:00 1967 | halt
  6. ctcp 1:finger:/notice $nick 4 [FINGER reply]: $me ( $me ) Idle 4 days, 18 hours, 34 seconds | halt

Il y a quelques jours, un gentil lecteur envoyait pour les Lectures du Midi un lien assez amusant, la Google Fight. Quelques jours avant, je venais de faire un script "google" en Perl pour un bouncer Psybnc. Et, par un hasard des plus cocasses, il se trouve que ça fait précisemment 3 ans que j'utilise Google. Google, on en mange à longueur de journée pour le travail, pour les loisirs, pour tout. Plus qu'un outil, c'est un way of life : le Googlisme méritait bien son édito :P
Read More

In: , , On: 2002 / 04 / 30 Short URL: http://ozh.in/7

You know you need this one : it will display your age in … seconds. Yes ma'am.

  1. /age {
  2.   if ( %dnaiss == $null ) {
  3.     set %dnaiss $$?-="Birth ? Format jj.mm.aaaa hh:mm"
  4.   }
  5.   /say lol mdr g $calc($ctime($asctime(dd.mm.yyyy HH:nn:ss))  ?
  6.   - $ctime(%dnaiss)) seconds !! sa fé ¤calc(($ctime($asctime(dd.mm.yyyy HH:nn:ss))  ?
  7.   - $ctime(%dnaiss)) /3600/24/365.2425) years !!!? !! lololl !!??!?! :)))))
  8. }
In: , On: 2002 / 03 / 12 Short URL: http://ozh.in/6

Au cours des derniers mois, j'ai fait quelques achats de petit matos informatique chez des marchands online. Prudent, avant de mettre un premier pied dans ce monde encore sauvage et dangereux du commerce sur Internet, j'ai cherché à glaner quelques infos sur tel ou tel VPCiste, pour m'apercevoir rapidement qu'on peut trouver des expériences réussies ou malheureuses avec n'importe quelle boutique online.
Read More