-
nginx dynamic url rewrite
Aug062010I 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 ...
阅读全文1条评论
-
Get memcached all items and deleted them if needed.
Jul142010I see there are so many api to operate memcached,such as get and set,but no list all items,so i write a shell just list all the items in memcached and we can delete the items when we don’t know the exactly items key. #!bin/bash# get_items_from_memcached.sh# Usge: sh get_ ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:2,980 views | 标签:memcached
-
write nagios nrpe plugin
Jul012010Scripts 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 ...
阅读全文
-
finding netcard driver type in linux
Jun292010we 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 ...
阅读全文
-
write a own tools of WorldTime with pytz
Jun292010require : 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 ...
阅读全文write a own tools of WorldTime with pytz已关闭评论
-
notice Hostnames should not contain an ‘_’
Jun172010notice 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 | 标签:rfcnotice Hostnames should not contain an ‘_’已关闭评论
-
replacing_hard_disks_in_a_raid1_array
Jun092010cat /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: < ...
阅读全文replacing_hard_disks_in_a_raid1_array已关闭评论
-
linux sz rz tools
May302010
-
python解析xml的字符集问题的处理
May072010
-
SHELL中的2进制、10进制、8进制、16进制之间的转换
May042010一、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̸ ...
阅读全文SHELL中的2进制、10进制、8进制、16进制之间的转换已关闭评论
-
xml类型的配置文件包含特殊字符的处理
Apr222010
-
cnnic根证书(root)的不可信与解决办法
Apr082010
-
4.1 愚人节恶搞之 kernel.org
Apr022010
-
openssh5.4升级后ssh无法登陆
Mar302010杯具啊! 新装的服务器,从openssh5.2升级到openssh5.4,重启sshd服务后发现无法登陆了!!!没办法,找机房人员终端登陆上去开启telnet,又把版本降了回来,汗一个!谁让手欠呢!阅读全文作者:2hei | 分类:OpenSource | 阅读:6,804 views | 标签:opensshopenssh5.4升级后ssh无法登陆已关闭评论
-
nginx代理模式下,伪造X-Forwarded-For头的测试
Mar182010测试环境: nginx+resinIP: 内网:172.16.100.10 客户端IP:123.123.123.123 测试页面: test.jsp<%out.println(“x-forwarded-for: ” + request.getHeader(“x-forwarded-for”));out.println(“remote hosts: ” + request.getRemoteAddr());%> nginx 配置一 ...
阅读全文
-
ethtool maybe caused by “TCP checksum offload”
Mar032010使用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 | 标签:ethtoolethtool maybe caused by “TCP checksum offload”已关闭评论
-
request.getScheme cann’t get https in nginx proxy with apache
Feb212010程序中为了不写死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 | 标签:nginx apacherequest.getScheme cann’t get https in nginx proxy with apache已关闭评论
-
resin使用了struts/spring等框架与apache整合时需要注意事项
Feb062010resin使用了struts/spring等框架与apache整合时需要注意以下: 默认情况resin ResinConfigServer配置不支持除了jsp和servlet之外的其他不规则映射,apache对此类URL会返回404,或者无效的servlet,这就用到了resin的plugin_match配置。如:<servlet-mapping url-pattern=”*.do” servlet-name=”plu ...
阅读全文resin使用了struts/spring等框架与apache整合时需要注意事项已关闭评论
-
device lo left promiscuous mode
Jan282010
-
《网瘾战争》–看你妹
Jan242010