From ad74fd66b0a30cd403f779d9b386b80c2fe7b151 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 30 Sep 2016 11:49:25 +0100 Subject: [PATCH] resolve --- etc/profile.d/net.sh | 2 +- etc/vim/.vimplaterc | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/etc/profile.d/net.sh b/etc/profile.d/net.sh index c4c6c79f..d4110be9 100644 --- a/etc/profile.d/net.sh +++ b/etc/profile.d/net.sh @@ -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 () diff --git a/etc/vim/.vimplaterc b/etc/vim/.vimplaterc index 32edc09c..0046460a 100755 --- a/etc/vim/.vimplaterc +++ b/etc/vim/.vimplaterc @@ -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 ."; $Config::user->{$_} = \%h; -- 2.47.3