当前位置: 首页 > u2发布的所有日志
  • 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 ...

    阅读全文
    作者:u2 | 分类:nginx | 标签:
  • 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 ...

    阅读全文
    作者:u2 | 分类:OpenSource, python | 标签:
  • 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 ...

    阅读全文
    作者:u2 | 分类:linux | 标签:
  • 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 ...

    阅读全文
    作者:u2 | 分类:python | 标签:
    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 ...

    阅读全文
    作者:u2 | 分类:OpenSource | 标签:
    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: < ...

    阅读全文
    作者:u2 | 分类:linux | 标签:,
    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 ...

    阅读全文
    作者:u2 | 分类:linux
    linux sz rz tools已关闭评论
  • 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̸ ...

    阅读全文
    作者:u2 | 分类:linux, OpenSource, shell
    SHELL中的2进制、10进制、8进制、16进制之间的转换已关闭评论