-
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 | 阅读:3,054 views | 标签:memcached2条评论
-
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 ...
阅读全文
-
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,146 views | 标签:rfcnotice Hostnames should not contain an ‘_’已关闭评论
-
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进制之间的转换已关闭评论
-
openssh5.4升级后ssh无法登陆
Mar302010杯具啊! 新装的服务器,从openssh5.2升级到openssh5.4,重启sshd服务后发现无法登陆了!!!没办法,找机房人员终端登陆上去开启telnet,又把版本降了回来,汗一个!谁让手欠呢!阅读全文作者:2hei | 分类:OpenSource | 阅读:6,886 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,758 views | 标签:ethtoolethtool maybe caused by “TCP checksum offload”已关闭评论
-
linux下支持https的压力测试工具
Jan242010测试了linux下的几种压力测试工具,发现有些不支持https,先简单总结如下: 一、apache的ab工具 /home/webadm/bin/ab -c 50 -n 10000 https://2hei.net/mt/index.htmlSSL not compiled in; no https support看样子是说SSL没有编译进来,所以不支持https 二、apache的flood工具 http://httpd.apache.org/test/flood/ wge ...
阅读全文
-
nginx authentication
Jan202010今天配置nginx的basic authentication折腾了好半天,开始error_log一直报错:no user/password was provided for basic authentication 我是按照nginx的wiki配置的:location / { auth_basic “Restricted”; au ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:4,344 views | 标签:nginxnginx authentication已关闭评论
-
[notice] child pid 19818 exit signal Bus error (7)
Jan072010apache logs:[Thu Dec 31 12:27:41 2009] [notice] child pid 19818 exit signal Bus error (7) The first error “Bus Error” is caused by someones (possibly CGI) program crashing. A bus error happens when someone wrote a C program for Intel and re-compiled it for another processor like PPC ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:8,169 views | 标签:apache
-
使用apache的mod_rewrite模块进行端口重写且保留特殊接口
Jan072010需求如下:网站的apache开通80和443端口,整站强制使用https,把所有80端口的访问转到443,新增需求为要针对某个接口单独开放80端口(80、443均可访问),剩下其他接口保持原有规则。 配置一、RewriteRule !^/TestServlet http://%{SERVER_NAME}/$1 [L,R=301] 是有问题的,$1并没取得匹配的部分。 根据apache文档,使用 ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:4,281 views使用apache的mod_rewrite模块进行端口重写且保留特殊接口已关闭评论
-
8.8.8.8-google-public-dns-for-free
Dec302009http://code.google.com/speed/public-dns/index.html What is Google Public DNS? Google Public DNS is a free, global Domain Name System (DNS) resolution service, that you can use as an alternative to your current DNS provider. To try it out: * Configure your network settings to u ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:3,247 views | 标签:dns8.8.8.8-google-public-dns-for-free已关闭评论
-
xenconsole: Could not read tty from store: No such file or directory
Nov272009#xem在配置heartbeat时遇到的一个问题,重启虚拟机出现了问题,系统无法启动,控制台也无法登陆。xm console xm-2hei.netxenconsole: Could not read tty from store: No such file or directory 原来是xenconsoled进程不在了,重启即可#/usr/sbin/xenconsoled 另外一个xen的小tip是,“]”键可以方便的从控制台退出来, ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:3,397 viewsxenconsole: Could not read tty from store: No such file or directory已关闭评论
-
Read-only file system on CentOS5
Nov252009We have 5 Dell server collocated running CentOS 4.x and 5.x server operating system. Sometime my file system (ext3) goes read-only. I’d like to know what could be causing such a problem? CentOS 5.x Read-only file system form http://www.cyberciti.biz/tips/linux-filesytem-goes-read-only.html:a) H ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:3,258 viewsRead-only file system on CentOS5已关闭评论
-
mptscsih: ioc0: attempting task abort
Nov232009Nov 19 00:03:14 2hei.net kernel: mptscsih: ioc0: attempting task abort! (sc=ffff81004f0c7380)Nov 19 00:03:14 2hei.net kernel: sd 0:0:0:0:Nov 19 00:03:14 2hei.net kernel: command: Read(10): 28 00 00 26 15 d7 00 00 48 00Nov 19 00:03:14 2hei.net kernel: mptbase: ioc0: LogInfo(0x31140000): O ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:6,079 viewsmptscsih: ioc0: attempting task abort已关闭评论
-
linux下用python实现文本menu
Nov172009linux用shell实现menu比较简单,今天用python实现了一个,因为python没有switch语法,所以使用了dict来替代,另外调用了linux的clear来清屏,本例只是说明一下简单的实现方法,菜单的命令或者语句可以自由发挥 呵呵。 截个图先: 具体代码如下:#!/usr/bin/evn python# -*- coding: utf-8 -*-#Author: 2hei#2hei.net#Da ...
阅读全文linux下用python实现文本menu已关闭评论
-
python 访问带有web认证的页面
Nov052009python 访问带有web认证的页面,经测试方法一可用! #!/usr/bin/env python# -*- coding: utf-8 -*- #方法一#————————————————————–def request_auth_http(url, User = None, Pass = ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:3,994 views | 标签:pythonpython 访问带有web认证的页面已关闭评论
-
wget访问带认证的web页面
Nov032009同样的wget语句在不通的机器上居然执行效果不一样,原因是wget版本的问题: wget –help | headGNU Wget 1.9+cvs-stable (Red Hat modified), a non-interactive network retriever.Usage: wget [OPTION]… [URL]… /usr/bin/wget -O /tmp/2hei.txt –http-user=username –http-passwd=12345 ...
阅读全文作者:2hei | 分类:OpenSource | 阅读:5,726 views | 标签:wgetwget访问带认证的web页面已关闭评论
-
ImportError: No module named xen.xm
Nov032009xen的其中一个虚拟机无法使用,重启xen后发现无法启动。
最后发现原因是升级了python版本所致,升级到了2.6.2:
之前的版本是:python -V
2.4.3降回到原来的python版本,重试OK!
阅读全文ImportError: No module named xen.xm已关闭评论
-
python use BeautifulSoup crawl weather forecast
Sep162009python 使用BeautifulSoup(美汤)来抓取天气预报,简单的例子,只当练手 #!/usr/bin/env python# -*- coding: gb2312 -*- #get weather info from internet#http://weather.china.com.cn/city/54511_full.html import urllib,re,unicodedata,string,sys,refrom BeautifulSoup import * if __name__==”__main__ ...
阅读全文python use BeautifulSoup crawl weather forecast已关闭评论