Version 13 of Laurent Gateau

Updated 2009-05-26 12:42:31 by LGT

http://laurent.gateau.free.fr/0.html

I've started a web server on a home computer; which leads to suggest a small modification of wikit.kit : Wikit web change + div tag css style and also a small modification of TclHttpd TclHttpd change + div tag css style

Here is a small script to filter netstat output so that it only displays ip addresses.

 proc isIPAddress { ip } {
        set pattern {\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}}
        return [regexp $pattern $ip match];
 }
 set whoisconnected [exec netstat -n | cut -d " " -f2 | cut -d "." -f 1-4 | sort | uniq ]
 foreach host $whoisconnected {
        if [isIPAddress $host] {
                puts $host
        }
 }

Another small script using info command :

 foreach name [info vars] {
        if {[array exists $name]} {
               puts -nonewline "a "
        } else {
               puts -nonewline ". "
        }
        puts $name
 }

My contribution :


[ Category Home Page | Category Person ]