Resman says hi.

Scriptlets

Petits bouts de code à usage divers.

watchline.pl - Permet de surveiller les changements d'une ligne dans un fichier
#!/usr/bin/perl
 
unless( $ARGV[1] ) {
    print "Usage : $O <fichier> <pattern> [intervalle]\nIntervalle par défaut = 1s.\n";
    exit;
}
my $interval = $ARGV[2]?$ARGV[2]:1;
my $l = "";
while(1) {
    open my $fd, "< $ARGV[0]";
    while(<$fd>) { last if /$ARGV[1]/; }
    chomp;
    if( $_ ne $l ) {
        my $t = `date +[%H:%M:%S]`;
        chomp $t;
        print "$t ", $l = $_, "\n";
    }
    close $fd;
    sleep $interval;
}

mks - Crée un fichier exécutable et y place le shebang en fonction de l'extension
#!/bin/sh
 
if [ $# -ne 1 ]; then
    echo "Usage : mks <nom du script>" && exit 1
fi
if [ -e "$1" ]; then
    echo "$1 existe déjà." && exit 1
fi
> "$1"
chmod +x "$1"
if [ "${1: -3}" == ".pl" ]; then
    echo -e "#!/usr/bin/perl\n\n" > "$1"
fi
if [ "${1: -3}" == ".sh" ]; then
    echo -e "#!/bin/sh\n\n" > "$1"
fi
   $EDITOR "$1"

man - CGI pour afficher une page man avec liens
#!/usr/bin/perl
 
$s = "";
$p = "man";
#print $ENV{QUERY_STRING};
($p) = $ENV{QUERY_STRING} =~ m!p=([a-z._]+)!;
($s) = $ENV{QUERY_STRING} =~ m!s=(.)!;
 
open $fd, "man $s $p 2>&1 |";
@l = <$fd>;
$l = join "", @l;
$l =~ s!(.)\010\1!<b>\1</b>!sg;
$l =~ s!_\010(.)!<u>\1</u>!sg;
$l =~ s!</(.+)><\1>!!sg;
$l =~ s!(</.>)?([a-z._]+)(</.>)?\((.)\)!< a href=man?p=\2&s=\4>\1\2\3\(\4\)</a>!sg;
 
print <<END;
Content-type: text/html\n
<html>
<head><title>$p($s)</title></head>
<body><form><input type=text name=p><input type=submit value=man></form>
<pre>$l</pre></body></html>
END

iptables chains diagram
                                        Network
                             -----------+-----------
                                        |
                                +-------+------+
                                |    mangle    |
                                |  PREROUTING  | <- MARK REWRITE
                                +-------+------+
                                        |
                                +-------+------+    Policy rule database
                                |     PRDB     | <- controlled by ip rule
                                +-------+------+
                                        |
                                +-------+------+
                                |      nat     |
                                |  PREROUTING  | <- DEST REWRITE
                                +-------+------+
                                        |
                 packet is for  +-------+------+ packet is for
                 this address   |     INPUT    | another address
                 +--------------+    ROUTING   +---------------+
                 |              +--------------+               |
         +-------+------+                                      |
         |    filter    |                                      |
         |    INPUT     |                                      |
         +-------+------+                                      |
                 |                                             |
         +-------+------+                                      |
         |    Local     |                                      |
         |   Process    |                                      |
         +-------+------+                                      |
                 |                                             |
         +-------+------+                                      |
         |    OUTPUT    |                              +-------+-------+
         |    ROUTING   |                              |    filter     |
         +-------+------+                              |    FORWARD    |
                 |                                     +-------+-------+
         +-------+------+                                      |
         |    mangle    |                                      |
         |    OUTPUT    | MARK REWRITE                         |
         +-------+------+                                      |
                 |                                             |
         +-------+------+                                      |
         |     nat      |                                      |
         |    OUTPUT    | DEST REWRITE                         |
         +-------+------+                                      |
                 |                                             |
         +-------+------+                                      |
         |    filter    |                                      |
         |    OUTPUT    |                                      |
         +-------+------+                                      |
                 |                                             |
                 |                                             |
                 +----------------+       +--------------------+
                                  |       |
                                  |       |
                               +--+-------+---+ selection of the output
                               |              | interface,
                               |  FORWARDING  | selection of the next hop,
                               +-------+------+ encapsulation, etc.
                                       |
                                       |
                               +-------+------+
                               |     nat      |
                               | POSTROUTING  | SOURCE REWRITE
                               +-------+------+
                                       |
                                       |
                               +-------+------+
                               |   TRAFFIC    |
                               |    QUEUE     | <- controlled by tc
                               +-------+------+
                                       |
                                       |
                            -----------+-----------
                                    Network

Comments

Comment left by Lily Loo on 2020-08-02 01:46:06 :
hi, Your post is very helpful for me,finally i got exactly what I want. If you want to know more about antivirus then you can visit our site Bitdefender ondersteuning belgie help.
Comment left by Mariam Groen on 2020-08-02 01:07:41 :
hi, Your post is very helpful for me, finally i found exactly what i want , If you want to know more about antivirus then you can visit our site Kaspersky bellen for help.
Comment left by Maysa Lang on 2020-08-01 23:38:00 :
hi, Your post is very helpful for me, If you want to know more about antivirus then you can visit our site contact Canon Printer belgie for help.
Comment left by Tosca Klasen on 2020-08-01 21:09:28 :
hi, your post is very helpful for me. Finally, I found exactly what i want. If need information regarding printers then you can visit our site Xerox Printer belgie
for help.
Comment left anonymously on 2020-07-31 18:29:33 :
That's exactly what I was looking for! visit usisit us if you have a chance.
Comment left by MillaRoose on 2020-07-31 12:27:54 :
Hi thankyou for this great helpful information.this information is really useful at today's time.you had easily explained whole information in a short note.now i want to share some information about avast antivirus.So if you are facing any problem regarding Avast so you can simply visit on our site-avast technische ondersteuning
Comment left by MillaRoose on 2020-07-31 10:28:00 :
Hi thankyou for this great helpful information.this information is really useful at today's time.you had easily explained whole information in a short note.now i want to share some information about avast antivirus.So if you are facing any problem regarding Avast so you can simply visit on our site-avast technische ondersteuning
Comment left by lima wilmink on 2020-07-31 10:01:47 :
Hi your post is really appreciatable.I really thankful for this post .here i would llike to share some information about HP Printer.We can resolve the smallest problem on same time If you are facing any problem relate to your HP Printer's so this is the right place to get smallest information about HP PRINTER for the further information please visit on our website- hp printer technische ondersteuning
Comment left by Fien Wieten on 2020-07-31 09:31:21 :
Hi your post is very nice and i am greatful to you for sharing this post with us.here i want to share some information about Norton Antivirus.As we all know how much Norton Antivirus is usefull for our laptops and mobiles.so whenever you have any query regarding Norton or need any assistance how to run or any information that time please visit over this site-norton Antivirus technische ondersteuning
Comment left by Rowanbaartman on 2020-07-31 09:17:27 :
Hi this post is very nice.finally i got all those information what i really wanted to know. thankyou for sharing this usefull information.here i want to share the information about mcafee security. as we all have been digitalied and we do multiple works together so if you face any problem or need any assist about MCAFEE so pleae visit over this site-mcafee Antivirus technische ondersteuning
Comment left by Willeke Roes on 2020-07-30 18:34:29 :
Thanks for sharing such an Amazing information, I Couldn't leave without reading your blog. I have read another good blog, I think you have read it too. click here klantenservice Trend Micro Belgie
Comment left by Lilly La Sanka on 2020-03-27 15:28:44 :
My nanoskirt gave me away.
Comment left by Gabriella Paige on 2019-02-04 14:59:14 :
Shorts réparés, appareil terminé, ça va y aller.
Comment left by Boubou on 2018-12-17 16:19:59 :
Je ne sais pas, en tout cas, ma nouvelle microjupe est très bandante.
Comment left by Boubou on 2018-12-17 16:19:06 :
Je ne sais pas, en tout cas, ma nouvelle microjupe est très bandante.
Comment left by Monsieur Cyclopéde on 2016-08-21 19:06:55 :
Est-ce que Paul Newman a bien joué dans "Vol au-dessus d'un nid de coucous" ?
Add a new comment :
Name :
Comment :

Answer the following question : Which is the smallest, eleven or twelve ?