MSN: luxuabc@hotmail.com

发布新日志

  • 如何在Linux系统下添加硬盘

    2010-06-17 11:05:47

    要在Linux下添加硬盘有以下几个步骤:
    1. 在计算机上安装硬盘,电脑会自动识别到该硬盘。
    2. 开机运行命令fdisk -l查看硬盘分区情况,如下
    Disk /dev/hda: 21.4 GB, 21474836480 bytes
    255 heads, 63 sectors/track, 2610 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1          13      104391   83  Linux
    /dev/hda2              14          89      610470   82  Linux swap / Solaris
    /dev/hda3              90        2610    20249932+  83  Linux
    Disk /dev/hdb: 10.7 GB, 10737418240 bytes
    255 heads, 63 sectors/track, 1305 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk /dev/hdb doesn't contain a valid partition table

    hda是应景分区好的第一块IDE硬盘,我们看到有三个分区分别为hda1,hda2,hda3. /dev/hdb就是我们新安装的硬盘,可以看到“/dev/hdb doesn't contain a valid partition table”说明该硬盘还没被分区。另外如果硬盘为sda,sdb...说明硬盘是SCSI硬盘。

    3. 对硬盘进行分区,运行fdisk -u /dev/hdb。m可显示帮助,一般我们用命令a来添加新分区。可以是主分区,也可以是扩展分区。最后输入w,保存退出。运行fdisk -l,部分显示如下:
    Disk /dev/hdb: 10.7 GB, 10737418240 bytes
    255 heads, 63 sectors/track, 1305 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdb1               1        1305    10482381   83  Linux

    4. 对分区进行格式化,mkfs.ext3 /dev/hdb1

    5. 挂载硬盘,
    root@g11-64-1 ~]# mkdir /mnt/hdb1
    [root@g11-64-1 ~]# mount /dev/hdb1 /mnt/hdb1
    [root@g11-64-1 ~]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda3              19G  8.2G  9.7G  46% /
    /dev/hda1              99M   16M   79M  17% /boot
    tmpfs                 250M     0  250M   0% /dev/shm
    /dev/hdb1             9.9G  151M  9.2G   2% /mnt/hdb1

    6. 修改文件/etc/fstab, 使得开机自动加载该硬盘分区。加入一行如:
    /dev/hdb1       /mnt/hdb1        ext3   defaults   0    0
  • UI测试指南和自动化工具介绍

    2009-01-08 10:55:19

        我新上传了文件,界面测试指南和界面自动化测试工具介绍,这是我做用户界面自动化测试的一些总结。希望对大家有所帮助。请从我的文件中下载:
    http://www.51testing.com/?39769/action_viewspace_itemid_102042.html
    http://www.51testing.com/?39769/action_viewspace_itemid_102043.html

  • iptables nat表的使用

    2007-11-24 16:27:24

    iptables中nat表可以实现SNAT, DNAT, 双向NAT和两次NAT.

    一. 源地址NAT

    1. 标准的SNAT

    SNAT的目的是进行源地址转换,应用于POSTROUTING规则链.在路由决定之后应用.SNAT与出站接口相关,而不是入站接口. 语法如下:

    iptables -t nat -A POSTROUTING -o <outgoing interface> ... \

             -j SNAT --to-source <address>[-<address>][:port-port]

    2. MASQUERADE源NAT

    MASQUERADE没有选项来指定在NAT设备上使用的特定源地址,使用的源地址就是出站好接口的地址.

    iptables -t nat -A POSTROUTING -o <outgoing interface> ... \

             -j MASQUERADE [--to-ports <port>[-port]]

    二. 目的地址NAT

       目的地址NAT有2种形式: DNAT和REDIRECT. REDIRECT是目的地址转换的特殊形式,将数据包重定向到NAT设备的输入或回环接口. 目的地址NAT应用于nat表的PREROUTING和OUTPUT规则链,在做出路由决定前对目的地址进行修改.在PREROUTING中,DNAT和REDIRECT规则与用来接受通过本地路由转发或送到主机的入站接口的数据包的入站接口有关.在OUTPUT中,DNAT和REDIRECT规则用来处理来自NAT主机本身生成的出站数据包.

    1. 标准目的地址NAT(DNAT)

    iptables -t nat -A PREROUTING -i <incoming interface> ... \

             -j DNAT --to-destination <address>[-<address>][:port-port]

    iptables -t nat -A OUTPUT -o <outgoing interface> ... \

             -j DNAT --to-destination <address>[-<address>][:port-port]

    目的地址用来替换数据包中的原始目的地址,多位本地服务器地址.

    2. REDIRECT

    iptables -t nat -A PREROUTING -i <incoming interface> ... \

             -j REDIRECT [--to-ports <port>[-port]]

    iptables -t nat -A OUTPUT -o <outgoing interface> ... \

             -j REDIRECT [--to-ports <port>[-port]]

    REDIRECT重定向数据包到执行REDIRECT操作的那台主机.

     

  • Linux防火墙介绍

    2007-11-22 16:51:35

    最近学习了一下Linux的防火墙,也就是iptables.现在总结一下给大家分享希望有所帮助:

       早期的Linux系统采用的防火墙是IPFW,其管理程序是ipchains。而现今的发行版都已经采用了新的防火墙架构Netfilter,管理程序是iptables,所以也称作iptables防火墙。

       iptables防火墙是基于表,链和规则来实现的,它有三张表:filter、NAT和mangle。每张表里都有内建的一些规则链(用户也可自定义规则链),规则链顾名思义就是由多条规则组成,每个规则就是一条iptables命令。当数据包进入或输出或转发的时候就会经过相应的规则链,系统会按顺序来匹配这些规则,当匹配其中一条的时候就做这条规则所定义的动作,不再继续匹配后面的规则。如果没有匹配任何一个规则,就进行默认的操作,用户可以定义是接受还是禁止。当然,禁止是安全的选择。

       filter表是默认的表,主要进行数据包过滤功能。有内建的3个规则链INPUT,OUTPUT和FORWARD。INPUT是处理输入或即将进入防火墙的数据的规则链,OUTPUT是处理输出或即将离开防火墙的规则链,FORWARD是处理转发或通过防火墙被送出的数据的规则链。

       NAT表的功能主要就是实现网络地址转换(NAT)。它有3个内建的规则链:PREROUTING规则链在传递入站数据包到路由功能前修改其目的地址(DNAT),OUTPUT规则链指定了在作出路由决定之前对本地产生的出站数据包目的地址的修改,POSTROUTING规则链制定了对将要通过防火墙路由出去的出站数据包源地址的修改(SNAT)。iptables支持4个常见的NAT类型:SNAT、DNAT、MASQUERADE(伪装)和REDIRECT(本地端口重定向)。

       mangle表能够给数据包打上标记或者将一个由Netfilter维护的值与数据包联系起来。它有5个内建的规则链,PREROUTING规则链指定了当入站数据包到达网络接口但还没有作出任何路由或本地传递时对数据包所做的修改。INPUT规则链指定了进行数据包处理时对数据包所做的修改,在PREROUTING后使用。FORWARD规则链指定了对转发出防火墙的数据包所做的修改。OUPUT规则链指定了对本地出站数据包所做的修改。POSTROUTING规则链指定了数据包将要离开防火墙时对数据包所做的修改,在OUTPUT后使用。

       具体一个数据包的过滤流程如下图所示:

  • Web UI测试指南

    2007-11-21 17:46:25

    UI Testing Guideline

    For design:
    1.Check whether the control flow and design accord with industry standard.
    2.Check whether the UI design accord with Trend standard.
    3.Compare final UI with UI prototype, make sure they are consistent.
    4.Check whether default value is correct.

    For functional:
    1.The UI setting can write to configuration file correctly. The “Save” and “Cancel” button on each page work normally.
    2.Check whether the keyboard shortcut key can work.
    3.Test each Numeric input field: input different type number or none-number characters.
    4.Test each Text input field: input DBCS/SBCS characters and symbol characters.
    5.Test each file path field: input DBCS/SBCS characters and special string such as “許功成峰峯”.

    For Wording and Message:
    1.Check whether the wording and message has spelling error.
    2.Check whether the message string is friendly to end user.
    3.Check whether the error message can give user right and enough information.
    4.Check whether the message string is hard-code.

    For I18N and L10N:
    1.Check whether the Number format is localized.
    2.Check whether the Date and Time format is localized.
    3.Check whether the UI have enough buffer space for translate to DBCS string.
    4.Check whether have truncate string after translation.

    For compatible:
    1.Check the UI can display correctly in different Brower and different version: IE, Firefox, and Mozilla.
    2.Check the UI can run normally in different OS: Windows and Linux.
    3.Check the UI can run normally in different language platform: Japanese and German.

    For security:
    1.The console password should be encrypting. It’s better to use MD5.
    2.The UI should do password check. Such as no less than 4 characters and no more than 8 characters, etc.
Open Toolbar