<?xml version="1.0" encoding="gb2312"?>

<!-- RSS generated by oioj.net on 4/16/2004 ; 感谢LeXRus提供 RSS 2.0 文档; 此文件可自由使用，但请保留此行信息 --> 
<!-- Source download URL: http://blogger.org.cn/blog/rss2.asp       -->
<rss version="2.0">

<channel>
<title>邢红瑞的blog</title>
<link>http://blogger.org.cn/blog/blog.asp?name=hongrui</link>
<description>邢红瑞的博客</description>
<copyright>blogger.org.cn</copyright>
<generator>W3CHINA Blog</generator>
<webMaster>webmaster@blogger.org.cn</webMaster>
<item>
<title><![CDATA[ubuntu删除vmware]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=73639</link>
<author>hongrui</author>
<pubDate>2017/7/31 13:48:18</pubDate>
<description><![CDATA[sudo  vmware-installer -u vmware-workstation]]></description>
</item><item>
<title><![CDATA[nginx配置ssl]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=72655</link>
<author>hongrui</author>
<pubDate>2012/4/18 17:29:50</pubDate>
<description><![CDATA[<A>　
<DIV style="LINE-HEIGHT: 1.3" id=detail class=detail>
<P>
<DIV>先生成网关证书 ，仿照CA模式<BR>1 生成私钥，需要密码的<BR>openssl genrsa -des3 -out server.key 1024<BR>2 生成证书请求<BR>openssl req -new -key server.key -out server.csr<BR>3 生成证书<BR>cp server.key server.key.org<BR>openssl rsa -in server.key.org -out server.key<BR>openssl x509 -req -day 365 -in server.csr -signkey server.key -out server.crt</DIV>
<DIV>配置文件</DIV>
<DIV># HTTPS server<BR><BR>server {<BR>listen 444;<BR>server_name localhost;</DIV>
<DIV>ssl on;<BR>ssl_certificate server.crt;<BR>ssl_certificate_key server.key;</DIV>
<DIV>ssl_session_timeout 5m;</DIV>
<DIV>ssl_protocols SSLv2 SSLv3 TLSv1;<BR>ssl_ciphers HIGH:!aNULL:!MD5;<BR>ssl_prefer_server_ciphers on;</DIV>
<DIV>location / {<BR>root html;<BR>index index.html index.htm;<BR>}</DIV>
<P></P></DIV></A>]]></description>
</item><item>
<title><![CDATA[半价售书 限北京]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=53290</link>
<author>hongrui</author>
<pubDate>2012/2/2 12:12:41</pubDate>
<description><![CDATA[<a>　本人要搬家，半价出售所有图书<br>
<p>&nbsp;</p>
<p>82 windows&nbsp;核心编程 第五版 英文版&nbsp;原价 128 售价 60元</p>
<p>89 tcpip 详解卷三 原价 35元 售价 15元</p>
<p>90 tcpip 详解卷二 原价 78元 售价 30元</p>
<p>91 ant in action 第二版 中文版 原价 78元 售价30元</p>
<p>&nbsp;</p>
<p>93 windows 高级调试 原价79元 售价 40元</p>
<p>94 STL源码剖析 原价68元 售价 30元</p>
<p>&nbsp;</p>
<p>96 linux内核编程 原价 75元 售价 30元</p>
<p>有意者 发送email mfc42d@sohu.com</p></a>]]></description>
</item><item>
<title><![CDATA[2012年的计划]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=53005</link>
<author>hongrui</author>
<pubDate>2011/12/26 18:50:40</pubDate>
<description><![CDATA[
<DIV style="LINE-HEIGHT: 1.3" id=detail class=detail>
<P>
<DIV>2011年的计划很是简单，但是有点不切实际。<BR>1 熟读2个开源软件，20w行代码。<BR>2 做好一个产品WAF<BR>3 锻炼身体，努力减肥，每天锻炼半小时。<BR>4 每周抽出时间，陪陪家人，做家庭建设。<BR>5 平时抽出时间，多和朋友聊天，扩大人脉。</DIV>
<DIV>2011年中总结<BR>2011年是有收获又痛苦的一年，小祺祺出生了，当上爸爸了，知道了肩上的重任。不到半年的时间，SAG研发团队只剩下我一个人，最后我被迫离职，庆幸的SSLVPN做的已经相当成熟，即使不添加任何新功能，也能卖上3年，也算对得起网御星云了。<BR>关于VPC（VenusPacketCapture）0.1版，功能要与WPE 0.9功能相当，年底发布X64位版本。这是个不错的产品，得到windows高手桂杰的夸奖，但是理想和现实毕竟有差距的，它很难带来经济效益，只好停止开发了。<BR>每天步行也不切实际，回家后不看电脑，还是有时间锻炼身体，身体才是革命的本钱。</DIV>
<P></P></DIV>]]></description>
</item><item>
<title><![CDATA[centos安装LiHei Pro字体]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=52965</link>
<author>hongrui</author>
<pubDate>2011/12/21 11:09:09</pubDate>
<description><![CDATA[<A>　说实话 linux的桌面化做的实在太烂，这点应该学习一下微软。微软开始模仿苹果十余年后，微软才凭借Windows95真正地在操作系统领域击败了苹果公司。linux对笔记本电源 和风扇的支持，根本赶不上10年的xp。<BR>最初想下载雅黑字体，可以一直发现下载不了，后来只好使用苹果的LiHei Pro字体.<BR>在字体文件夹/usr/share/fonts下面，建立文件夹apple<BR>mkdir /usr/share/fonts/apple<BR>将LiHeiPro.ttf字体文件放入<BR>&nbsp;mv LiHei\ Pro.ttf apple/<BR>建立字体文件缓存<BR>&nbsp; cd /usr/share/fonts/apple<BR>&nbsp; mkfontscale<BR>&nbsp; mkfontdir<BR>&nbsp; fc-cache -fv<BR>设置gnome，opera的字体，全部设为LiHei Pro</A>]]></description>
</item><item>
<title><![CDATA[fedora 15  root不能登陆修改方法]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=52790</link>
<author>hongrui</author>
<pubDate>2011/12/6 20:06:45</pubDate>
<description><![CDATA[
<P>启动VMware的linux：<BR>1. 进入GRUB的彩色界面后，有3秒钟时间给你。按e进入GRUB，出现了：<BR>&nbsp;&nbsp;&nbsp; Red Hat Enterprise Linux Server (2.6.18-8.e15xen)<BR>2. 键入e出现：<BR>&nbsp;&nbsp; root（hd0,0）<BR>&nbsp;&nbsp; kerl /vmlinux-2.6.18.e15xen ro root=/dev/VolGroup00/LogVo100 rhgb quiet<BR>&nbsp;&nbsp; initrd /initrd-2.6.18-8.e15xen.img<BR>&nbsp;&nbsp; 上下键移到kerl那一行，按e进入，在行末加上“空格single”即可，回车<BR>3. 按b后进入重启模式，一定注意出现：<BR>5. 输入passwd即可修改root密码<BR>6. 完成之后reboot即可重启。</P>
<P>fedora linux 禁止输入root，输入root，和密码 然后就出现 故障鉴定 。这是因为fedora linux 默认禁止了root 超级用户。</P>
<P>通过以下修改就可以了。</P>
<P>1.进入普通用户，在终端输入su</P>
<P>2.输入root密码</P>
<P>3.用vi修改两个文件,把auth required pam_succeed_if.so user != root quiet注释掉<BR>vi /etc/pam.d/gdm<BR>vi /etc/pam.d/gdm-password</P>]]></description>
</item><item>
<title><![CDATA[secrt在实现vim彩色显示]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=52749</link>
<author>hongrui</author>
<pubDate>2011/12/2 15:59:02</pubDate>
<description><![CDATA[
<P>以前使用Xshell写程序，但是使用secrt的vim一直是黑白色。<BR>1、修改/etc/vim/vimrc中的syntax参数为on。</P>
<P>2、设置后仍然不显示颜色，而是使用下划线代替颜色。这个问题是由变量TERM的值不合适导致的，运行命令echo $TERM显示：vt100</P>
<P>那么在~/.profile或 .bashrc中设置$TERM为：xterm-color，如下所示：</P>
<P>export TERM=xterm-color</P>
<P>然后运行命令： source .profile后即可显示颜色。<BR>echo $TERM 确认一下<BR></P>
<P>鼠标选中 copy paste的方法</P>
<P>Go to Options \ Global Options on the menu:</P>
<P>In the Category listing, click on Terminal, and you should see this section of the configuration screen:</P>
<P>Just check the first two checkboxes, and you are now in business</P>]]></description>
</item><item>
<title><![CDATA[vc9编译openvpn2.2.1]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=52589</link>
<author>hongrui</author>
<pubDate>2011/11/14 14:44:39</pubDate>
<description><![CDATA[
<P><A>　先安装python2.7，主要不是3.0.python3和2的差别很大。最好使用vc9，使用vc10会麻烦一些,并且安装Windows SDK 7。<BR>在c盘根目录下建立openvpn-build目录，然后下载openvpn-2.2.1。<BR>将openssl目录，lzo目录，pkcs11-helper目录 copy到openvpn-build目录下。<BR>修改C:\openvpn-build\openvpn-2.2.1\win目录下的settings.in文件。<BR># Version numbers, settings, and dependencies<BR># for Windows OpenVPN installer.<BR>#<BR># Note that some variables are parsed by wb.py from version.m4 and are not <BR># stored in this file. This is done to allow using the old and new Windows build <BR># systems side-by-side</A></P>
<P># Features to include. DO NOT comment these out, use 1 to enable and 0 to<BR># disable.<BR>!define ENABLE_PASSWORD_SAVE 1</P>
<P># ENABLE_CLIENT_SERVER enables the point-to-multipoint support. Normally you<BR># want to have this enabled.<BR>!define ENABLE_CLIENT_SERVER 1</P>
<P># ENABLE_CLIENT_ONLY removes server-side point-to-multipoint features. This<BR># depends on ENABLE_CLIENT_SERVER being set to 1.<BR>!define ENABLE_CLIENT_ONLY 0</P>
<P>!define ENABLE_MANAGEMENT 1<BR>!define ENABLE_HTTP_PROXY 1<BR>!define ENABLE_SOCKS 1<BR>!define ENABLE_FRAGMENT 1<BR>!define ENABLE_DEBUG 1</P>
<P># Branding<BR>!define PRODUCT_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "OpenVPN"<BR>!define PRODUCT_UNIX_NAME "openvpn"<BR>!define PRODUCT_FILE_EXT&nbsp; "ovpn"</P>
<P># Include the OpenVPN GUI exe in the installer. Comment out USE_GUI to disable.<BR>!define USE_GUI<BR>!define OPENVPN_GUI_DIR "../openvpn-gui"<BR>!define OPENVPN_GUI&nbsp;&nbsp;&nbsp;&nbsp; "openvpn-gui-1.0.3.exe"</P>
<P># Prebuilt libraries.&nbsp; DMALLOC is optional.<BR>!define OPENSSL_DIR&nbsp;&nbsp; "./openssl"<BR>!define LZO_DIR&nbsp;&nbsp;&nbsp; "./lzo"<BR>!define PKCS11_HELPER_DIR "./pkcs11-helper"</P>
<P># write output files here<BR>!define DIST&nbsp;&nbsp; "dist"</P>
<P># tapinstall.exe (a.k.a. devcon.exe) source code. Not needed if DRVBINSRC is <BR># defined (or if using pre-built mode).<BR>!define TISRC&nbsp;"../tapinstall"</P>
<P># TAP adapter icon -- visible=0x81 or hidden=0x89<BR>!define PRODUCT_TAP_CHARACTERISTICS&nbsp;&nbsp;&nbsp;&nbsp; 0x81</P>
<P># TAP adapter metadata. Version information in ../version.m4.<BR>!define PRODUCT_TAP_RELDATE&nbsp;&nbsp;&nbsp; "04/19/2010"<BR>!define PRODUCT_TAP_DEVICE_DESCRIPTION&nbsp;&nbsp;&nbsp; "TAP-Win32 Adapter V9"<BR>!define PRODUCT_TAP_PROVIDER&nbsp;&nbsp;&nbsp; "TAP-Win32 Provider V9"</P>
<P># Build debugging version of TAP driver<BR>;!define PRODUCT_TAP_DEBUG</P>
<P># Build debugging version of openvpn.exe<BR>;!define PRODUCT_OPENVPN_DEBUG</P>
<P># DDK path -- currently Windows 7 WDK<BR>!define DDK_PATH "c:/winddk/7600.16385.1"<BR>;!define DDK_PATH "c:/winddk/6001.18002"</P>
<P># output path for tap_span.py<BR>!define TAP_DIST "tap_dist"</P>
<P># Visual studio path<BR>!define MSVC "C:/Program Files/Microsoft Visual Studio 9.0"</P>
<P># Visual studio C run-time library path<BR>!define MSVC_CRT "../Microsoft.VC90.CRT"</P>
<P># Code Signing.<BR># If undefined, don't sign any files.<BR>!define SIGNTOOL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "../signtool"<BR>!define PRODUCT_SIGN_CN "openvpn"</P>
<P># Directory with prebuilt TAP drivers and tapinstall.exes<BR>!define TAP_PREBUILT "../tap-prebuilt"</P>
<P>; DEBUGGING -- set to something like "-DBG2"<BR>!define OUTFILE_LABEL ""</P>
<P>; DEBUGGING -- set to something like "DEBUG2"<BR>!define TITLE_LABEL ""</P>
<P>然后打开Visual Studio 2008 命令提示，运行 python build_exe.py,编译出openvpn.exe.<BR>如果使用ide进行编译，现在工具-&gt;选项，项目和解决方案中vc++目录中添加openssl lzo pkcs11-helper的include和lib 路径。<BR>在项目菜单-&gt;openvpn属性中 配置属性-&gt;c/c++中预处理器属性页 预处理器定义添加 WIN32_LEAN_AND_MEAN;_MBCS;_CRT_SECURE_NO_DEPRECATE，<BR>在项目菜单-&gt;openvpn属性中 配置属性-&gt;连接器 输入中 附加依赖项 加入 libeay32.lib ssleay32.lib lzo2.lib crypt32.lib iphlpapi.lib ws2_32.lib wininet.lib。<BR>然后编译即可。</P>
<P>需要注意的是 命令行编译的没有问题，但是vc ide 编译的，运行时出现</P>
<P><FONT size=2 face=微软雅黑>出现&nbsp;Mon&nbsp;Nov&nbsp;21&nbsp;17:30:51&nbsp;2011&nbsp;us=760000&nbsp;Error&nbsp;opening&nbsp;registry&nbsp;key:&nbsp;SYSTEM\CurrentCon<BR>trolSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}<BR>Mon&nbsp;Nov&nbsp;21&nbsp;17:30:51&nbsp;2011&nbsp;us=760000&nbsp;Exiting<BR>Mon&nbsp;Nov&nbsp;21&nbsp;17:30:51&nbsp;2011&nbsp;us=760000&nbsp;Closing&nbsp;Win32&nbsp;semaphore&nbsp;'openvpn_netcmd'</FONT></P>
<P><FONT size=2 face=微软雅黑>查看代码 </FONT></P>
<P>RegOpenKeyEx 返回2 ，通过</P>
<P>&nbsp;DWORD dwError=0;<BR>&nbsp; char szError[256]={0};<BR>&nbsp; status = RegOpenKeyEx(<BR>&nbsp;&nbsp;&nbsp;HKEY_LOCAL_MACHINE,<BR>&nbsp;&nbsp;&nbsp;ADAPTER_KEY,<BR>&nbsp;&nbsp;&nbsp;0,<BR>&nbsp;&nbsp;&nbsp;KEY_READ,&nbsp;<BR>&nbsp;&nbsp;&nbsp;&amp;adapter_key);<BR>&nbsp; dwError = GetLastError();<BR>&nbsp; <BR>&nbsp; FormatMessage(<BR>&nbsp;&nbsp;FORMAT_MESSAGE_FROM_SYSTEM,<BR>&nbsp;&nbsp;NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;0,<BR>&nbsp;&nbsp;0,<BR>&nbsp;&nbsp;szError,<BR>&nbsp;&nbsp;sizeof(szError),<BR>&nbsp;&nbsp;NULL);</P>
<P>看不出任何错误，桂杰提示说 <FONT size=2 face=微软雅黑>是不是双字节啊，我想了一下 openvpn编译</FONT></P>
<P><FONT size=2 face=微软雅黑>openvpn属性 配置属性 -&gt;常规 中项目默认值 选择 使用多字节字符集<FONT face=宋体>。</FONT> </FONT></P>]]></description>
</item><item>
<title><![CDATA[如何调试nginx]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=52434</link>
<author>hongrui</author>
<pubDate>2011/11/1 17:36:59</pubDate>
<description><![CDATA[
<P>自己添加的nginx模块难免会出现错误，所以调试就势在必行。</P>
<P>直接运行gdb nginx 会出现 No symbol table info available。</P>
<P>编译的时候 加入CFLAGS="-g -O0"&nbsp; ./configure --prefix=/usr/local/server/nginx&nbsp;&nbsp;&nbsp;&nbsp; --with-cc-opt="-I /usr/include/pcre -I /usr/include/openssl" --with-debug&nbsp;&nbsp;&nbsp; --with-http_stub_status_module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-http_ssl_module --with-http_realip_module --with-http_ssl_module --with-http_perl_module --with-http_stub_status_module</P>
<P>然后 make </P>
<P>make install </P>]]></description>
</item><item>
<title><![CDATA[解决stropts.h: No such file or directory]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=52186</link>
<author>hongrui</author>
<pubDate>2011/10/5 19:50:51</pubDate>
<description><![CDATA[编译程序时，出现了这个错误，因为linux不支持STREAMS，缺少这个文件。<BR>stropts.h是POSIX XSR的一部分，但是linux不支持。<BR>解决办法很简单，在/usr/include目录下创建一个空的stropts.h文件。]]></description>
</item><item>
<title><![CDATA[从水浒看职场：跟对老大很重要]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51826</link>
<author>hongrui</author>
<pubDate>2011/8/9 21:27:41</pubDate>
<description><![CDATA[<A>　<FONT size=3>最近在家休年假，顺便照看一下老婆，准备一下小孩的东西，断断续续的看完了水浒,罗贯中老人家在几百年前就诠释了职场的真谛。<BR>水浒以林冲的出场作为开始，林教头在梁上泊是武功比较高的正派人物，其他大多数是地痞流氓 牢头狱霸 鸡鸣狗盗的社会渣滓组成的一群土匪，根本算不上什么农民起义。如果有农民的话，也不会超过5个。<BR>林冲是个悲情人物，他是一个封建王朝的小军官，有份不错的公务员工作，一个漂亮的妻子，一个美满的家庭。悲剧就在他更换了老大开始了，他的老大高太尉的干儿子高衙内看上林冲美貌的妻子，林冲一直认为自己能屈能伸，只好忍气吞声，背地里踢踢桌子，玩玩枪。在老大的陷害下，林教头出差到了沧州。在得知家破人亡的消息后，林教头终于怒了，终于伸了一次，就像许多程序员在压迫很长时间后，嚷道“md，老子不干了，跳槽”。<BR>林教头的这次跳槽是被迫的，不得以的事情，匆匆忙忙的也没选对老大。新老大王伦小肚鸡肠，林教头估计过的很郁闷。后来晁盖上了梁山，林教头火并了王伦，可能林教头也有当老大的想法，但是无奈晁天王手下兄弟众多，只好让晁盖做了老大。林教头和晁盖关系如何，水浒中没有详细说明。不久之后，晁盖被水浒中另一个悲情人物史文恭一箭射死，宋江成了梁山事实上的老大。<BR>其实这个老大更是无耻，如果战术安排得当的话，林冲也许会做掉史文恭，但是很不幸，这个机会宋江给了卢俊义，林冲还是没有和老大搞好关系。<BR>对于林冲，活着的主要目的就是报仇，杀死自己的仇人高太尉。但是在生擒高太尉后，宋老大没有给林冲一把尖刀，让他剐了高太尉，宋老大没有给林冲这个顺水人情。其实到这里可以看到林冲注定是个悲剧，他活着就是行尸走肉，无法体现自己的价值。<BR><FONT color=#f73809>林冲的悲剧在于没有跟对老大</FONT>。</FONT></A>]]></description>
</item><item>
<title><![CDATA[openssl-1.0.0d的编译]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51586</link>
<author>hongrui</author>
<pubDate>2011/6/29 12:07:13</pubDate>
<description><![CDATA[
<P><A>　<FONT size=3>最近为了编译openvpn 2.2.0 安装最新的Microsoft Windows SDK v7.1，这绝对是一个错误的行为。<BR>使用openssl编译程序时，先是出现<BR>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _sprintf already defined in LIBCMT.lib(sprintf.obj)</FONT></A></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: ___iob_func already defined in LIBCMT.lib(_file.obj)</FONT></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _printf already defined in LIBCMT.lib(printf.obj)</FONT></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _fprintf already defined in LIBCMT.lib(fprintf.obj)</FONT></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)</FONT></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)</FONT></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)</FONT></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _calloc already defined in LIBCMT.lib(calloc.obj)</FONT></P>
<P><FONT size=3>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _fflush already defined in LIBCMT.lib(fflush.obj)</FONT></P>
<P><FONT size=3>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library<BR>这个很简单，库设置的问题<BR>"solution properties --&gt; configuration properties --&gt; C/C++ --&gt; Code Generation --&gt; Runtime library" 改为 "multi-thread DLL".<BR>然后出现了 libeay32.lib(cryptlib.obj) : fatal error LNK1103: debugging information corrupt; recompile module<BR>只好重现编译一下openssl 0.9.8.d,接着出现了<BR>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(92) : error C2220: warning treated as error - no 'object' file generated<BR>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(92) : warning C4005: 'EADDRINUSE' : macro redefinition<BR>tmp32\e_os.h(153) : see previous definition of 'EADDRINUSE'<BR>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2' Stop.<BR>翻看一下源码 ，怀疑是openssl的bug。<BR>下载 openssl-1.0.0d，编译解决问题。</FONT></P>]]></description>
</item><item>
<title><![CDATA[Aptana Studio编码设置很搞笑]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51542</link>
<author>hongrui</author>
<pubDate>2011/6/17 11:44:16</pubDate>
<description><![CDATA[<A>　Aptana Studio是web开发不错的工具，功能要比intellij的idea强大，但是比intellij的webstorm还差不少。Aptana Studio3.0才有js的函数折叠功能。<BR>对于一个严格的产品，编码设置居然是很搞笑的事情。<BR>1.x Window --&gt; Preferences --&gt; Aptana --&gt; Editors --&gt; 把 Enable Unicode support (requires restart) 前面的框框勾上，重启。<BR>2.x Aptana自带的jdk没有安装charest.jar，在JDK安装目录下的jre/lib文件夹下面。复制charsets.jar到aptana的jre/lib/目录中即可让Aptana拥有GBK包。然后进入Aptana，在菜单栏中的Windows——Preferences——General——Content Types，选择 Text ，在下方的Default Encoding指定默认编码为GBK.<BR>3.X 右击工程，选择属性，然后在resource的Text file encoding的frame中，other 下拉列表中没有GBK，自己手工输入GBK，和redhat 下eclipse类似。</A>]]></description>
</item><item>
<title><![CDATA[GCC编译器添加INCLUDE与LIB环境变量]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51465</link>
<author>hongrui</author>
<pubDate>2011/6/2 16:47:53</pubDate>
<description><![CDATA[
<P><A>#gcc找到头文件的路径<BR>C_INCLUDE_PATH=/usr/include/libxml2<BR>export C_INCLUDE_PATH=/usr/java/jdk1.6.0_13/include/:/usr/java/jdk1.6.0_13/include/linux/</A></P>
<P>#g++找到头文件的路径<BR>CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/libxml2<BR>export CPLUS_INCLUDE_PATH=/usr/java/jdk1.6.0_13/include/:/usr/java/jdk1.6.0_13/include/linux/</P>
<P>#找到动态链接库的路径<BR>LD_LIBRARY_PATH=$LD_LIBRARY_PATH<BR>export LD_LIBRARY_PATH</P>
<P>#找到静态库的路径<BR>LIBRARY_PATH=$LIBRARY_PATH<BR>export LIBRARY_PATH</P>]]></description>
</item><item>
<title><![CDATA[编译pkcs11-helper]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51455</link>
<author>hongrui</author>
<pubDate>2011/5/31 11:27:21</pubDate>
<description><![CDATA[<P>&nbsp; 下载: <A href="http://www.opensc-project.org/files/pkcs11-helper/pkcs11-helper-1.08.tar.bz2">http://www.opensc-project.org/files/pkcs11-helper/pkcs11-helper-1.08.tar.bz2</A><BR>如果下载1.07，进入lib目录下，修改pkcs11h-threading.c，<BR>将477行&nbsp;ret = (unsigned)(_data-&gt;start (_data-&gt;data) - (void*)0);<BR>改为 ret = (unsigned)((char*)_data-&gt;start (_data-&gt;data) - (char*)0);<BR>将openssl的out32下面的libeay32.lib copy到lib目录下<BR>输入 nmake -f Makefile.w32-vc OPENSSL=1 OPENSSL_HOME=C:\openssl-0.9.8d<BR>编译出libpkcs11-helper-1.dll <BR></P>]]></description>
</item><item>
<title><![CDATA[zlib1.2.5的编译]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51442</link>
<author>hongrui</author>
<pubDate>2011/5/27 11:39:30</pubDate>
<description><![CDATA[<P><A>　zlib1.2.5没有了1.2.4的vc6工程，只好使用命令行编译。<BR>通过win32/Makefile.msc发现有4种编译方式，如下：<BR># Usage:<BR>#&nbsp;&nbsp; nmake -f win32/Makefile.msc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (standard build)<BR>#&nbsp;&nbsp; nmake -f win32/Makefile.msc LOC=-DFOO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (nonstandard build)<BR>#&nbsp;&nbsp; nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" \<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OBJA="inffas32.obj match686.obj"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (use ASM code, x86)<BR>#&nbsp;&nbsp; nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF" \<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OBJA="inffasx64.obj gvmat64.obj inffas8664.c"&nbsp; (use ASM code, x64)</A></P>
<P>首先打开Visual Studio 2005 Command Prompt，进入到zlib-1.2.5\contrib\masmx86，然后运行bld_ml32.bat，生成inffas32.obj和match686.obj。<BR>然后把这两个文件copy到zlib-1.2.5下，输入命令行<BR>nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj"<BR>最后编译出zdll.lib<BR></P>]]></description>
</item><item>
<title><![CDATA[安装php5]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51440</link>
<author>hongrui</author>
<pubDate>2011/5/26 16:55:04</pubDate>
<description><![CDATA[
<P><A>　./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-xml --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/lib&nbsp; --with-zlib --disable-debug --enable-safe-mode --enable-trans-sid --enable-memory-limit --enable-short-tags --disable-posix --enable-exif --enable-ftp --enable-sockets --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl<BR><BR></A></P>
<P>make<BR>&nbsp;make install<BR>&nbsp;make clean<BR>&nbsp;cp php.ini-dist /usr/local/lib/php.ini</P>
<P>编辑php.ini文件:<BR>&nbsp;查找:<BR>&nbsp;;default_charset = "iso-8859-1"<BR>&nbsp;在这行下面加一行<BR>&nbsp;default_charset = "gbk"</P>
<P><BR>不能把AddType application/x-httpd-php .php 直接加入httpd.conf文件<BR>启动apache出现<BR>Invalid command 'AddType', perhaps misspelled or defined by a module not included in the server configuration<BR>加入<BR>&lt;IfModule mime_module&gt;<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # TypesConfig points to the file containing the list of mappings from<BR>&nbsp;&nbsp;&nbsp; # filename extension to MIME-type.<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; TypesConfig conf/mime.types</P>
<P>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # AddType allows you to add to or override the MIME configuration<BR>&nbsp;&nbsp;&nbsp; # file specified in TypesConfig for specific file types.<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; #AddType application/x-gzip .tgz<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # AddEncoding allows you to have certain browsers uncompress<BR>&nbsp;&nbsp;&nbsp; # information on the fly. Note: Not all browsers support this.<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; #AddEncoding x-compress .Z<BR>&nbsp;&nbsp;&nbsp; #AddEncoding x-gzip .gz .tgz<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # If the AddEncoding directives above are commented-out, then you<BR>&nbsp;&nbsp;&nbsp; # probably should define those extensions to indicate media types:<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; AddType application/x-compress .Z<BR>&nbsp;&nbsp;&nbsp; AddType application/x-gzip .gz .tgz<BR>&nbsp;&nbsp;&nbsp; AddType application/x-httpd-php .php<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # AddHandler allows you to map certain file extensions to "handlers":<BR>&nbsp;&nbsp;&nbsp; # actions unrelated to filetype. These can be either built into the server<BR>&nbsp;&nbsp;&nbsp; # or added with the Action directive (see below)<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # To use CGI scripts outside of ScriptAliased directories:<BR>&nbsp;&nbsp;&nbsp; # (You will also need to add "ExecCGI" to the "Options" directive.)<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; #AddHandler cgi-script .cgi</P>
<P>&nbsp;&nbsp;&nbsp; # For type maps (negotiated resources):<BR>&nbsp;&nbsp;&nbsp; #AddHandler type-map var</P>
<P>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # Filters allow you to process content before it is sent to the client.<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; # To parse .shtml files for server-side includes (SSI):<BR>&nbsp;&nbsp;&nbsp; # (You will also need to add "Includes" to the "Options" directive.)<BR>&nbsp;&nbsp;&nbsp; #<BR>&nbsp;&nbsp;&nbsp; #AddType text/html .shtml<BR>&nbsp;&nbsp;&nbsp; #AddOutputFilter INCLUDES .shtml<BR>&lt;/IfModule&gt;<BR>&lt;IfModule dir_module&gt;<BR>&nbsp;&nbsp;&nbsp; DirectoryIndex index.html index.php<BR>&lt;/IfModule&gt;<BR>修改httpd.conf<BR>加入<BR>LoadModule authz_host_module modules/mod_authz_host.so<BR>LoadFile /usr/lib/libxml2.so<BR>LoadModule mime_module&nbsp; modules/mod_mime.so</P>
<P>LoadModule php5_module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modules/libphp5.so<BR>否则会出现<BR>[Thu May 26 22:22:22 2011] [error] [client 192.168.100.216] Attempt to serve directory: /usr/local/apache2/htdocs/<BR>[Thu May 26 22:39:47 2011] [notice] caught SIGTERM, shutting down<BR>[Thu May 26 22:39:50 2011] [notice] Apache/2.2.17 (Unix) PHP/5.2.17 configured -- resuming normal operations<BR>[Thu May 26 22:43:07 2011] [notice] caught SIGTERM, shutting down<BR></P>
<P>&nbsp;</P>]]></description>
</item><item>
<title><![CDATA[apache和modsecurity的安装]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51433</link>
<author>hongrui</author>
<pubDate>2011/5/24 19:23:50</pubDate>
<description><![CDATA[<P>安装pcre<BR>安装apr<BR>&nbsp;<A href="http://labs.renren.com/apache-mirror//apr/apr-1.4.5.tar.gz">http://labs.renren.com/apache-mirror//apr/apr-1.4.5.tar.gz</A><BR>&nbsp;./configure<BR>make <BR>make install<BR>apache的安装<BR>./configure&nbsp;&nbsp; --with-included-apr --with-php --with-mysql --with-susexec --disable-info --with-mpm=prefork --enable-so --enable-cgi --enable-rewrite --enable-ssl --enable-mime-magic --enable-unique-id --enable-mods-shared=all --enable-ssl=shared&nbsp; --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http<BR>make<BR>make install<BR>注意 不要指定--prefix=/app/apache，否则出现error: cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apache2/lib<BR>因为编译使用了shared modules，必须添加LoadModule authz_host_module modules/mod_authz_host.so，否则出现 Invalid command 'Order', perhaps misspelled or defined by a module not included in the server config</P>
<P>验证apxs安装<BR>/usr/local/apache2/bin/apxs -c -i</P>
<P><BR>安装modsecurity<BR>来源位置: <A href="http://cdnetworks-kr-1.dl.sourceforge.net/project/mod-security/modsecurity-apache/2.6.0/modsecurity-apache_2.6.0.tar.gz">http://cdnetworks-kr-1.dl.sourceforge.net/project/mod-security/modsecurity-apache/2.6.0/modsecurity-apache_2.6.0.tar.gz</A><BR>&nbsp;./configure --with-apxs=/usr/local/apache2/bin/apxs --with-pcre=/usr/local/bin/pcre-config --with-apr=/usr/local/apache2/bin/apr-1-config --with-apu=/usr/local/apache2/bin/apu-1-config<BR>make<BR>make install</P>
<P>创建目录modsecurity <BR>mkdir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/apache2/conf/modsecurity/<BR>修改httpd.conf<BR>加入<BR>LoadFile /usr/lib/libxml2.so<BR>LoadModule unique_id_module modules/mod_unique_id.so<BR>LoadModule security2_module modules/mod_security2.so</P>]]></description>
</item><item>
<title><![CDATA[Linux下MySQL 5.5.12源码编译安装]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51432</link>
<author>hongrui</author>
<pubDate>2011/5/24 14:57:14</pubDate>
<description><![CDATA[
<P><FONT size=3>LAMP的最先安装的是MySQL，MySQL 5.5.12需要cmake编译安装<BR>下载cmake<BR>&nbsp;wget </FONT><A href="http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz"><FONT size=3>http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz</FONT></A><BR><FONT size=3>安装cmake<BR>tar -zxvf cmake-2.8.4.tar.gz<BR>&nbsp;cd cmake-2.8.4<BR>./configure<BR>make &amp;&amp; make install</FONT></P>
<P><FONT size=3>安装mysql</FONT></P>
<P><FONT size=3>tar zxvf mysql-5.5.12.tar.gz<BR>cd mysql-5.5.12<BR>mkdir -p /usr/local/mysql/<BR>cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \<BR>-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \<BR>-DDEFAULT_CHARSET=utf8 \<BR>-DDEFAULT_COLLATION=utf8_general_ci \<BR>-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \<BR>-DWITH_MYISAM_STORAGE_ENGINE=1 \<BR>-DWITH_INNOBASE_STORAGE_ENGINE=1 \<BR>-DWITH_MEMORY_STORAGE_ENGINE=1 \<BR>-DWITH_READLINE=1 \<BR>-DENABLED_LOCAL_INFILE=1 \<BR>-DMYSQL_DATADIR=/data/mysql/data \<BR>-DMYSQL_USER=mysql<BR>make<BR>make install</FONT></P>
<P><FONT size=3>chmod +w /usr/local/mysql<BR>chown -R mysql:mysql /usr/local/mysql<BR>ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18 </FONT></P>
<P><FONT size=3>mkdir -p /data/mysql/<BR>mkdir -p /data/mysql/data/<BR>mkdir -p /data/mysql/log/<BR>chown -R mysql:mysql /data/mysql/</FONT></P>
<P><FONT size=3>cd support-files/</FONT></P>
<P><FONT size=3>删除以前可能存在mysql.cnf<BR>rm -fr /etc/my.cnf<BR>cp my-large.cnf /data/mysql/my.cnf</FONT></P>
<P><FONT size=3>cp my-large.cnf /etc/my.cnf<BR>cp mysql.server /etc/init.d/mysqld</FONT></P>
<P><FONT size=3>添加mysql用户<BR>groupadd mysql<BR>useradd -g mysql mysql<BR>chown mysql.mysql -R /usr/local/mysql/data/mysql/</FONT></P>
<P><FONT size=3>添加开机启动<BR>chmod +x /etc/init.d/mysqld<BR>vi /etc/init.d/mysqld <BR>basedir=/usr/local/mysql<BR>datadir=/data/mysql/data</FONT></P>
<P><FONT size=3>chkconfig --add mysqld<BR>chkconfig --level 345 mysqld on<BR>&nbsp;service mysqld start</FONT></P>
<P><FONT size=3>&nbsp;修改root密码</FONT></P>
<P><FONT size=3>/usr/local/mysql/bin/mysqladmin -h 127.0.0.1 -u root password '123456'<BR>/usr/local/mysql/bin/mysql -u root -p</FONT></P>
<P><FONT size=3>输入密码 123456</FONT></P>
<P><FONT size=3>&gt;show databases</FONT></P>
<P><FONT size=3>出现 Starting MySQL.Manager of pid-file quit without updating file</FONT></P>
<P><FONT size=3>一般是因为mysql进程没有杀干净，这是killall是不行的。</FONT></P>
<P><FONT size=3>[root@web init.d]# ps -A|grep mysql<BR>11932 pts/1&nbsp;&nbsp;&nbsp; 00:00:00 mysqld_safe<BR>12084 pts/1&nbsp;&nbsp;&nbsp; 00:00:00 mysqld</FONT></P>
<P><FONT size=3>kill -9 杀之</FONT></P>]]></description>
</item><item>
<title><![CDATA[_syscall1宏被删除了]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=hongrui&amp;id=51418</link>
<author>hongrui</author>
<pubDate>2011/5/19 20:16:33</pubDate>
<description><![CDATA[<P>不用syscall的程序<BR>#include &lt;errno.h&gt;<BR>#include &lt;stdio.h&gt;<BR>#include &lt;stdlib.h&gt;<BR>#include &lt;syscall.h&gt;<BR>#include &lt;unistd.h&gt;</P>
<P><BR>int main(int argc, char **argv)<BR>{</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time_t current_time;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long seconds;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seconds = time(&amp;current_time);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("The current time is : %ld.\n",seconds);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(0);</P>
<P>}<BR>2.6.18以后kernel headers删除了_syscall1宏，应该使用syscall()。<BR>#define _GNU_SOURCE<BR>#include &lt;errno.h&gt;<BR>#include &lt;stdio.h&gt;<BR>#include &lt;stdlib.h&gt;<BR>#include &lt;syscall.h&gt;<BR>#include &lt;unistd.h&gt;</P>
<P>#define __NR_time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 13 /* normally defined in &lt;asm/unistd.h&gt; */</P>
<P>int main(int argc, char **argv)<BR>{</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time_t current_time;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long seconds;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seconds = syscall(__NR_time,&amp;current_time);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("The current time is : %ld.\n",seconds);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(0);</P>
<P>}</P>]]></description>
</item>
</channel>
</rss>