{"id":456,"date":"2010-02-24T17:57:29","date_gmt":"2010-02-24T09:57:29","guid":{"rendered":"http:\/\/www.kumouse.com\/?p=456"},"modified":"2010-02-24T17:57:29","modified_gmt":"2010-02-24T09:57:29","slug":"%e8%8e%b7%e5%8f%96-%e7%bd%91%e9%80%9a-%e7%94%b5%e4%bf%a1-%e8%b7%af%e7%94%b1%e8%a1%a8-%e4%b8%8b%e8%bd%bd-2010224","status":"publish","type":"post","link":"https:\/\/www.kumouse.com\/?p=456","title":{"rendered":"\u83b7\u53d6 \u7f51\u901a \u7535\u4fe1 \u8def\u7531\u8868 \u4e0b\u8f7d 2010\/2\/24"},"content":{"rendered":"<p>\u7f51\u4e0a\u6709\u811a\u672c,\u4f46\u662f\u8fd0\u884c\u4e0d\u4e86,\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48.shell\u4e0d\u662f\u4e00\u4e2a\u7248\u672c\u5417?\u4e0d\u89e3,\u6211\u6539\u4e86\u4e00\u4e0b,\u73b0\u5728\u80fd\u7528\u4e86<\/p>\n<p>#!\/bin\/sh<br \/>\npow=32<\/p>\n<p>function log2() {<br \/>\nlocal i=$1<br \/>\nif [ $i -le 1 ];then<br \/>\nreturn $pow<br \/>\nfi<br \/>\npow=`expr $pow &#8211; 1`;<br \/>\nlog2 `expr $i \/ 2`<br \/>\n}<\/p>\n<p>FILE=.\/apnic<br \/>\nrm -f $FILE<br \/>\nwget http:\/\/ftp.apnic.net\/apnic\/stats\/apnic\/delegated-apnic-latest -O $FILE<br \/>\ngrep &#8216;apnic|CN|ipv4|&#8217; $FILE | cut -f 4,5 -d&#8217;|&#8217;|sed -e &#8216;s\/|\/ \/g&#8217; | while read ip cnt<br \/>\ndo<\/p>\n<p>        echo $ip:$cnt<br \/>\n\tlog2 $cnt<br \/>\n        mask=$pow<br \/>\necho $mask<br \/>\n        pow=32<br \/>\n        echo $ip\/$mask>> cn.net<br \/>\n        NETNAME=`whois $ip@whois.apnic.net | sed -e &#8216;\/.\/{H;$!d;}&#8217; -e &#8216;x;\/netnum\/!d&#8217; |grep ^netname | sed -e &#8216;s\/.*:      (.*)\/1\/g&#8217; | sed -e &#8216;s\/-.*\/\/g&#8217;`<br \/>\n        case $NETNAME in<br \/>\n        CNC)<br \/>\n                echo $ip\/$mask >> SSJ_CNCGROUP<br \/>\n        ;;<br \/>\n        UNICOM)<br \/>\n                echo $ip\/$mask >> SSJ_CNCGROUP<br \/>\n        ;;<br \/>\n        CHINANET)<br \/>\n                echo $ip\/$mask >> SSJ_CHINANET<br \/>\n        ;;<br \/>\n        CNCGROUP)<br \/>\n                echo $ip\/$mask >> SSJ_CNCGROUP<br \/>\n        ;;<br \/>\n        CHINATELECOM)<br \/>\n                echo $ip\/$mask >> SSJ_CHINANET<br \/>\n        ;;<br \/>\n        *)<br \/>\n                echo $ip\/$mask >> SSJ_OTHER<br \/>\n        ;;<br \/>\n        esac<br \/>\ndone<\/p>\n<p><a href='http:\/\/www.kumouse.com\/wp-content\/uploads\/2010\/02\/ssj.tar1.bz2'>\u8def\u7531\u8868\u4e0b\u8f7d 2010-02-24<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u4e0a\u6709\u811a\u672c,\u4f46\u662f\u8fd0\u884c\u4e0d\u4e86,\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48.shell\u4e0d\u662f\u4e00\u4e2a\u7248\u672c\u5417?\u4e0d\u89e3,\u6211\u6539\u4e86\u4e00\u4e0b,\u73b0\u5728\u80fd\u7528\u4e86 #!\/bin\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-456","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=456"}],"version-history":[{"count":0,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/456\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}