批量封掉危险的IP网段

根据dshield.org的黑名单,可得到一堆危险的网段,中国的IP也占了一些,我看估计都是肉鸡.
防止这些危险的机器向我们发起攻击,决定把这些危险的IP网段封掉(debian测试通过).
当然,iptables也能做,但是在大流量攻击面前,无效路由显得更轻松,不会像iptables那样占用大量资源!

  1. #!/bin/bash
  2. # filename:  block_IPs.sh
  3. # auth: baiqiuyi.com
  4. curl "http://www.spamhaus.org/drop/drop.lasso"|awk 'NR>1{print $1}' >ip
  5. if [ $? -eq 0 ];then
  6. while read ip
  7.    do
  8. /usr/bin/ipcalc $ip|sed -n '/Address/p;/Netmask/p'|sed -r 's/.*( ([0-9]{1,3}\.){3}[0-9]{1,3}).*/\1/'|sed 'N;s/\n/ netmask /g;s/^/route add -net/;s/$/ reject/'|bash
  9.    done < ip
  10.    rm -f ip
  11. exit 0
  12.  fi

附: ipcalc下载地址

linux命令行下wget下载ftp文件

wget -nH -m –ftp-user=user –ftp-password=passwd ftp://ipaddress/*
-nH不建立以IP为名的文件夹, -m是mirror镜像

prestashop登陆后台提示_employee does not exist or bad password

安装prestashop,系统是Centos,控制面板是DirectAdmin,不知道是因为什么,貌似官方的版本有BUG ?
安装完毕登陆后台,系统提示 employee does not exist or bad password …
看了一下, ps_employee的表是空的 @_@

  1. mysql> INSERT INTO ps_employee(id_employee,id_profile,lastname,firstname,email,passwd,last_passwd_gen,
  2. stats_date_from,stats_date_to,active) VALUES('1','1','OWNER','YourFirstName',
  3. 'name@your.email','','2009-11-05 11:11:31','2009-01-01','2009-10-01','1');

config里的settings.inc.php里面,有个 _COOKIE_KEY_ 复制起来
md5码紧跟着新密码 xxxxxxxxxxxxxxxxxxxxxNewpasswd
例如: xxxxxxxxxxxxxxxxxxxxxxxxx123456
然后更新表的记录

  1. mysql> update ps_employee set passwd=md5('YourMD5Value123456') where email='name@your.email';

DirectAdmin控制面板报错_Init: SSL server IP/port conflict

DirectAdmin控制面板问题
客户反应使用zen-cart,在后台快速更新时出现错误,无法更新成功,且网站会临时性的无法打开。
我这边观察,他的zen-cart一旦出现错误,会导致所有网站都无法打开,wget测试提示“读取文件头错误 (Connection reset by peer)。”

  1. 正在解析主机 Domain.com... 111.111.111.111
  2. 正在连接 Domain.com[111.111.111.111]:80... 已连接。
  3. 已发出 HTTP 请求,正在等待回应...
  4. 读取文件头错误 (Connection reset by peer)
  5. 重试中。

apache日志报错

  1. [Tue Nov 17 01:52:41 2009] [warn] Init: SSL server IP/port conflict:
  2. www.domain.com:443 
  3. (/usr/local/directadmin/data/users/username/httpd.conf:48)
  4. vs. www.domain.com:443
  5. (/usr/local/directadmin/data/users/username/httpd.conf:48)

问题的关键在于DirectAdmin允许一个用户名下多个网站使用同一个SSL,但是不在同一个用户名底下的域名就会报错。
SSL导致IP冲突,apache报错,进而影响其他网站的正常访问,关掉非独立IP的SSL权限就正常了。
记录一下,希望能帮得上也碰到这种问题的朋友。
for English peopel: Disable SSL function for all the package them will be resolved.

linux关闭声音

笔记本上装了vmware,TAB补全跟VI一直滴滴滴,Google一下
管理Linux命令行提示音:

  1. setterm -blength 0

烦人的嘟嘟声没了,终于清静了~

18 12345»...18