]> git.nbdom.net Git - nb.git/commitdiff
resolve
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 30 Sep 2016 10:49:25 +0000 (11:49 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 30 Sep 2016 10:49:25 +0000 (11:49 +0100)
etc/profile.d/net.sh
etc/vim/.vimplaterc

index c4c6c79f20060b28bfb31cce516091110f9eebfa..d4110be9b44e280dca5ca6bc89e6b3d46b4f58a2 100644 (file)
@@ -8,7 +8,7 @@ resolve() {
     else
       cat
     fi
-  ) | perl -MSocket -pe 's/(\b)(\d+(?:\.\d+){3})(\b)/$1.gethostbyaddr(inet_aton($2),AF_INET).$3/ge;'
+  ) | perl -MSocket -pe 'BEGIN{sub ip2host{$i=shift;return $c{$i} if $c{$i};$h=gethostbyaddr(inet_aton($i),AF_INET);%c=()if keys(%c)>10000;return $c{$i}=$h?$h:$i;};}; s/(\b)(\d+(?:\.\d+){3})(\b)/$1.ip2host($2).$3/ge'
 }
 
 mask2cdr ()
index 32edc09cc845723c67cedbe5d95238c36a451839..0046460a278e1290984097fa89a6e0c8ca73d234 100755 (executable)
@@ -68,8 +68,6 @@ for (keys %$Config::user) {
 
 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 
-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-
 See <http://www.gnu.org/licenses/>.";
 
        $Config::user->{$_} = \%h;