当前位置: 首页 > OpenSource
  • 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 | 阅读:1,555 views | 标签:
  • 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 | 阅读:1,012 views | 标签:
    notice Hostnames should not contain an ‘_’已关闭评论
  • 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 | 阅读:4,024 views
    SHELL中的2进制、10进制、8进制、16进制之间的转换已关闭评论
  • openssh5.4升级后ssh无法登陆

    杯具啊! 新装的服务器,从openssh5.2升级到openssh5.4,重启sshd服务后发现无法登陆了!!!
    没办法,找机房人员终端登陆上去开启telnet,又把版本降了回来,汗一个!
    谁让手欠呢!
    阅读全文
    作者:2hei | 分类:OpenSource | 阅读:3,207 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 | 阅读:2,048 views | 标签:
    ethtool maybe caused by “TCP checksum offload”已关闭评论
  • linux下支持https的压力测试工具

    测试了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 ...

    阅读全文
    作者:2hei | 分类:linux, OpenSource | 阅读:11,042 views | 标签:, , ,
  • nginx authentication

    今天配置nginx的basic authentication折腾了好半天,开始error_log一直报错:no user/password was provided for basic authentication 我是按照nginx的wiki配置的:location  /  {  auth_basic            “Restricted”;  au ...

    阅读全文
    作者:2hei | 分类:OpenSource | 阅读:1,887 views | 标签:
    nginx authentication已关闭评论
  • [notice] child pid 19818 exit signal Bus error (7)

    apache 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 | 阅读:3,970 views | 标签:
  • 使用apache的mod_rewrite模块进行端口重写且保留特殊接口

    需求如下:网站的apache开通80和443端口,整站强制使用https,把所有80端口的访问转到443,新增需求为要针对某个接口单独开放80端口(80、443均可访问),剩下其他接口保持原有规则。 配置一、RewriteRule !^/TestServlet http://%{SERVER_NAME}/$1 [L,R=301] 是有问题的,$1并没取得匹配的部分。 根据apache文档,使用 ...

    阅读全文
    作者:2hei | 分类:OpenSource | 阅读:1,909 views
    使用apache的mod_rewrite模块进行端口重写且保留特殊接口已关闭评论
  • 8.8.8.8-google-public-dns-for-free

    http://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 | 阅读:1,030 views | 标签:
    8.8.8.8-google-public-dns-for-free已关闭评论
  • xenconsole: Could not read tty from store: No such file or directory

    #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 | 阅读:1,379 views
    xenconsole: Could not read tty from store: No such file or directory已关闭评论
  • Read-only file system on CentOS5

    We 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 | 阅读:1,246 views
    Read-only file system on CentOS5已关闭评论
  • mptscsih: ioc0: attempting task abort

    Nov 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 | 阅读:1,800 views
    mptscsih: ioc0: attempting task abort已关闭评论
  • linux下用python实现文本menu

    linux用shell实现menu比较简单,今天用python实现了一个,因为python没有switch语法,所以使用了dict来替代,另外调用了linux的clear来清屏,本例只是说明一下简单的实现方法,菜单的命令或者语句可以自由发挥 呵呵。 截个图先: 具体代码如下:#!/usr/bin/evn python# -*- coding: utf-8 -*-#Author: 2hei#2hei.net#Da ...

    阅读全文
    作者:2hei | 分类:OpenSource, python | 阅读:1,429 views | 标签:
    linux下用python实现文本menu已关闭评论
  • python 访问带有web认证的页面

    python 访问带有web认证的页面,经测试方法一可用! #!/usr/bin/env python# -*- coding: utf-8 -*- #方法一#————————————————————–def request_auth_http(url, User = None, Pass = ...

    阅读全文
    作者:2hei | 分类:OpenSource | 阅读:1,635 views | 标签:
    python 访问带有web认证的页面已关闭评论
  • wget访问带认证的web页面

    同样的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 | 阅读:1,178 views | 标签:
    wget访问带认证的web页面已关闭评论
  • ImportError: No module named xen.xm

    xen的其中一个虚拟机无法使用,重启xen后发现无法启动。

    最后发现原因是升级了python版本所致,升级到了2.6.2:

    之前的版本是:python -V
    2.4.3

    降回到原来的python版本,重试OK!

    阅读全文
    作者:2hei | 分类:OpenSource, python | 阅读:1,377 views | 标签:
    ImportError: No module named xen.xm已关闭评论
  • python use BeautifulSoup crawl weather forecast

    python 使用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__&# ...

    阅读全文
    作者:2hei | 分类:OpenSource, python | 阅读:903 views | 标签:,
    python use BeautifulSoup crawl weather forecast已关闭评论