shell批量获取百度及google收录与alexa排名

这个shell脚本查询百度收录及alexa排名没有包含google,google要多增加一个cook跟referer的资料,不然得不到页面..修改一下域名跟路径就可以用了~

  1. #!/bin/bash
  2. cd /root/get_google_baidu_site
  3. $(curl http://alexa.chinaz.com/?domain=baiqiuyi.com -o alexa.temp && cat alexa.temp |iconv -f gb2312 -t utf8|grep 综合排名|sed -e 's/<[^>]*>//g' -e 's/^[ \t]*//g' -e '2d' > today.result && rm alexa.temp)
  4. $(wget -q http://www.baidu.com/s?wd=site%3Abaiqiuyi.com -O baiqiuyi.temp)
  5. $(head -80 baiqiuyi.temp|iconv -f gb2312 -t utf8 > baiqiuyi.html && rm baiqiuyi.temp)
  6. curl -A "Mozilla/4.0(compatible; MSIE 6.0; Windows NT 5.0)" -e "www.google.cn" -D google.txt "http://www.google.cn/search?hl=zh-CN&q=site%3Abaiqiuyi.com&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=f&oq="|sed -e 's/<[^>]*>//g' -re 's/.*(中国的网页 &nbsp;网页&nbsp;.*项符合 baiqiuyi\.com).*/\1/g;'|grep "中国的网页 &nbsp;网页&nbsp;约有"|sed -e 's/&nbsp;//g' -e 's/中国的网页 网页/baiqiuyi.com Google 一下/' -e 's/ baiqiuyi\.com//g' >> today.result
  7.    $(sed -e '/百度一下/!d' -e 's/<[^>]*>//g' -e 's/&nbsp;//g' -e '1,2d' baiqiuyi.html >> today.result|echo -e "\n\n" >>today.result && rm baiqiuyi.html)
  8. $(cat kof1.temp|iconv -f gb2312 -t utf8 > kof1.result && rm kof1.temp)
  9. $(sed -e '/百度一下/!d' -e 's/<[^>]*>//g' -e 's/&nbsp;//g' -e '1,2d' kof1.result >> today.result |echo -e "\n\n"$(date) >> today.result && rm kof1.result)
  10. clear
  11. cat /root/get_google_baidu_site/today.result && rm /root/get_google_baidu_site/today.result

得到的结果大概为这样:

  1. 网站 www.baiqiuyi.comAlexa 上综合排名第 210,313 位。
  2. baiqiuyi.com Google 一下约有 246 项符合
  3. 百度一下,找到相关网页197篇,用时0.001
  4.  
  5. Tue Apr 28 21:43:05 CST 2009

shell脚本查询百度收录及alexa排名

shell批量查询网站的排名及收录情况..多个网站依葫芦画瓢就可以,不是什么好东西,自己乱搞一通,为的就是方便.用到的工具有curl跟wget,把路径换成你自己的,就可以用了..

  1. #!/bin/bash
  2. cd /root/get_site_info
  3. $(curl http://alexa.chinaz.com/?domain=baiqiuyi.com -o alexa.temp && cat alexa.temp |iconv -f gb2312 -t utf8|grep 综合排名|sed -e 's/<[^>]*>//g' -e 's/^[ \t]*//g' -e 2d > today.result && rm alexa.temp)
  4. $(wget -q http://www.baidu.com/s?wd=site%3Abaiqiuyi.com -O baiqiuyi.temp)
  5. $(cat baiqiuyi.temp|iconv -f gb2312 -t utf8 -o baiqiuyi.html || rm baiqiuyi.temp)
  6. $(sed -e '/百度一下/!d' -e 's/<[^>]*>//g' -e 's/&nbsp;//g' -e '1,2d' baiqiuyi.html >> today.result && echo $(date) >> today.result && rm baiqiuyi.html)
  7. clear
  8. cat /root/get_site_info/today.result
  9. #wall <<EOF
  10. #search from web are Done!
  11. #EOF

debian与centos上单网卡配置多个IP

debian与contos单网卡绑定多个IP,如果是远程操作的话(如:ssh),切记要重启网卡的时候要 || ifup eth0
否则第二个IP或第二个配置文件有问题将导致网络中断,我的debian就断了….

  1. root@debian:/etc/network# cat interfaces
  2. # This file describes the network interfaces available on your system
  3. # and how to activate them. For more information, see interfaces(5).
  4.  
  5. # The loopback network interface
  6. auto lo
  7. iface lo inet loopback
  8.  
  9. # The primary network interface
  10. allow-hotplug eth0
  11. iface eth0 inet static
  12.         address 10.0.0.212
  13.         netmask 255.255.255.0
  14.         network 10.0.0.0
  15.         broadcast 10.0.0.255
  16.         gateway 10.0.0.1
  17.         # dns-* options are implemented by the resolvconf package, if installed
  18.         dns-nameservers 10.0.0.1
  19. allow-hotplug eth0:1
  20. iface eth0:1 inet static
  21.         address 10.0.0.145
  22.         netmask 255.255.255.0
  23.         network 10.0.0.0
  24.         broadcast 10.0.0.255
  25.         gateway 10.0.0.1

contos单网卡配置多个IP

  1. [root@localhost network-scripts]# ls |grep ifcfg-eth
  2. ifcfg-eth0
  3. ifcfg-eth1
  4. ifcfg-eth2
  5. ifcfg-eth3
  6.  
  7. [root@localhost network-scripts]# cat ifcfg-eth0
  8. # Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
  9. DEVICE=eth0
  10. BOOTPROTO=none
  11. HWADDR=xx:xx:xx:xx:xx:xx
  12. ONBOOT=yes
  13. NETMASK=xxx.xxx.xxx.xxx
  14. IPADDR=xx.xx.xx.xx
  15. GATEWAY=xx.xx.xx.xx
  16. TYPE=Ethernet
  17.  
  18. 直接cp旧的文件,然后改一下就可以了。
  19. 第一个IPeth0
  20. 第二个IPeth0:0
  21. 第三个IPeth0:1
  22. 以此类推
  23. [root@localhost network-scripts]# service network restart || ifup eth0
  24. Shutting down interface eth0:                              [  OK  ]
  25. Shutting down loopback interface:                          [  OK  ]
  26. Bringing up loopback interface:                            [  OK  ]
  27. Bringing up interface eth0:                                [  OK  ]
  28. Bringing up interface eth1:                                [  OK  ]
  29. Bringing up interface eth2:                                [  OK  ]
  30. Bringing up interface eth3:                                [  OK  ]

Centos上安装配置vsftpd

安装vsftpd
[root@localhost ~]# yum install vsftpd

设置为自启动
[root@localhost ~]# /sbin/chkconfig vsftpd on

修改默认端口
[root@localhost vsftpd]# vi /etc/vsftpd/vsftpd.conf
添加一行:
listen_port=你希望更改的端口,例如:
listen_port=12345
Read more »

centos上安装apache2+mysql5.0+php5

yum安装软件包:
yum install httpd php mysql mysql-server php-mysql

启动mysql
/etc/init.d/mysqld start

为root设置mysql的密码
mysqladmin -u root password ‘你要设置的密码’

用刚才设置的密码登陆
mysql -u root -p

显示数据库
mysql> show databases;

删除测试数据库
mysql> DROP DATABASE test;
Query OK, 0 rows affected (0.00 sec)
Read more »

4 1234»