• nginx dynamic url rewrite

    I have such a request, will rewrite url to google’s search site,type http://mysite/search/search.html?t=laday gaga –> http://www.google.com/search?q=lady%20gagaI donn’t want to use other tools(php/java etc.) except nginx.For a long time googleing, finally find how to setting ...

    阅读全文
    作者:2hei | 分类:nginx | 阅读:4,078 views | 标签:
  • write nagios nrpe plugin

    Scripts and executables must do two things (at a minimum) in order to function as Nagios plugins:1.Exit with one of several possible return values2.Return at least one line of text output to STDOUT Plugin Return Code Service State Host State0 OK UP1 WARNING UP or DOWN/UNREACHABLE*2 CRITICAL DOWN ...

    阅读全文
    作者:2hei | 分类:OpenSource, python | 阅读:4,926 views | 标签:
  • finding netcard driver type in linux

    we have two ways: 1. finding netcard driver by sysloggrep -i ‘driver’ /var/log/messagesordmesg | grep -i driver 2.lsmod  #try to find netcard type. [root@2hei.net]# modinfo e1000filename:       /lib/modules/2.6.9-34.ELsmp/kernel/drivers/net/e1000/e1 ...

    阅读全文
    作者:2hei | 分类:linux | 阅读:3,267 views | 标签:
  • write a own tools of WorldTime with pytz

    require : python2.6 pytz #!/usr/bin/env python# -*- coding: gbk -*-from datetime import datetime, timedeltafrom time import gmtime, strftimefrom pytz import timezoneimport pytz, time,os #def convert_datetime(unix_timestamp=1143408000, tz=1, long_fmt=1): def convert_datetime(dt=’2007-01-01 ...

    阅读全文
    作者:2hei | 分类:python | 阅读:3,016 views | 标签:
    write a own tools of WorldTime with pytz已关闭评论
  • notice Hostnames should not contain an ‘_’

    notice Hostnames should not contain an ‘_’: such as vm_test01.2hei.net Please have a look at RFC952 (http://tools.ietf.org/html/rfc952) Hostnames should not contain an ‘_’! ASSUMPTIONS:    1. A “name” (Net, Host, Gateway, or Domain name) is a text ...

    阅读全文
    作者:2hei | 分类:OpenSource | 阅读:3,065 views | 标签:
    notice Hostnames should not contain an ‘_’已关闭评论
  • replacing_hard_disks_in_a_raid1_array

    cat /proc/mdstat Personalities :  [raid1] read_ahead 1024 sectors  md1 : active raid1 sda3[0] sdb3[1] 522048 blocks [2/2] [U_]  md0 : active raid1 sda2[0] sdb2[1] 4192896 blocks [2/2] [U_]  md2 : active raid1 sda1[0] sdb1[1] 128384 blocks [2/2] [U_]  unused devices: < ...

    阅读全文
    作者:2hei | 分类:linux | 阅读:5,954 views | 标签:,
    replacing_hard_disks_in_a_raid1_array已关闭评论
  • linux sz rz tools

    虚拟机上最小化安装centos5.3,传文件时发现非常方便的rz 和sz没有安装上,于是手工安装。 wget http://mirrors.163.com/centos/5/os/i386/CentOS/lrzsz-0.12.20-22.1.i386.rpm (一个好消息是163和sohu都有了开源镜像哦,速度飞快!) rpm ivh lrzsz-0.12.20-22.1.i386.rpm 或者直接用yum安装。 yum install lrzsz ...

    阅读全文
    作者:2hei | 分类:linux | 阅读:4,799 views
    linux sz rz tools已关闭评论
  • python解析xml的字符集问题的处理

    python版本:2.6 案例一: test.xml<?xml version=”1.0″ encoding=”utf8″?>调用:xmldoc = minidom.parse(test.xml)报错:Traceback (most recent call last):  File “D:\project\src\myapp\src\xml\testdomxml.py”, line 14, in <module>    xml ...

    阅读全文
    作者:2hei | 分类:python | 阅读:5,280 views | 标签:,
  • SHELL中的2进制、10进制、8进制、16进制之间的转换

    一、16进制转换成10进制printf %d 0xF15或者echo $((16#F))15 二、10进制转换成16进制printf %x 15f或者echo “obase=16;15″|bcF 三、10进制转换成8进制printf %o 911 四、8进制转换成10进制echo $((8#11))9 五、同理二进制转换成10进制echo $((2#111))7 六、10进制转换成二进制echo “obase=2;15̸ ...

    阅读全文
    作者:2hei | 分类:linux, OpenSource, shell | 阅读:7,414 views
    SHELL中的2进制、10进制、8进制、16进制之间的转换已关闭评论
  • xml类型的配置文件包含特殊字符的处理

    resin的配置文件类似xml,语法规范也遵循xml的写法,今天遇到了特殊字符的问题,数据库密码包含了特殊字符。<init-param driver-name=”oracle.jdbc.driver.OracleDriver”/>  <init-param url=”jdbc:oracle:thin:@localhost:1521:Test”/>  <init-param user=”us ...

    阅读全文
    作者:2hei | 分类:resin | 阅读:5,380 views
  • cnnic根证书(root)的不可信与解决办法

    cnnic使用了自己的根证书CNNIC ROOT和中级根证书CNNIC SSL,(好多人都在抵制cnnic root哦!,不过既然boss同意使用CNNIC证书,那俺也只能照办了~) 3月1日以后替换的证书都需要替换之前Entrust授权的ROOT。 但是一些主、客观上的原因导致并不是所有的浏览器或者客户端都认为cnnic的根证书是合法可信的,比如firefox3.0 ...

    阅读全文
    作者:2hei | 分类:other | 阅读:6,599 views | 标签:
    cnnic根证书(root)的不可信与解决办法已关闭评论
  • openssh5.4升级后ssh无法登陆

    杯具啊! 新装的服务器,从openssh5.2升级到openssh5.4,重启sshd服务后发现无法登陆了!!!
    没办法,找机房人员终端登陆上去开启telnet,又把版本降了回来,汗一个!
    谁让手欠呢!
    阅读全文
    作者:2hei | 分类:OpenSource | 阅读:6,804 views | 标签:
    openssh5.4升级后ssh无法登陆已关闭评论
  • ethtool maybe caused by “TCP checksum offload”

    使用tcpdump抓包时发现有这样的错误信息: Transmission Control Protocol, Src Port: 44937 (44937), Dst Port: https (443), Seq: 111, Ack: 147, Len: 6 Checksum: 0x5edd [incorrect, should be 0x15db (maybe caused by “TCP checksum offload”?)] Good Checksum: False Bad Checksum: True ...

    阅读全文
    作者:2hei | 分类:OpenSource | 阅读:4,619 views | 标签:
    ethtool maybe caused by “TCP checksum offload”已关闭评论
  • request.getScheme cann’t get https in nginx proxy with apache

    程序中为了不写死url,使用了动态获得的方式:basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”; 其中: request.getScheme() return http but not https.之前单独使用apache(https)+resin的方式正常,现在前面增加了一层ng ...

    阅读全文
    作者:2hei | 分类:nginx | 阅读:3,966 views | 标签:
    request.getScheme cann’t get https in nginx proxy with apache已关闭评论
  • resin使用了struts/spring等框架与apache整合时需要注意事项

    resin使用了struts/spring等框架与apache整合时需要注意以下: 默认情况resin ResinConfigServer配置不支持除了jsp和servlet之外的其他不规则映射,apache对此类URL会返回404,或者无效的servlet,这就用到了resin的plugin_match配置。如:<servlet-mapping url-pattern=”*.do” servlet-name=”plu ...

    阅读全文
    作者:2hei | 分类:resin | 阅读:3,120 views | 标签:
    resin使用了struts/spring等框架与apache整合时需要注意事项已关闭评论
  • device lo left promiscuous mode

    dmesg发现有一些这样的信息:

    device lo left promiscuous mode
    audit(1264387352.387:24): dev=lo prom=0 old_prom=256 auid=4294967295 ses=4294967295

    发现是tcpdump 抓包导致,对系统并无大碍!

    阅读全文
    作者:2hei | 分类:linux | 阅读:3,621 views | 标签:
    device lo left promiscuous mode已关闭评论
  • 《网瘾战争》–看你妹

    一口气看完了60多分钟的《网瘾战争》,真是有些感动。。。 我和其他热爱这个游戏的人一样认真地挤着公交车上班认真地消费着各式各样的食品不管里面有没有不认识的化学成分我们没有因为工资微薄而抱怨过没有因为你们拿着从我微薄工资里扣的税住着联体排屋而心理失衡过在这一年里,我和其他热爱这个游戏的人一样为水灾, ...

    阅读全文
    作者:2hei | 分类:other | 阅读:5,351 views
    《网瘾战争》–看你妹已关闭评论