Monthly Archives: September 2009

centos/redhat ppp inital file

[root@localhost network-scripts]# cat ifcfg-ppp0 USERCTL=yes PEERDNS=yes TYPE=xDSL DEVICE=ppp0 BOOTPROTO=dialup ONBOOT=yes PIDFILE=/var/run/pppoe-adsl.pid FIREWALL=NONE PING=. PPPOE_TIMEOUT=80 LCP_FAILURE=3 LCP_INTERVAL=20 CLAMPMSS=1412 CONNECT_POLL=6 CONNECT_TIMEOUT=60 PERSIST=no SYNCHRONOUS=no DEFROUTE=yes USER=200000749076 PROVIDER=pppconfig NAME=pppconfig ETH=eth0

Posted in Linux | Tagged | Leave a comment

Get china IP

wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest grep CN delegated-apnic-latest|grep ipv4 > ipv4 cat ipv4 |awk -F”|” ‘{print $4″ “$5}’ >ipv t.php <?php $c=file_get_contents(“ipv”); $lines=explode(“\n”,$c); foreach($lines as $line){         $line=trim($line);         $lp=explode(” “,$line);         echo $lp[0].”/”.countmask($lp[1]).”\n”; } function countmask($i){         $p=0;         while($i>1){                 $i=$i/2; … Continue reading

Posted in Linux, PHP | Tagged | Leave a comment