<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>稀饭的国度 &#187; linux shell</title>
	<atom:link href="http://blog.thematice.com/html/ycategory/linux-shell/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.thematice.com</link>
	<description>发现自己的脑袋不好使了，用blog来记录真的很好用。</description>
	<lastBuildDate>Thu, 09 Feb 2012 13:33:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>10大最常用的iptables规则</title>
		<link>http://blog.thematice.com/html/y2012/607_10%e5%a4%a7%e6%9c%80%e5%b8%b8%e7%94%a8%e7%9a%84iptables%e8%a7%84%e5%88%99.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=10%25e5%25a4%25a7%25e6%259c%2580%25e5%25b8%25b8%25e7%2594%25a8%25e7%259a%2584iptables%25e8%25a7%2584%25e5%2588%2599</link>
		<comments>http://blog.thematice.com/html/y2012/607_10%e5%a4%a7%e6%9c%80%e5%b8%b8%e7%94%a8%e7%9a%84iptables%e8%a7%84%e5%88%99.html#comments</comments>
		<pubDate>Thu, 09 Feb 2012 10:13:24 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=607</guid>
		<description><![CDATA[1: iptables -A INPUT -p tcp -syn -j DROP This is a desktop-centric rule that will do two things: First it will allow you to actually work normally on your desktop. All network traffic going out of your machine will be allowed out, but all TCP/IP traffic coming into your machine will simply be dropped. [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2012/607_10%e5%a4%a7%e6%9c%80%e5%b8%b8%e7%94%a8%e7%9a%84iptables%e8%a7%84%e5%88%99.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用 cURL 度量 Web 站点的响应时间</title>
		<link>http://blog.thematice.com/html/y2010/1077_use-curl-check-web-connect-time.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-curl-check-web-connect-time</link>
		<comments>http://blog.thematice.com/html/y2010/1077_use-curl-check-web-connect-time.html#comments</comments>
		<pubDate>Wed, 21 Apr 2010 09:56:28 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux  web]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[liinux]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=1077</guid>
		<description><![CDATA[[root@web-little-opt-146 NginxSoftware]# time curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} http://image.kaluli.net/index/images/index/20100416/127141246304.gif 1.259:1.281:1.392 real    0m1.394s user    0m0.002s sys     0m0.003s 　　清单 1 给出对一个流行的新闻站点执行 curl 命令的情况。输出通常是 HTML 代码，通过 -o 参数发送到 /dev/null。-s 参数去掉所有状态信息。-w 参数让 curl 写出表 1 列出的计时器的状态信息： 表 1. curl 使用的计时器 计时器 描述 time_connect 建立到服务器的 TCP 连接所用的时间 time_starttransfer 在发出请求之后，Web 服务器返回数据的第一个字节所用的时间 time_total 完成请求所用的时间 　　这些计时器都相对于事务的起始时间，甚至要先于 Domain Name Service（DNS）查询。因此，在发出请求之后，         Web 服务器处理请求并开始发回数据所用的时间是 [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/1077_use-curl-check-web-connect-time.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sed1line_zh-CN</title>
		<link>http://blog.thematice.com/html/y2010/1035_sed1line_zh-cn.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sed1line_zh-cn</link>
		<comments>http://blog.thematice.com/html/y2010/1035_sed1line_zh-cn.html#comments</comments>
		<pubDate>Tue, 23 Feb 2010 02:13:11 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[sed&swk&shell]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=1035</guid>
		<description><![CDATA[?Download shell.sh1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/1035_sed1line_zh-cn.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>端口扫描程序nmap使用手册</title>
		<link>http://blog.thematice.com/html/y2010/1030_%e7%ab%af%e5%8f%a3%e6%89%ab%e6%8f%8f%e7%a8%8b%e5%ba%8fnmap%e4%bd%bf%e7%94%a8%e6%89%8b%e5%86%8c.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e7%25ab%25af%25e5%258f%25a3%25e6%2589%25ab%25e6%258f%258f%25e7%25a8%258b%25e5%25ba%258fnmap%25e4%25bd%25bf%25e7%2594%25a8%25e6%2589%258b%25e5%2586%258c</link>
		<comments>http://blog.thematice.com/html/y2010/1030_%e7%ab%af%e5%8f%a3%e6%89%ab%e6%8f%8f%e7%a8%8b%e5%ba%8fnmap%e4%bd%bf%e7%94%a8%e6%89%8b%e5%86%8c.html#comments</comments>
		<pubDate>Tue, 23 Feb 2010 02:03:37 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[linx]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=1030</guid>
		<description><![CDATA[其实还是建议看英文的man，对以后学习其他东西很有帮助的：） 摘要 　　nmap是一个网络探测和安全扫描程序，系统管理者和个人可以使用这个软件扫描大型的网络，获取那台主机正在运行以及提供什么服务等信息。nmap支持很多扫描技术，例如：UDP、TCP connect()、TCP SYN(半开扫描)、ftp代理(bounce攻击)、反向标志、ICMP、FIN、ACK扫描、圣诞树(Xmas Tree)、SYN扫描和null扫描。从扫描类型一节可以得到细节。nmap还提供了一些高级的特征，例如：通过TCP/IP协议栈特征探测操作系统类型，秘密扫描，动态延时和重传计算，并行扫描，通过并行ping扫描探测关闭的主机，诱饵扫描，避开端口过滤检测，直接RPC扫描(无须端口影射)，碎片扫描，以及灵活的目标和端口设定. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 1.名称 nmap-网络探测和安全扫描工具 2.语法 nmap [Scan Type(s)] [Options] 3.描述 　　nmap是一个网络探测和安全扫描程序，系统管理者和个人可以使用这个软件扫描大型的网络，获取那台主机正在运行以及提供什么服务等信息。nmap支持很多扫描技术，例如：UDP、TCP connect()、TCP SYN(半开扫描)、ftp代理(bounce攻击)、反向标志、ICMP、FIN、ACK扫描、圣诞树(Xmas Tree)、SYN扫描和null扫描。从扫描类型一节可以得到细节。nmap还提供了一些高级的特征，例如：通过TCP/IP协议栈特征探测操作系统类型，秘密扫描，动态延时和重传计算，并行扫描，通过并行ping扫描探测关闭的主机，诱饵扫描，避开端口过滤检测，直接RPC扫描(无须端口影射)，碎片扫描，以及灵活的目标和端口设定。 　　为了提高nmap在non-root状态下的性能，软件的设计者付出了很大的努力。很不幸，一些内核界面(例如raw socket)需要在root状态下使用。所以应该尽可能在root使用nmap。 　　nmap运行通常会得到被扫描主机端口的列表。nmap总会给出well known端口的服务名(如果可能)、端口号、状态和协议等信息。每个端口的状态有：open、filtered、unfiltered。open状态意味着目标主机能够在这个端口使用accept()系统调用接受连接。filtered状态表示：防火墙、包过滤和其它的网络安全软件掩盖了这个端口，禁止 nmap探测其是否打开。unfiltered表示：这个端口关闭，并且没有防火墙/包过滤软件来隔离nmap的探测企图。通常情况下，端口的状态基本都是unfiltered状态，只有在大多数被扫描的端口处于filtered状态下，才会显示处于unfiltered状态的端口。 　　根据使用的功能选项，nmap也可以报告远程主机的下列特征：使用的操作系统、TCP序列、运行绑定到每个端口上的应用程序的用户名、DNS名、主机地址是否是欺骗地址、以及其它一些东西。 4.功能选项 　　功能选项可以组合使用。一些功能选项只能够在某种扫描模式下使用。nmap会自动识别无效或者不支持的功能选项组合，并向用户发出警告信息。 　　如果你是有经验的用户，可以略过结尾的示例一节。可以使用nmap -h快速列出功能选项的列表。 4.1 扫描类型 　　-sT 　　TCP connect()扫描：这是最基本的TCP扫描方式。connect()是一种系统调用，由操作系统提供，用来打开一个连接。如果目标端口有程序监听， connect()就会成功返回，否则这个端口是不可达的。这项技术最大的优点是，你勿需root权限。任何UNIX用户都可以自由使用这个系统调用。这种扫描很容易被检测到，在目标主机的日志中会记录大批的连接请求以及错误信息。 　　-sS 　　TCP同步扫描(TCP SYN)：因为不必全部打开一个TCP连接，所以这项技术通常称为半开扫描(half-open)。你可以发出一个TCP同步包(SYN)，然后等待回应。如果对方返回SYN&#124;ACK(响应)包就表示目标端口正在监听；如果返回RST数据包，就表示目标端口没有监听程序；如果收到一个SYN&#124;ACK包，源主机就会马上发出一个RST(复位)数据包断开和目标主机的连接，这实际上有我们的操作系统内核自动完成的。这项技术最大的好处是，很少有系统能够把这记入系统日志。不过，你需要root权限来定制SYN数据包。 　　-sF -sF -sN 　　秘密FIN数据包扫描、圣诞树(Xmas Tree)、空(Null)扫描模式：即使SYN扫描都无法确定的情况下使用。一些防火墙和包过滤软件能够对发送到被限制端口的SYN数据包进行监视，而且有些程序比如synlogger和courtney能够检测那些扫描。这些高级的扫描方式可以逃过这些干扰。这些扫描方式的理论依据是：关闭的端口需要对你的探测包回应RST包，而打开的端口必需忽略有问题的包(参考RFC 793第64页)。FIN扫描使用暴露的FIN数据包来探测，而圣诞树扫描打开数据包的FIN、URG和PUSH标志。不幸的是，微软决定完全忽略这个标准，另起炉灶。所以这种扫描方式对Windows95/NT无效。不过，从另外的角度讲，可以使用这种方式来分别两种不同的平台。如果使用这种扫描方式可以发现打开的端口，你就可以确定目标注意运行的不是Windows系统。如果使用-sF、-sX或者-sN扫描显示所有的端口都是关闭的，而使用SYN扫描显示有打开的端口，你可以确定目标主机可能运行的是Windwos系统。现在这种方式没有什么太大的用处，因为nmap有内嵌的操作系统检测功能。还有其它几个系统使用和windows同样的处理方式，包括Cisco、BSDI、HP/UX、MYS、IRIX。在应该抛弃数据包时，以上这些系统都会从打开的端口发出复位数据包。 　　-sP 　　ping扫描：有时你只是想知道此时网络上哪些主机正在运行。通过向你指定的网络内的每个IP地址发送ICMP echo请求数据包，nmap就可以完成这项任务。如果主机正在运行就会作出响应。不幸的是，一些站点例如：microsoft.com阻塞ICMP echo请求数据包。然而，在默认的情况下nmap也能够向80端口发送TCP ack包，如果你收到一个RST包，就表示主机正在运行。nmap使用的第三种技术是：发送一个SYN包，然后等待一个RST或者SYN/ACK包。对于非root用户，nmap使用connect()方法。 　　在默认的情况下(root用户)，nmap并行使用ICMP和ACK技术。 　　注意，nmap在任何情况下都会进行ping扫描，只有目标主机处于运行状态，才会进行后续的扫描。如果你只是想知道目标主机是否运行，而不想进行其它扫描，才会用到这个选项。 　　-sU 　　UDP扫描：如果你想知道在某台主机上提供哪些UDP(用户数据报协议,RFC768)服务，可以使用这种扫描方法。nmap首先向目标主机的每个端口发出一个0字节的UDP包，如果我们收到端口不可达的ICMP消息，端口就是关闭的，否则我们就假设它是打开的。 　　有些人可能会想UDP扫描是没有什么意思的。但是，我经常会想到最近出现的solaris rpcbind缺陷。rpcbind隐藏在一个未公开的UDP端口上，这个端口号大于32770。所以即使端口111(portmap的众所周知端口号) [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/1030_%e7%ab%af%e5%8f%a3%e6%89%ab%e6%8f%8f%e7%a8%8b%e5%ba%8fnmap%e4%bd%bf%e7%94%a8%e6%89%8b%e5%86%8c.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用awk进行大小写转换</title>
		<link>http://blog.thematice.com/html/y2010/938_%e4%bd%bf%e7%94%a8awk%e8%bf%9b%e8%a1%8c%e5%a4%a7%e5%b0%8f%e5%86%99%e8%bd%ac%e6%8d%a2.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25bd%25bf%25e7%2594%25a8awk%25e8%25bf%259b%25e8%25a1%258c%25e5%25a4%25a7%25e5%25b0%258f%25e5%2586%2599%25e8%25bd%25ac%25e6%258d%25a2</link>
		<comments>http://blog.thematice.com/html/y2010/938_%e4%bd%bf%e7%94%a8awk%e8%bf%9b%e8%a1%8c%e5%a4%a7%e5%b0%8f%e5%86%99%e8%bd%ac%e6%8d%a2.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:58:08 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[sed&swk&shell]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[echo]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=938</guid>
		<description><![CDATA[echo abc&#124;tr a-z A-Z 文件大小写转换 awk &#8216;{print tolower($1)}&#8217; up.txt awk &#8216;{print toupper($1)}&#8217; up.txt]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/938_%e4%bd%bf%e7%94%a8awk%e8%bf%9b%e8%a1%8c%e5%a4%a7%e5%b0%8f%e5%86%99%e8%bd%ac%e6%8d%a2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUNC &#124; Fedora特性-Smolt 解决硬件兼容烦恼</title>
		<link>http://blog.thematice.com/html/y2010/987_fedora%e7%89%b9%e6%80%a7-smolt-%e8%a7%a3%e5%86%b3%e7%a1%ac%e4%bb%b6%e5%85%bc%e5%ae%b9%e7%83%a6%e6%81%bc.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fedora%25e7%2589%25b9%25e6%2580%25a7-smolt-%25e8%25a7%25a3%25e5%2586%25b3%25e7%25a1%25ac%25e4%25bb%25b6%25e5%2585%25bc%25e5%25ae%25b9%25e7%2583%25a6%25e6%2581%25bc</link>
		<comments>http://blog.thematice.com/html/y2010/987_fedora%e7%89%b9%e6%80%a7-smolt-%e8%a7%a3%e5%86%b3%e7%a1%ac%e4%bb%b6%e5%85%bc%e5%ae%b9%e7%83%a6%e6%81%bc.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:44:21 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[certmaster]]></category>
		<category><![CDATA[func]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[python-ctypes]]></category>
		<category><![CDATA[python-paste]]></category>
		<category><![CDATA[python-simplejson]]></category>
		<category><![CDATA[smolt]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=987</guid>
		<description><![CDATA[许多Linux爱好者购买新电脑时首先考虑的就是硬件配置是否与Linux系统兼容，实际上更多的人只是购买自己喜欢的外形和配置的电脑硬件，当他们回家安装Linux发行版时却发现很多硬件不能被系统识别和正确支持。情理之中，这些人可能就会到论坛和别人抱怨Linux是一个如何土的系统，“怎么连xx都不支持？”。 如果有一个软件能够跟踪和记录所有硬件对Linux发行版的支持和兼容性，那对用户将是一个非常体贴和诱人的事。在Fedora里，你的需求就能够得到满足。 Fedora里面有个叫做Smolt的项目，他的详细描述可以在http://smolts.org/wiki/Main_Page 得到，已经收集超过7万9000个硬件配置信息。所有数据都可以在Smolt网站看到，这些配置信息将用于促进厂商合作，改进用户的硬件使用体验，评测系统和更好的报告工具，并为常用硬件提高开发和质量检测优先级。访问Smolt主页：http://smolt.fedoraproject.org/ Smolt and Func: Fedora Unified Network Controller Smolt是一款常用硬件剖析工具, 现在已经收集超过7万9000个硬件配置信息. 所有数据都可以在Smolt网站看到. 这些配置信息将用于促进厂商合作, 改进用户的硬件使用体验, 评测系统和更好的报告工具, 并为常用硬件提高开发和质量检测优先级 当前状态: http://smolt.fedoraproject.org/ 项目主页: https://hosted.fedoraproject.org/projects/smolt/ https://fedorahosted.org/func/wiki]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/987_fedora%e7%89%b9%e6%80%a7-smolt-%e8%a7%a3%e5%86%b3%e7%a1%ac%e4%bb%b6%e5%85%bc%e5%ae%b9%e7%83%a6%e6%81%bc.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUNC &#124; 终于找到问题了(about func)  [转载]</title>
		<link>http://blog.thematice.com/html/y2010/976_%e7%bb%88%e4%ba%8e%e6%89%be%e5%88%b0%e9%97%ae%e9%a2%98%e4%ba%86about-func-%e8%bd%ac%e8%bd%bd.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e7%25bb%2588%25e4%25ba%258e%25e6%2589%25be%25e5%2588%25b0%25e9%2597%25ae%25e9%25a2%2598%25e4%25ba%2586about-func-%25e8%25bd%25ac%25e8%25bd%25bd</link>
		<comments>http://blog.thematice.com/html/y2010/976_%e7%bb%88%e4%ba%8e%e6%89%be%e5%88%b0%e9%97%ae%e9%a2%98%e4%ba%86about-func-%e8%bd%ac%e8%bd%bd.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:37:17 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[certmaster]]></category>
		<category><![CDATA[func]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[python-ctypes]]></category>
		<category><![CDATA[python-paste]]></category>
		<category><![CDATA[python-simplejson]]></category>
		<category><![CDATA[smolt]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=976</guid>
		<description><![CDATA[故障现象 1、在客户端安装好func及certmaster，配好certmaster参数。 2、service funcd start，端口及进程都起来了。 3、在certmaster server 运行certmaster-ca &#8211;list死活看不到客户端的主机名。 排查过程 1、将certmaster的主机名换成IP，无效。 2、更新客户端的func及certmaster版本，无效。 3、运行/usr/bin/certmaster-request，提示：socket.error: (111, &#8216;Connection refused&#8217;)，将certmaster修改成localhost就正常了。原因可以就在这里，因为certmaster是双向的，发现在/etc/hosts中有主机名指向127.0.0.1，此时连接不上certmaster server了。将/etc/hosts中的主机名删除，再用/usr/bin/certmaster-request来测试连接，成功！！在certmaster也能看到主机了，大功告成。]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/976_%e7%bb%88%e4%ba%8e%e6%89%be%e5%88%b0%e9%97%ae%e9%a2%98%e4%ba%86about-func-%e8%bd%ac%e8%bd%bd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUNC &#124; FUNC模块学习笔记[转载]</title>
		<link>http://blog.thematice.com/html/y2010/974_func%e6%a8%a1%e5%9d%97%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%e8%bd%ac%e8%bd%bd.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=func%25e6%25a8%25a1%25e5%259d%2597%25e5%25ad%25a6%25e4%25b9%25a0%25e7%25ac%2594%25e8%25ae%25b0%25e8%25bd%25ac%25e8%25bd%25bd</link>
		<comments>http://blog.thematice.com/html/y2010/974_func%e6%a8%a1%e5%9d%97%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%e8%bd%ac%e8%bd%bd.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:34:58 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[certmaster]]></category>
		<category><![CDATA[func]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[python-ctypes]]></category>
		<category><![CDATA[python-paste]]></category>
		<category><![CDATA[python-simplejson]]></category>
		<category><![CDATA[smolt]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=974</guid>
		<description><![CDATA[* BridgeModule &#8212; Allows for simple network bridge management &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 功能：操作网桥 方法： list() Returns a dictionary containing the bridges and their connected interfaces. add_bridge(brname) Creates a new bridge named brname. add_interface(brname, ifname) Adds interface ifname to bridge brname. delete_bridge(brname) Deletes bridge brname. delete_interface(brname, ifname) Removes interface ifname from bridge brname. add_promisc_bridge(brname, ifname) Creates a new [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/974_func%e6%a8%a1%e5%9d%97%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%e8%bd%ac%e8%bd%bd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUNC &#124; Func：系统管理员的终极利器</title>
		<link>http://blog.thematice.com/html/y2010/971_func%ef%bc%9a%e7%b3%bb%e7%bb%9f%e7%ae%a1%e7%90%86%e5%91%98%e7%9a%84%e7%bb%88%e6%9e%81%e5%88%a9%e5%99%a8.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=func%25ef%25bc%259a%25e7%25b3%25bb%25e7%25bb%259f%25e7%25ae%25a1%25e7%2590%2586%25e5%2591%2598%25e7%259a%2584%25e7%25bb%2588%25e6%259e%2581%25e5%2588%25a9%25e5%2599%25a8</link>
		<comments>http://blog.thematice.com/html/y2010/971_func%ef%bc%9a%e7%b3%bb%e7%bb%9f%e7%ae%a1%e7%90%86%e5%91%98%e7%9a%84%e7%bb%88%e6%9e%81%e5%88%a9%e5%99%a8.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:26:52 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[certmaster]]></category>
		<category><![CDATA[func]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[python-ctypes]]></category>
		<category><![CDATA[python-paste]]></category>
		<category><![CDATA[python-simplejson]]></category>
		<category><![CDATA[smolt]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=971</guid>
		<description><![CDATA[我们经常需要编写内容重复的脚本，使用大同小异的正则表达式，解析花样百出的各种命令输出。我们为了实现操作审计，建立了命令行监控系统，但实际上只能起到事后追查责任的作用。我们想要监控所有新增系统，但完全依靠人执行的制度流程，难免会出现疏漏。 这些令系统管理员头疼不已的问题，可能已经有了终极解决方案。Red Hat 最近正式发布的 Fedora 统一网络控制器 Func（Fedora Unified Network Controller https://fedorahosted.org/func），就是为了解决这一系列统一管理监控问题，而设计开发的系统管理基础框架。 Func 有一个长长的功能特性列表，大致要点如下： • Func 可以让你在主控机上一次管理任意多台服务器，或任意多个服务器组。 • Func 基于 Certmaster（https://fedorahosted.org/certmaster/）建立了 Master &#8211; Slaves 主从 SSL 证书管控体系，可以将证书自动分发到所有受控服务器。新装服务器也可以在 Kickstart 文件中自动安装 Func，自动注册到主控服务器。 • Func 命令行可以直接发送远程命令或者远程获取数据。 • Func 开发者已经完成了大多数常用任务模块的开发：CommandModule、FileTrackerModule、JBossModule、 IPtablesModule、HardwareModule、MountModule、NagiosCheck、NetappModule、 NetworkTest、ProcessModule、ServiceModule、SysctlModule、RebootModule、 RpmModule、VirtModule、YumModule 等等，这些模块的作用都可以顾名思义，或者参考： https://fedorahosted.org/func/wiki/ModulesList 。 • 任何人都可以通过 Func 提供的 Python API 轻松编写自己的模块，以实现具体功能扩展。而且任何 Func 命令行能完成的工作，都能通过 API 编程实现。 • Func 通讯基于 [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/971_func%ef%bc%9a%e7%b3%bb%e7%bb%9f%e7%ae%a1%e7%90%86%e5%91%98%e7%9a%84%e7%bb%88%e6%9e%81%e5%88%a9%e5%99%a8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用script记录Linux终端会话</title>
		<link>http://blog.thematice.com/html/y2010/968_%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25bd%25bf%25e7%2594%25a8script%25e8%25ae%25b0%25e5%25bd%2595linux%25e7%25bb%2588%25e7%25ab%25af%25e4%25bc%259a%25e8%25af%259d</link>
		<comments>http://blog.thematice.com/html/y2010/968_%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:15:33 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/html/y2010/01/27/968/%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html</guid>
		<description><![CDATA[许多系统管理员都知道保留一个包含各种任务、配置改变等活动日志的重要性。对一些组织而言，保留“我做了这件事”或“约翰做了那件事”的简单日志就已足够；但另一些组织则需要记录所有改变。 对终端输出进行复制粘贴可能非常乏味，我们使用一个叫做script的鲜为人知的程序来解决这个问题，它是大多数Linux产品util-linux软件包的一部分。 script记录会话的一切内容：你输入的内容和你看到的内容。它甚至记录颜色；因此如果你的命令提示符或程序输出中包含颜色，script将记录它。 要使用script，简单执行以下命令： $ script 默认情况下，它向当前目录的typescript文件中写入内容。然后，你输入的一切内容都被记录到那个文件中。要往另一个文件中记录日志，只需使用script/path/to/file命令。 完成记录后，输入exit退出。这个命令将关闭script会话并保存文件。现在你可以使用cat或其它任何程序来检查日志文件。 使用script的缺点在于，它记录所有特殊的字符；因此你输入的文件中将充满控制字符和ANSI转义序列。你可以在script中使用一个非常简单的shell来解决这个问题： $ SHELL=/bin/sh PS1=”$ ” script 使用script时，不要使用交互式程序或处理窗口的程序，如vior top。它们会破坏会话的输出结果。另外，日志文件会记录你使用的任何命令行程序和你完成一项任务所采取的步骤。如果你需要在脚本中编辑一个文件，考虑退出script会话，然后用script –a（它在旧会话后添加新会话）对文件进行编辑后再重新启动会话。 SCRIPT(1) BSD General Commands Manual SCRIPT(1) NAME script &#8211; make typescript of terminal session SYNOPSIS script [-a] [-c COMMAND] [-f] [-q] [-t] [file] DESCRIPTION Script makes a typescript of everything printed on your terminal. It is useful for [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/968_%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUNC &#124; Fedora 统一网络控制器 func 介绍</title>
		<link>http://blog.thematice.com/html/y2010/965_fedora-%e7%bb%9f%e4%b8%80%e7%bd%91%e7%bb%9c%e6%8e%a7%e5%88%b6%e5%99%a8-func-%e4%bb%8b%e7%bb%8d.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fedora-%25e7%25bb%259f%25e4%25b8%2580%25e7%25bd%2591%25e7%25bb%259c%25e6%258e%25a7%25e5%2588%25b6%25e5%2599%25a8-func-%25e4%25bb%258b%25e7%25bb%258d</link>
		<comments>http://blog.thematice.com/html/y2010/965_fedora-%e7%bb%9f%e4%b8%80%e7%bd%91%e7%bb%9c%e6%8e%a7%e5%88%b6%e5%99%a8-func-%e4%bb%8b%e7%bb%8d.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 09:16:41 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[configure]]></category>
		<category><![CDATA[func]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[certmaster]]></category>
		<category><![CDATA[python-ctypes]]></category>
		<category><![CDATA[python-paste]]></category>
		<category><![CDATA[python-simplejson]]></category>
		<category><![CDATA[smolt]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=965</guid>
		<description><![CDATA[1. Func 简介: Fedora 统一网络控制器 Fedora Unified Network Controller 可以用在RedHat系列产品上 是为了解决统一管理监控问题，而设计开发的系统管理基础框架 1.1. Func 功能特性 Func 可以让你在主控机上一次管理任意多台服务器，或任意多个服务器组 Func 命令行可以直接发送远程命令或者远程获取数据 Func 通讯基于 XMLRPC 和 SSL 标准协议 新装服务器也可以在 Kickstart 文件中自动安装 Func，自动注册到主控服务器 1.2. Func 基于主控端与被控端 建立了 Master &#8211; Slaves 主从 SSL 证书管控体系，可以将证书自动分发到所有受控服务器 1.3. Func 网络架构图 1.4. Func 安装 主控端与被控端都需安装&#160; &#160;Certmaster&#160;&#160;Func 下载：[http://download.fedora.redhat.com/pub/epel/] 1.5. Func 服务端配置 /etc/certmaster/certmaster.conf 编辑，允许autosign == yes 让certmaster启动 [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/965_fedora-%e7%bb%9f%e4%b8%80%e7%bd%91%e7%bb%9c%e6%8e%a7%e5%88%b6%e5%99%a8-func-%e4%bb%8b%e7%bb%8d.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Shell 快捷键的学习使用</title>
		<link>http://blog.thematice.com/html/y2009/932_bash-shell-%e5%bf%ab%e6%8d%b7%e9%94%ae%e7%9a%84%e5%ad%a6%e4%b9%a0%e4%bd%bf%e7%94%a8.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bash-shell-%25e5%25bf%25ab%25e6%258d%25b7%25e9%2594%25ae%25e7%259a%2584%25e5%25ad%25a6%25e4%25b9%25a0%25e4%25bd%25bf%25e7%2594%25a8</link>
		<comments>http://blog.thematice.com/html/y2009/932_bash-shell-%e5%bf%ab%e6%8d%b7%e9%94%ae%e7%9a%84%e5%ad%a6%e4%b9%a0%e4%bd%bf%e7%94%a8.html#comments</comments>
		<pubDate>Sun, 27 Dec 2009 12:47:51 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Shortcuts]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=932</guid>
		<description><![CDATA[这篇 Bash Shell Shortcuts 的快捷键总结的非常好。值得学习。下面内容大多数是拷贝粘贴与总结. CTRL 键相关的快捷键: Ctrl + a &#8211; Jump to the start of the line Ctrl + b &#8211; Move back a char Ctrl + c &#8211; Terminate the command //用的最多了吧? Ctrl + d &#8211; Delete from under the cursor Ctrl + e &#8211; Jump to the end of the line Ctrl [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/932_bash-shell-%e5%bf%ab%e6%8d%b7%e9%94%ae%e7%9a%84%e5%ad%a6%e4%b9%a0%e4%bd%bf%e7%94%a8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>理解 Linux 的处理器负载均值（翻译）</title>
		<link>http://blog.thematice.com/html/y2009/923_understanding-of-the-processor-load-linux-average.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=understanding-of-the-processor-load-linux-average</link>
		<comments>http://blog.thematice.com/html/y2009/923_understanding-of-the-processor-load-linux-average.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 10:30:17 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[load Average]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=923</guid>
		<description><![CDATA[原文链接： http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages 你可能对于 Linux 的负载均值（load averages）已有了充分的了解。负载均值在 uptime 或者 top 命令中可以看到，它们可能会显示成这个样子： ?Download shell.sh1 load average: 0.09, 0.05, 0.01 很多人会这样理解负载均值：三个数分别代表不同时间段的系统平均负载（一分钟、五 分钟、以及十五分钟），它们的数字当然是越小越好。数字越高，说明服务器的负载越 大，这也可能是服务器出现某种问题的信号。 而事实不完全如此，是什么因素构成了负载均值的大小，以及如何区分它们目前的状况是 “好”还是“糟糕”？什么时候应该注意哪些不正常的数值？ 回答这些问题之前，首先需要了解下这些数值背后的些知识。我们先用最简单的例子说明， 一台只配备一块单核处理器的服务器。 行车过桥 一只单核的处理器可以形象得比喻成一条单车道。设想下，你现在需要收取这条道路的过桥 费 &#8212; 忙于处理那些将要过桥的车辆。你首先当然需要了解些信息，例如车辆的载重、以及 还有多少车辆正在等待过桥。如果前面没有车辆在等待，那么你可以告诉后面的司机通过。 如果车辆众多，那么需要告知他们可能需要稍等一会。 因此，需要些特定的代号表示目前的车流情况，例如： 0.00 表示目前桥面上没有任何的车流。 实际上这种情况与 0.00 和 1.00 之间是相同的，总而言之很通畅，过往的车辆可以丝毫不用等待的通过。 1.00 表示刚好是在这座桥的承受范围内。 这种情况不算糟糕，只是车流会有些堵，不过这种情况可能会造成交通越来越慢。 超过 1.00，那么说明这座桥已经超出负荷，交通严重的拥堵。 那么情况有多糟糕？ 例如 2.00 的情况说明车流已经超出了桥所能承受的一倍，那么将有多余过桥一倍的车辆正在焦急的等待。3.00 的话情况就更不妙了，说明这座桥基本上已经快承受不了，还有超出桥负载两倍多的车辆正在等待。 上面的情况和处理器的负载情况非常相似。一辆汽车的过桥时间就好比是处理器处理某线程 的实际时间。Unix 系统定义的进程运行时长为所有处理器内核的处理时间加上线程 在队列中等待的时间。 和收过桥费的管理员一样，你当然希望你的汽车（操作）不会被焦急的等待。所以，理想状态 下，都希望负载平均值小于 [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/923_understanding-of-the-processor-load-linux-average.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>理解Load Average做好压力测试</title>
		<link>http://blog.thematice.com/html/y2009/919_load-average-good-understanding-of-stress-testing.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=load-average-good-understanding-of-stress-testing</link>
		<comments>http://blog.thematice.com/html/y2009/919_load-average-good-understanding-of-stress-testing.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 10:27:08 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[configure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[load Average]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=919</guid>
		<description><![CDATA[最近刚接手的产品问题很多，主要是集中在产品设计和性能上，另外代码的可维护性也很差，这两周处理故障和问题的时间比较多，博客更新的也少了，下面的这篇文章是解释开发小组成员介绍并发编程的一些基本原理而收集到的一篇比较好的文章，作者以浅显易懂的方式介绍了比较复杂的概念。我觉得如果我们能够把一个复杂、抽象的概念如果能够通过生活中常见的场景来加以说明和描述出来，那么我们就真正理解了这个概念。 SIP的第四期结束了，因为控制策略的丰富，早先的的压力测试结果已经无法反映在高并发和高压力下SIP的运行状况，因此需要重新作压力测试。跟在测试人员后面做了快一周的压力测试，压力测试的报告也正式出炉，本来也就算是告一段落，但第二天测试人员说要修改报告，由于这次作压力测试的同学是第一次作，有一个指标没有注意，因此需要修改几个测试结果。那个没有注意的指标就是load average，他和我一样开始只是注意了CPU，内存的使用状况，而没有太注意这个指标，这个指标与他们通常的限制（10左右）有差别。重新测试的结果由于这个指标被要求压低，最后的报告显然不如原来的好看。自己也没有深入过压力测试，但是觉得不搞明白对将来机器配置和扩容都会有影响，因此去问了DBA和SA，得到的结果相差很大，看来不得不自己去找找问题的根本所在了。 通过下面的几个部分的了解，可以一步一步的找出Load Average在压力测试中真正的作用。 CPU时间片 为了提高程序执行效率，大家在很多应用中都采用了多线程模式，这样可以将原来的序列化执行变为并行执行，任务的分解以及并行执行能够极大地提高程序的运行效率。但这都是代码级别的表现，而硬件是如何支持的呢？那就要靠CPU的时间片模式来说明这一切。程序的任何指令的执行往往都会要竞争CPU这个最宝贵的资源，不论你的程序分成了多少个线程去执行不同的任务，他们都必须排队等待获取这个资源来计算和处理命令。先看看单CPU的情况。下面两图描述了时间片模式和非时间片模式下的线程执行的情况： 图 1 非时间片线程执行情况 图 2 非时间片线程执行情况 在图一中可以看到，任何线程如果都排队等待CPU资源的获取，那么所谓的多线程就没有任何实际意义。图二中的CPU Manager只是我虚拟的一个角色，由它来分配和管理CPU的使用状况，此时多线程将会在运行过程中都有机会得到CPU资源，也真正实现了在单CPU的情况下实现多线程并行处理。 多CPU的情况只是单CPU的扩展，当所有的CPU都满负荷运作的时候，就会对每一个CPU采用时间片的方式来提高效率。 在Linux的内核处理过程中，每一个进程默认会有一个固定的时间片来执行命令（默认为1/100秒），这段时间内进程被分配到CPU，然后独占使用。如果使用完，同时未到时间片的规定时间，那么就主动放弃CPU的占用，如果到时间片尚未完成工作，那么CPU的使用权也会被收回，进程将会被中断挂起等待下一个时间片。 CPU利用率和Load Average的区别 压力测试不仅需要对业务场景的并发用户等压力参数作模拟，同时也需要在压力测试过程中随时关注机器的性能情况，来确保压力测试的有效性。当服务器长期处于一种超负荷的情况下运行，所能接收的压力并不是我们所认为的可接受的压力。就好比项目经理在给一个人估工作量的时候，每天都让这个人工作12个小时，那么所制定的项目计划就不是一个合理的计划，那个人迟早会垮掉，而影响整体的项目进度。 CPU利用率在过去常常被我们这些外行认为是判断机器是否已经到了满负荷的一个标准，看到50%-60%的使用率就认为机器就已经压到了临界了。CPU利用率，顾名思义就是对于CPU的使用状况，这是对一个时间段内CPU使用状况的统计，通过这个指标可以看出在某一个时间段内CPU被占用的情况，如果被占用时间很高，那么就需要考虑CPU是否已经处于超负荷运作，长期超负荷运作对于机器本身来说是一种损害，因此必须将CPU的利用率控制在一定的比例下，以保证机器的正常运作。 Load Average是CPU的Load，它所包含的信息不是CPU的使用率状况，而是在一段时间内CPU正在处理以及等待CPU处理的进程数之和的统计信息，也就是CPU使用队列的长度的统计信息。为什么要统计这个信息，这个信息的对于压力测试的影响究竟是怎么样的，那就通过一个类比来解释CPU利用率和Load Average的区别以及对于压力测试的指导意义。 我们将CPU就类比为电话亭，每一个进程都是一个需要打电话的人。现在一共有4个电话亭（就好比我们的机器有4核），有10个人需要打电话。现在使用电话的规则是管理员会按照顺序给每一个人轮流分配1分钟的使用电话时间，如果使用者在1分钟内使用完毕，那么可以立刻将电话使用权返还给管理员，如果到了1分钟电话使用者还没有使用完毕，那么需要重新排队，等待再次分配使用。 图 3 电话使用场景 上图中对于使用电话的用户又作了一次分类，1min的代表这些使用者占用电话时间小于等于1min，2min表示使用者占用电话时间小于等于2min，以此类推。根据电话使用规则，1min的用户只需要得到一次分配即可完成通话，而其他两类用户需要排队两次到三次。 电话的利用率 = sum (active use cpu time)/period 每一个分配到电话的使用者使用电话时间的总和去除以统计的时间段。这里需要注意的是是使用电话的时间总和(sum(active use cpu time))，这与占用时间的总和(sum(occupy cpu time))是有区别的。（例如一个用户得到了一分钟的使用权，在10秒钟内打了电话，然后去查询号码本花了20秒钟，再用剩下的30秒打了另一个电话，那么占用了电话1分钟，实际只是使用了40秒） 电话的Average Load体现的是在某一统计时间段内，所有使用电话的人加上等待电话分配的人一个平均统计。 电话利用率的统计能够反映的是电话被使用的情况，当电话长期处于被使用而没有的到足够的时间休息间歇，那么对于电话硬件来说是一种超负荷的运作，需要调整使用频度。而电话Average Load却从另一个角度来展现对于电话使用状态的描述，Average Load越高说明对于电话资源的竞争越激烈，电话资源比较短缺。对于资源的申请和维护其实也是需要很大的成本，所以在这种高Average Load的情况下电话资源的长期“热竞争”也是对于硬件的一种损害。 低利用率的情况下是否会有高Load Average的情况产生呢？理解占有时间和使用时间就可以知道，当分配时间片以后，是否使用完全取决于使用者，因此完全可能出现低利用率高Load Average的情况。由此来看，仅仅从CPU的使用率来判断CPU是否处于一种超负荷的工作状态还是不够的，必须结合Load Average来全局的看CPU的使用情况和申请情况。 所以回过头来再看测试部对于Load Average的要求，在我们机器为8个CPU的情况下，控制在10 Load左右，也就是每一个CPU正在处理一个请求，同时还有2个在等待处理。看了看网上很多人的介绍一般来说Load简单的计算就是2* [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/919_load-average-good-understanding-of-stress-testing.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>speedometer出网络图`很小很强大~</title>
		<link>http://blog.thematice.com/html/y2009/909_speedometer%e5%87%ba%e7%bd%91%e7%bb%9c%e5%9b%be%e5%be%88%e5%b0%8f%e5%be%88%e5%bc%ba%e5%a4%a7.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=speedometer%25e5%2587%25ba%25e7%25bd%2591%25e7%25bb%259c%25e5%259b%25be%25e5%25be%2588%25e5%25b0%258f%25e5%25be%2588%25e5%25bc%25ba%25e5%25a4%25a7</link>
		<comments>http://blog.thematice.com/html/y2009/909_speedometer%e5%87%ba%e7%bd%91%e7%bb%9c%e5%9b%be%e5%be%88%e5%b0%8f%e5%be%88%e5%bc%ba%e5%a4%a7.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 03:26:15 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[speedometer]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[监控]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=909</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 今天在强大的网络上发先一个很小很强大的软件，出图效果很不错~~所以介绍给大家。`安装很方便“只要你的系统支持 python&#160; 但是如果你没有安装 python-urwid 不会出图，只会有数字显示~~好了下面讲安装~~ &#160; PS :需要 python 2.6 以上支持~ &#160; shell $&#62; wget http://excess.org/speedometer/speedometer.py shell $&#62; apt-get install python-urwid shell $&#62; cp speedometer.py /usr/local/bin/speedometer shell $&#62; chown root: /usr/local/bin/speedometer shell $&#62; chmod 755 /usr/local/bin/speedometer shell $&#62; speedometer.py/usr/local/bin/speedometer.py:21: DeprecationWarning: The popen2 module is deprecated.&#160; Use the subprocess module.&#160; import popen2Usage: speedometer [options] tap [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/909_speedometer%e5%87%ba%e7%bd%91%e7%bb%9c%e5%9b%be%e5%be%88%e5%b0%8f%e5%be%88%e5%bc%ba%e5%a4%a7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux sort 命令详解</title>
		<link>http://blog.thematice.com/html/y2009/907_linux-sort-%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-sort-%25e5%2591%25bd%25e4%25bb%25a4%25e8%25af%25a6%25e8%25a7%25a3</link>
		<comments>http://blog.thematice.com/html/y2009/907_linux-sort-%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3.html#comments</comments>
		<pubDate>Fri, 11 Dec 2009 16:06:31 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/html/y2009/12/12/907_linux-sort-%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3.html</guid>
		<description><![CDATA[&#160; &#160;sort命令的功能是对文件中的各行进行排序。sort命令有许多非常实用的选项，这些选项最初是用来对数据库格式的文件内容进行各种排序操作的。实际上，sort命令可以被认为是一个非常强大的数据管理工具，用来管理内容类似数据库记录的文件。 　　Sort命令将逐行对文件中的内容进行排序，如果两行的首字符相同，该命令将继续比较这两行的下一字符，如果还相同，将继续进行比较。 　　语法： 　　sort ［选项］ 文件 　　说明：sort命令对指定文件中所有的行进行排序，并将结果显示在标准输出上。如不指定输入文件或使用”- “，则表示排序内容来自标准输入。 &#160;　　sort排序是根据从输入行抽取的一个或多个关键字进行比较来完成的。排序关键字定义了用来排序的最小的字符序列。缺省情况下以整行为关键字按ASCII字符顺序进行排序。 &#160;　　改变缺省设置的选项主要有： &#160;　　- m 若给定文件已排好序，合并文件。 &#160;　　- c 检查给定文件是否已排好序，如果它们没有都排好序，则打印一个出错信息，并以状态值1退出。 &#160;　　- u 对排序后认为相同的行只留其中一行。 &#160;　　- o 输出文件 将排序输出写到输出文件中而不是标准输出，如果输出文件是输入文件之一，sort先将该文件的内容写入一个临时文件，然后再排序和写输出结果。 &#160;　　改变缺省排序规则的选项主要有： &#160;　　- d 按字典顺序排序，比较时仅字母、数字、空格和制表符有意义。 &#160;　　- f 将小写字母与大写字母同等对待。 &#160;　　- I 忽略非打印字符。 &#160;　　- M 作为月份比较：”JAN”]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/907_linux-sort-%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>更改/etc/fstab里的LABEL名字</title>
		<link>http://blog.thematice.com/html/y2009/761_fstab-etcfstab-label-name.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fstab-etcfstab-label-name</link>
		<comments>http://blog.thematice.com/html/y2009/761_fstab-etcfstab-label-name.html#comments</comments>
		<pubDate>Fri, 06 Nov 2009 14:12:32 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[e2label]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[LABEL]]></category>
		<category><![CDATA[mount]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=761</guid>
		<description><![CDATA[更改/etc/fstab里的LABEL名字的步骤如下： 准确的说，应该是叫修改“卷标” 这里以修改“LABEL=/pip1 /pip1 ext3 defaults”为例子： 1.umount /pip1 2.e2label /dev/hdb1 /newbatpip1 3.mount LABEL=/newbatpip1 /newbatpip1 4.修改并写入/etc/fstab 例如： LABEL=/newbatpip1 /newbatpip1 ext3 defaults 1 2]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/761_fstab-etcfstab-label-name.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wget下载整个网站</title>
		<link>http://blog.thematice.com/html/y2009/861_wget-down-all-web-site.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wget-down-all-web-site</link>
		<comments>http://blog.thematice.com/html/y2009/861_wget-down-all-web-site.html#comments</comments>
		<pubDate>Fri, 06 Nov 2009 04:14:32 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux net]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=861</guid>
		<description><![CDATA[可以使用下面的命令 wget -r -p -k -np http://blog.thematice.com , -r 表示递归下载,会下载所有的链接,不过要注意的是,不要单独使用这个参数,因为如果你要下载的网站也有别的网站的链接,wget也会把别的网站的东西下载 下来,由于互联网的特性,很有可能你会把整个互联网给下载下来 &#8211;,所以要加上 -np这个参数,表示不下载别的站点的链接. -k表示将下载的网页里的链接修改为本地链接.-p获得所以显示网页所需的元素,比如图片什么的. 另外还有其他的一些参数可以使用: -c表示断点续传 -t 100表示重试100次,-t 0表示无穷次重试 另外可以将要下载的url写到一个文件中,每个url一行,使用这样的命令 wget -i download.txt. &#8211;reject=avi,rmvb 表示不下载avi,rmvb的文件,&#8211;accept=jpg,jpeg,表示只下载jpg,jpeg的文件. 可以在用户目录下建立一个.wgetrc的文件(windows里面好像不能直接建立这样的文件,windows会认为没有文件名&#8211;),里面写上 http-proxy = 123.456.78.9:80,然后在加上参数 &#8211;proxy=on,如果需要密码,再加上下面的参数 &#8211;proxy-user=username, &#8211;proxy-passwd=password]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/861_wget-down-all-web-site.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LINUX的du命令详解</title>
		<link>http://blog.thematice.com/html/y2009/786_linux%e7%9a%84du%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux%25e7%259a%2584du%25e5%2591%25bd%25e4%25bb%25a4%25e8%25af%25a6%25e8%25a7%25a3</link>
		<comments>http://blog.thematice.com/html/y2009/786_linux%e7%9a%84du%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3.html#comments</comments>
		<pubDate>Sun, 01 Nov 2009 08:44:08 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[du]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=786</guid>
		<description><![CDATA[命令用途 du(disk usage)命令可以计算文件或目录所占的磁盘空间。没有指定任何选项时，它会测量当前工作目录与其所有子目录，分别显示各个目录所占的快数，最后才显示工作目录所占总快数。 命令格式 ?Download shell1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 du [OPTION]... [FILE]... -a, --all 包括了所有的文件，而不只是目录 --apparent-size print apparent sizes, rather than disk usage; although the apparent size is usually smaller, it may be larger [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/786_linux%e7%9a%84du%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux下dd命令详解</title>
		<link>http://blog.thematice.com/html/y2009/787_dd-command-under-linux-xiangjie.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dd-command-under-linux-xiangjie</link>
		<comments>http://blog.thematice.com/html/y2009/787_dd-command-under-linux-xiangjie.html#comments</comments>
		<pubDate>Sun, 01 Nov 2009 08:35:09 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[toos]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=787</guid>
		<description><![CDATA[使用权限: 所有使用者dd 这个指令在 manual 里的定义是 convert and copy a file 使用方式: dd [option] 如果你想要在线看 manual, 可以试试: dd &#8211;help 或是 info dd 如果你想要看看这个版本如何: dd &#8211;version 输入或输出 dd if=[STDIN] of=[STDOUT] 强迫输入或输出的Size为多少Bytes bs: dd -ibs=[BYTE] -obs=[SIZE] 强迫一次只做多少个 Bytes cbs=BYTES 跳过一段以后才输出 seek=BLOCKS 跳过一段以后才输入 skip=BLOCKS 当然你可以拿这个来方便的拷贝光碟(注意，你的光碟是标准的 iso9660格式才可以这么做唷！) ?Download shell.sh1 dd if=/dev/cdrom of=cdrom.iso 其中 if 后面以及 of 后面的内容依你的需求调整。 然后给系统这个指令就可以烧了: cdrecord -v [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/787_dd-command-under-linux-xiangjie.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

