<?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>HackGou In Lamp&#124;憨狗点灯 &#187; Linux</title>
	<atom:link href="http://hackgou.itbbq.com/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://hackgou.itbbq.com</link>
	<description>LAMP开放的是代码，是接口，是互操作性</description>
	<lastBuildDate>Thu, 15 Jul 2010 14:23:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>cfengine中的literal string和regext string</title>
		<link>http://hackgou.itbbq.com/cfengine%e4%b8%ad%e7%9a%84literal-string%e5%92%8cregext-string.html</link>
		<comments>http://hackgou.itbbq.com/cfengine%e4%b8%ad%e7%9a%84literal-string%e5%92%8cregext-string.html#comments</comments>
		<pubDate>Wed, 21 Apr 2010 07:24:47 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原意字符串]]></category>
		<category><![CDATA[cfengine]]></category>
		<category><![CDATA[literal string]]></category>
		<category><![CDATA[regex string]]></category>
		<category><![CDATA[正则表达式]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/cfengine%e4%b8%ad%e7%9a%84literal-string%e5%92%8cregext-string.html</guid>
		<description><![CDATA[这篇日志的起因是因为cfengine加了一项auto mount项，但是在/etc/auto_*的配置中却无法更新。
加上-v执行cfagent之后，得到一个提示：
resetting pointers to line 1 Edit: Search for \* -rw,vers=3,proto=tcp,sec=sys,rsize=32768,wsize=32768,timeo=600,actimeo=1200,retrans=2,nodev,hard,context=system_u:object_r:httpd_sys_content_t:s0 nss1.la.vclk.net:/vol/mezi_websites_beta/&#38; failed. Current line still 1 LocateLineMatchingRegexp failed in /etc/auto_mezi_sites, aborting editing End editing /etc/auto_mezi_sites
这个提示信息来自这段配置：
BeginGroupIfNoSuchLine &#8220;* -$(optsRWwebSe) nss1.la.vclk.net:/vol/mezi_websites_beta/&#38;&#8221; DefineInGroup &#8220;ReloadAutoFS&#8221; ResetSearch &#8220;1&#8243; DeleteLinesMatching &#8220;\*[ ].*&#8221; AppendIfNoSuchLine &#8220;\* -$(optsRWwebSe) nss1.la.vclk.net:/vol/mezi_websites_beta/&#38;&#8221; EndGroup ResetSearch &#8220;1&#8243; LocateLineMatching &#8220;* -$(optsRWwebSe) nss1.la.vclk.net:/vol/mezi_websites_beta/&#38;&#8221; DeleteLinesAfterThisMatching &#8220;\*[ ].*&#8221;
上面这个配置，其实是为了增加下面这一行：
* -rw,vers=3,proto=tcp,sec=sys,rsize=32768,wsize=32768,timeo=600,actimeo=1200,retrans=2,nodev,hard,context=system_u:object_r:httpd_sys_content_t:s0 nss1.l a.vclk.net:/vol/mezi_websites_beta/&#38;
这对于把一大堆目录放到存储然后auto mount时经常使用的方法，比如把HOME放到存储上，这儿是把所有的beta环境放到存储上面
同时使用auto mount自动挂载。这一行里面的*就是问题的关键点
出现这个错误根本是因为在cfengine中，有的编辑命令接受的参数是正则表达式、有的接受literal [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/cfengine%e4%b8%ad%e7%9a%84literal-string%e5%92%8cregext-string.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>两个ssh相关的ruby脚本</title>
		<link>http://hackgou.itbbq.com/%e4%b8%a4%e4%b8%aassh%e7%9b%b8%e5%85%b3%e7%9a%84ruby%e8%84%9a%e6%9c%ac.html</link>
		<comments>http://hackgou.itbbq.com/%e4%b8%a4%e4%b8%aassh%e7%9b%b8%e5%85%b3%e7%9a%84ruby%e8%84%9a%e6%9c%ac.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 09:11:12 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[net::ssh]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/%e4%b8%a4%e4%b8%aassh%e7%9b%b8%e5%85%b3%e7%9a%84ruby%e8%84%9a%e6%9c%ac.html</guid>
		<description><![CDATA[自从上次存储上面发现一个异常后，禁用不带密码的key。 而且关掉了sudo的nopasswd选项， 这下苦了我们自己，面对成百上千的服务器，需要拷贝个文件啊 或者root权限做个事情啊，那绝对是恶梦。为了拯救自己于恶梦， 利用NET::SSH，写了两个小脚本：

一个是scp.rb用来拷贝文件的，用法很简单： scp.rb hostA:/tmp/afile ./ 或者 scp.rb afiel hostA:/tmp/afile
另外一个叫ssh_sudo.rb，看名字就知道，ssh来sudo的,比如： ssh_sudo.rb hostA cat /etc/shadow 会在HostA上面执行 cat /etc/shadow

把ssh_sudo.rb中，15行换成: 15 channel.exec(&#8220;#{cmd}&#8221;) do &#124; ch, success&#124; 就成了普通版的ssh了。这两个可以解决我80%的问题了。剩下20%就根据情况，临阵定夺了 ################## scp.rb #####################
#!/usr/local/bin/ruby require &#8216;net/scp&#8217; password=&#8221;real_password&#8221; username=&#8216;real_name&#8217; src=ARGV[0] dst=ARGV[1] if ARGV[0] =~ /:/ host,remote_path=ARGV[0].split(&#8220;:&#8221;) else host,remote_path=ARGV[1].split(&#8220;:&#8221;) end Net::SCP.start( host, username, :password =&#62; password) do &#124; scp &#124; if ARGV[0] [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/%e4%b8%a4%e4%b8%aassh%e7%9b%b8%e5%85%b3%e7%9a%84ruby%e8%84%9a%e6%9c%ac.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ramfs VS tmpfs</title>
		<link>http://hackgou.itbbq.com/ramfs-vs-tmpfs.html</link>
		<comments>http://hackgou.itbbq.com/ramfs-vs-tmpfs.html#comments</comments>
		<pubDate>Wed, 20 Jan 2010 03:23:20 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ramfs]]></category>
		<category><![CDATA[tmpfs]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/ramfs-vs-tmpfs.html</guid>
		<description><![CDATA[这两种基于内存的文件系统，都可以称为内存盘。只是稍微有些差别： Mount options for ramfs Ramfs is a memory based filesystem. Mount it and you have it. Unmount it and it is gone. Present since Linux 2.3.99pre4. There are no mount options. Mount options for tmpfs The following parameters accept a suffix k, m or g for Ki, Mi, Gi (binary kilo, mega and giga) [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/ramfs-vs-tmpfs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pdo_oci_handle_factory: OCI_INVALID_HANDLE 错误</title>
		<link>http://hackgou.itbbq.com/pdo_oci_handle_factory-oci_invalid_handle-%e9%94%99%e8%af%af.html</link>
		<comments>http://hackgou.itbbq.com/pdo_oci_handle_factory-oci_invalid_handle-%e9%94%99%e8%af%af.html#comments</comments>
		<pubDate>Fri, 04 Dec 2009 10:15:00 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[execstack]]></category>
		<category><![CDATA[OCI_INVALID_HANDLE]]></category>
		<category><![CDATA[SeLinux]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/440.html</guid>
		<description><![CDATA[有应用反应，老是报错
[DEBUG] SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE (/home/szhou/rpmbuild/BUILD/PDO_OCI-1.0/oci_driver.c:463) 
在google中可以找到一大把类似的错误，都没有好的解决方法。虽然bug的提交者没有说名系统是否打开了Selinux， 但是对于今天的一个server而言 的确是因为SeLinux的缘故，在audit.log里面可以看到如下记录：
type=AVC msg=audit(1259911324.873:28565): avc: denied { execstack } for pid=19315 comm=&#8221;httpd&#8221; scontext=user_u:system_r:httpd_t:s0 tcontext=user_u:system_r:httpd_t:s0 tclass=process 解决方法就是： &#8216;/usr/bin/execstack -c /usr/lib64/oracle/10.2.0.3/client/lib/*.so*&#8217; drepper的个人主页上面有一个关于SeLinux保护内存的说明：  http://people.redhat.com/~drepper/selinux-mem.html my overview of security features 在https://bugzilla.redhat.com/show_bug.cgi?id=540466 解释如何在SeLinux下处理execstack。

    Del.icio.us : OCI_INVALID_HANDLE, SeLinux, execstack 
]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/pdo_oci_handle_factory-oci_invalid_handle-%e9%94%99%e8%af%af.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is this .nfsxxxxxxxxxxxxxx file and why can&#8217;t I remove it</title>
		<link>http://hackgou.itbbq.com/what-is-this-nfsxxxxxxxxxxxxxx-file-and-why-cant-i-remove-it.html</link>
		<comments>http://hackgou.itbbq.com/what-is-this-nfsxxxxxxxxxxxxxx-file-and-why-cant-i-remove-it.html#comments</comments>
		<pubDate>Wed, 22 Jul 2009 10:15:01 +0000</pubDate>
		<dc:creator>blog</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/what-is-this-nfsxxxxxxxxxxxxxx-file-and-why-cant-i-remove-it.html</guid>
		<description><![CDATA[What is this .nfsxxxxxxxxxxxxxx file and why can&#8217;t I remove it? 
Under unix, if you remove a file that a currently running process still has open, the file isn&#8217;t really removed. Once the process closes the file, the OS then removes the file handle and frees up the disk blocks. This process is complicated slightly [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/what-is-this-nfsxxxxxxxxxxxxxx-file-and-why-cant-i-remove-it.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ZZ]UNIX下面信号的解释</title>
		<link>http://hackgou.itbbq.com/zzunix%e4%b8%8b%e9%9d%a2%e4%bf%a1%e5%8f%b7%e7%9a%84%e8%a7%a3%e9%87%8a.html</link>
		<comments>http://hackgou.itbbq.com/zzunix%e4%b8%8b%e9%9d%a2%e4%bf%a1%e5%8f%b7%e7%9a%84%e8%a7%a3%e9%87%8a.html#comments</comments>
		<pubDate>Tue, 23 Oct 2007 10:16:40 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS_Tips]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/zzunix%e4%b8%8b%e9%9d%a2%e4%bf%a1%e5%8f%b7%e7%9a%84%e8%a7%a3%e9%87%8a.html</guid>
		<description><![CDATA[一篇非常好的解释UNIX下面信号的文章，熟悉了这些信号。
对待进程跟玩玩具似的，想怎么把玩，怎么把玩，弄死弄活，悉听尊便
原文位于：
http://blog.csdn.net/baobao8505/archive/2006/08/25/1115820.aspx
我们运行如下命令，可看到Linux支持的信号列表：
~$ kill -l
 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL
 5) SIGTRAP      6) SIGABRT      7) SIGBUS       8) SIGFPE
 9) SIGKILL  [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/zzunix%e4%b8%8b%e9%9d%a2%e4%bf%a1%e5%8f%b7%e7%9a%84%e8%a7%a3%e9%87%8a.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>httperf原来这么猛</title>
		<link>http://hackgou.itbbq.com/httperf%e5%8e%9f%e6%9d%a5%e8%bf%99%e4%b9%88%e7%8c%9b.html</link>
		<comments>http://hackgou.itbbq.com/httperf%e5%8e%9f%e6%9d%a5%e8%bf%99%e4%b9%88%e7%8c%9b.html#comments</comments>
		<pubDate>Thu, 27 Sep 2007 21:06:02 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/httperf%e5%8e%9f%e6%9d%a5%e8%bf%99%e4%b9%88%e7%8c%9b.html</guid>
		<description><![CDATA[httperf 和ab是两个web benchmark的好工具。
今天为了测试美国的两个站点的响应，把httperf的 &#8211;num-conn 设成
5000。结果不到10分钟，nagios的警报就发到手机上了：有4台服务器负载告急！简直不可思议：服务器是7台webweb加12台db组成的集群。而这个命令行只是在一台普通的pc
server上面执行的。对着其中的一台服务器做日志分析：
 0 :   918       3.23%
 1 :   470       1.65%
 2 :   427       1.50%
 3 :  1253       4.41%
 4 :  [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/httperf%e5%8e%9f%e6%9d%a5%e8%bf%99%e4%b9%88%e7%8c%9b.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C10K Problems</title>
		<link>http://hackgou.itbbq.com/c10k-problems.html</link>
		<comments>http://hackgou.itbbq.com/c10k-problems.html#comments</comments>
		<pubDate>Thu, 27 Sep 2007 18:15:02 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/c10k-problems.html</guid>
		<description><![CDATA[原文位于： http://www.kegel.com/c10k.html
The C10K problem
[Help save the best Linux news source on the web -- subscribe to Linux Weekly News!]
It&#8217;s time for web servers to handle ten thousand clients simultaneously, don&#8217;t you think? After all, the web is a big place now. 
And computers are big, too. You can buy a 1000MHz machine with 2 gigabytes [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/c10k-problems.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the ImageMagic 6.3.3  Wand-config bug</title>
		<link>http://hackgou.itbbq.com/imagemagic-633-version.html</link>
		<comments>http://hackgou.itbbq.com/imagemagic-633-version.html#comments</comments>
		<pubDate>Wed, 04 Apr 2007 10:06:00 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[生活小札]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/imagemagic-633-version.html</guid>
		<description><![CDATA[顺利安装完ImageMagic 6.3.3之后，无法顺利的把MagickWand 编进PHP，老是在check Imagemagick库的地方报错：
……
Package Wan was not found in the pkg-config search path.
……
PKG_CONFIG_PATH肯定是设置正确了的，而且就算我直接使用Wand-config
-version也无法得到版本号，开始怀疑Wand-config有问题，果然，在里面
 &#8211;version)
     pkg-config &#8211;modversion Wan
这句话不对，修改成
 &#8211;version)
     pkg-config &#8211;modversion Wand
然后再configure、make、顺利通过
]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/imagemagic-633-version.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>分区后不用重新启动，通知内核磁盘分区表发生变化</title>
		<link>http://hackgou.itbbq.com/%e5%88%86%e5%8c%ba%e5%90%8e%e4%b8%8d%e7%94%a8%e9%87%8d%e6%96%b0%e5%90%af%e5%8a%a8%ef%bc%8c%e9%80%9a%e7%9f%a5%e5%86%85%e6%a0%b8%e7%a3%81%e7%9b%98%e5%88%86%e5%8c%ba%e8%a1%a8%e5%8f%91%e7%94%9f%e5%8f%98e.html</link>
		<comments>http://hackgou.itbbq.com/%e5%88%86%e5%8c%ba%e5%90%8e%e4%b8%8d%e7%94%a8%e9%87%8d%e6%96%b0%e5%90%af%e5%8a%a8%ef%bc%8c%e9%80%9a%e7%9f%a5%e5%86%85%e6%a0%b8%e7%a3%81%e7%9b%98%e5%88%86%e5%8c%ba%e8%a1%a8%e5%8f%91%e7%94%9f%e5%8f%98e.html#comments</comments>
		<pubDate>Wed, 04 Apr 2007 08:48:02 +0000</pubDate>
		<dc:creator>HackGou</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://hackgou.itbbq.com/%e5%88%86%e5%8c%ba%e5%90%8e%e4%b8%8d%e7%94%a8%e9%87%8d%e6%96%b0%e5%90%af%e5%8a%a8%ef%bc%8c%e9%80%9a%e7%9f%a5%e5%86%85%e6%a0%b8%e7%a3%81%e7%9b%98%e5%88%86%e5%8c%ba%e8%a1%a8%e5%8f%91%e7%94%9f%e5%8f%98%e.html</guid>
		<description><![CDATA[在正在使用的磁盘上面，使用fdisk创建分区之后，需要重新启动linux， 以重读分区表信息，才能在新的分区上面建立文件系统， 为了不重新启动系统，可以使用partprobe  ，来通知内核磁盘分区表 发生变化，之后就可以使用mke2fs创建文件系统了，这个是创建lvm时的一个片段：
Command (m for help): p
Disk /dev/hda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      [...]]]></description>
		<wfw:commentRss>http://hackgou.itbbq.com/%e5%88%86%e5%8c%ba%e5%90%8e%e4%b8%8d%e7%94%a8%e9%87%8d%e6%96%b0%e5%90%af%e5%8a%a8%ef%bc%8c%e9%80%9a%e7%9f%a5%e5%86%85%e6%a0%b8%e7%a3%81%e7%9b%98%e5%88%86%e5%8c%ba%e8%a1%a8%e5%8f%91%e7%94%9f%e5%8f%98e.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
