<?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>ZQuan&#039;s Blog</title>
	<atom:link href="http://blog.zquan.me/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.zquan.me</link>
	<description>属于这个城市的梦想</description>
	<lastBuildDate>Wed, 14 Mar 2012 06:15:46 +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>php使用root权限的方法</title>
		<link>http://blog.zquan.me/?p=590</link>
		<comments>http://blog.zquan.me/?p=590#comments</comments>
		<pubDate>Wed, 14 Mar 2012 06:08:41 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[编程开发]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=590</guid>
		<description><![CDATA[在linux下如果想要使用root权限执行命令，比较麻烦 网上大多说的是直接把webserver（apache、nginx）直接以root用户和组执行 试过apache下用root执行，但是已启动就报错 没去深究，我用的是提权的方法，将要执行的命令通过一个小程序来调用 小程序的代码如下 /************************************** *本工具可用于php页面调用其他程序的功能 *生成可执行文件之后，需要chmod a+s 改变程序权限 **************************************/ #include #include #include #include #include &#160; int main&#40;int argc, char *argv&#91;&#93;&#41; &#123; uid_t uid,euid; uid_t gid,egid; &#160; uid = getuid&#40;&#41;; euid = geteuid&#40;&#41;; gid = getgid&#40;&#41;; egid = getegid&#40;&#41;; //printf(&#34;%u %u\n&#34;,uid,euid); //printf(&#34;%u %u\n&#34;,gid,egid); &#160; if&#40;setreuid&#40;euid, uid&#41;&#41; &#123; printf&#40;&#34;setreuid return true.&#34;&#41;; perror&#40;&#34;setreuid&#34;&#41;; &#125; if&#40;setregid&#40;egid, gid&#41;&#41; [...]]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=590</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linode的centos5.X安装pptp的vpn</title>
		<link>http://blog.zquan.me/?p=559</link>
		<comments>http://blog.zquan.me/?p=559#comments</comments>
		<pubDate>Tue, 07 Feb 2012 09:22:34 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[ppp]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=559</guid>
		<description><![CDATA[前段时间用ssh隧道翻墙，满足了日常的需要，但是iphone用不了这个，想用pptp搞个简单的vpn可以给cydia用。 linode的vps还是满好的，假设pptp也很方便，网上的教程有点老，iptable部分遇到一些问题，下面就说说架设的步骤： 一、安装 1、检查环境是否支持（linode一般没有问题的） 如下执行zgrep MPPE /proc/config.gz和cat /dev/net/tun， 看看结果是不是和下面一样，一样就表示环境支持 &#91;root@li399-18 ~&#93;# zgrep MPPE /proc/config.gz CONFIG_PPP_MPPE=y &#91;root@li399-18 ~&#93;# cat /dev/net/tun cat: /dev/net/tun: File descriptor in bad state 2、安装所需服务：iptable、ppp，这个可以使用yum安装： &#91;root@li399-18 ~&#93;# yum install ppp iptable 3、安装pptp，这个没法用yum安装，需要到sourceforge下载，最新版是1.3.4，然后用rpm安装 64位系统下载：http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.rhel5.x86_64.rpm 32位系统下载：http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.rhel5.i386.rpm 以64系统为例 &#91;root@li399-18 ~&#93;# rpm -Uvh pptpd-1.3.4-2.rhel5.x86_64.rpm 二、配置 1、配置pptp 打开/etc/pptpd.conf，将96行和97行的井号去掉，使用默认的ip配置即可      96 localip 192.168.0.1      97 remoteip 192.168.0.234-238,192.168.0.245 [...]]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=559</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在centos 5.X安装Mercurial(hg)</title>
		<link>http://blog.zquan.me/?p=553</link>
		<comments>http://blog.zquan.me/?p=553#comments</comments>
		<pubDate>Tue, 31 Jan 2012 09:23:47 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=553</guid>
		<description><![CDATA[按照官网上的指引，有多种方式可以安装，但比较麻烦，如果按照上面的提示的话，我会选择python的方式： 先安装python，然后利用easy_install安装hg 另外的方式是直接到repoforge.org上下载二进制安装包，用rpm安装 我的服务器是centos 5.6 64bit，找到的是mercurial-1.9.2-1.el5.rf.x86_64.rpm，wget到本地之后，执行 [root@li399-18 download]# rpm -Uvh mercurial-1.9.2-1.el5.rf.x86_64.rpm 之后后hg已经安装成功，而且yum search 中也有mercurial的身影 &#160;]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=553</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>重新起航</title>
		<link>http://blog.zquan.me/?p=525</link>
		<comments>http://blog.zquan.me/?p=525#comments</comments>
		<pubDate>Sun, 08 Jan 2012 16:11:42 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[博客建设]]></category>
		<category><![CDATA[centos 5.6]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[php53]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=525</guid>
		<description><![CDATA[经过差不多一年的空白期，blog又重新开放了，刚好今天生日的。 之前一直用的是godaddy的grid host，连接经常抽风，到期之后做了备份，就一直没处理。 本来想要在sae上恢复blog，但是上面的wp改动了，最大的问题是媒体文件居然没法整个文件上传下载，要是有天需要备份，那不就完蛋了。 所以狠下心买了linode最便宜的vps，东京机房，速度还不错的说。 趁这个机会，我把几个域名的dns解析全部也扔给了dnspod，给力不用解释。 linode居然还支持多系统单启动，很专业，对它称赞有加。 我配了centos 5.6，一路下来，因为yum安装了php53的缘故，中间的mcrypt遇到点问题，其他都速度搞定了。 找个时间再所以一个定时备份脚本，把数据库，blog代码定期备份。 终于，工作三年后，我有了一个完整属于我的外网系统。 是的，2009.3.4 &#8211; 2012.3.4，整整三年。]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=525</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>centos 启动的错误</title>
		<link>http://blog.zquan.me/?p=511</link>
		<comments>http://blog.zquan.me/?p=511#comments</comments>
		<pubDate>Thu, 03 Mar 2011 03:00:45 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[fsck]]></category>
		<category><![CDATA[Give root password for mantennance]]></category>
		<category><![CDATA[RUN fsck]]></category>
		<category><![CDATA[unexpected inconsistency]]></category>
		<category><![CDATA[启动错误]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=511</guid>
		<description><![CDATA[昨晚把centos搞出问题了，貌似是强制关机导致的 重启时出现以下错误信息 unexpected inconsistency;RUN fsck MANUALLY An error occurred during the filesystem check Propping you to shell the system will reboot when you leave the shell Give root password for mantennance   结合网上资料，猜想是关机错误导致磁盘错乱了 解决方式很简单，检查下磁盘就可以了： 1、先看看你的系统挂在哪个分区，用mount查看 #mount &#124; grep &#8216;on /&#8217; 一般都是在 /dev/sda1 我的是在/dev/sda5 2、fsck一下 fsck -y /dev/sda5 上了个洗手间回来，检查完成，就能正常启动了]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=511</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql日志配置</title>
		<link>http://blog.zquan.me/?p=508</link>
		<comments>http://blog.zquan.me/?p=508#comments</comments>
		<pubDate>Sat, 12 Feb 2011 05:43:26 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[慢查询]]></category>
		<category><![CDATA[日志]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=508</guid>
		<description><![CDATA[数据库版本 [root@localhost ~]# mysql -V mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1 开启日志需要在my.cnf中配置，然后重启服务器 在centos中的路径为/etc/my.cnf 以下配置分别开启错误、慢查询、查询日志 [mysqld] …… log-error=/var/log/mysqld_err.log log-slow-queries=/var/log/mysqld_slow.log log=/var/log/mysqld_query.log #log-output=FILE …… 注意：在5.0版本 mysqld_err.log、mysqld_slow.log、mysqld_query.log需要修改权限为mysql组和mysql用户 而另外据说在5.2版本上只需要配上log-output=FILE即可(这点没有测试过，供参考)]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=508</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php上传文件样例</title>
		<link>http://blog.zquan.me/?p=498</link>
		<comments>http://blog.zquan.me/?p=498#comments</comments>
		<pubDate>Sun, 05 Dec 2010 06:43:42 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[项目]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[上传]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=498</guid>
		<description><![CDATA[一个php的上传例子，可以简单的实现文件上传 对于上传文件的大小，朋友建议修改配置的三处地方 配置文件在centos的路径：/etc/php.ini 大小限制如下，按需修改： memory_limit = 128M post_max_size = 30M upload_max_filesize = 20M &#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&#62; &#60;html&#62; &#60;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&#62; &#60;meta http-equiv="content-language" content="zh-cn" /&#62; &#60;head&#62; &#60;/head&#62; &#60;body&#62; &#60;!-- The data encoding type, enctype, MUST be specified as below --&#62; &#60;form enctype="multipart/form-data" action="upload.php" method="POST"&#62;     &#60;!-- MAX_FILE_SIZE must precede [...]]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=498</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>socket学习-粗糙的实现</title>
		<link>http://blog.zquan.me/?p=478</link>
		<comments>http://blog.zquan.me/?p=478#comments</comments>
		<pubDate>Fri, 12 Nov 2010 03:56:37 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[socket]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=478</guid>
		<description><![CDATA[虽然很想搞底层的东西，但是一直没啥机会 写写配置，改改逻辑，那些重要的东西都忘记了 还是得找时间自己更深入点 这份东西可以与cmd的telnet命令配合调试 #include #WinSock2.h# #include #stdio.h# &#160; #pragma comment(lib, &#34;WS2_32&#34;) &#160; int main&#40;int argc, char* argv&#91;&#93;&#41; &#123; int ret = 0; int port = 7070; int backlog = SOMAXCONN; &#160; // 初始化部分 struct WSAData wsa; WORD sockVersion = MAKEWORD&#40;2, 2&#41;; ret = &#40;int&#41;WSAStartup&#40;sockVersion, &#38;amp;wsa&#41;; if &#40;0 != ret&#41; &#123; printf&#40;&#34;WSAStartup fail.\n&#34;&#41;; return 0; [...]]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=478</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux shell的重定向</title>
		<link>http://blog.zquan.me/?p=473</link>
		<comments>http://blog.zquan.me/?p=473#comments</comments>
		<pubDate>Tue, 09 Nov 2010 12:12:40 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[编程开发]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[stderr]]></category>
		<category><![CDATA[stdin]]></category>
		<category><![CDATA[stdout]]></category>
		<category><![CDATA[筛选]]></category>
		<category><![CDATA[重定向]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=473</guid>
		<description><![CDATA[常用的有三个(共10个)： 0（stdin，标准输入） 1（stdout，标准输出） 2（stderr，标准错误输出） 重定向： cmd &#62; file 把 stdout 重定向到 file 文件中 cmd &#62;&#62; file 把 stdout 重定向到 file 文件中(追加) cmd 1&#62; file 把 stdout 重定向到 file 文件中 cmd &#62; file 2&#62;&#38;1 把 stdout 和 stderr 一起重定向到 file 文件中 cmd 2&#62; file 把 stderr 重定向到 file 文件中 cmd 2&#62;&#62; file 把 stderr 重定向到 file [...]]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=473</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转]内存划分,堆栈区分</title>
		<link>http://blog.zquan.me/?p=454</link>
		<comments>http://blog.zquan.me/?p=454#comments</comments>
		<pubDate>Tue, 09 Nov 2010 03:56:22 +0000</pubDate>
		<dc:creator>zquan</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[内存]]></category>
		<category><![CDATA[堆栈]]></category>

		<guid isPermaLink="false">http://blog.zquan.me/?p=454</guid>
		<description><![CDATA[一直对内存区域的划分，程序变量的内存分配问题模糊不清。进行多方参考总结如下。 一、一个经过编译的C/C++的程序占用的内存分成以下几个部分： 1、栈区（stack）：由编译器自动分配和释放 ，存放函数的参数值、局部变量的值等，甚至函数的调用过程都是用栈来完成。其操作方式类似于数据结构中的栈。 2、堆区（heap） ：一般由程序员手动申请以及释放， 若程序员不释放，程序结束时可能由OS回收 。注意它与数据结构中的堆是两回事，分配方式类似于链表。 3、全局区（静态区）（static）：全局变量和静态变量的存储是放在一块的，初始化的全局变量和静态变量在一块区域， 未初始化的全局变量和未初始化的静态变量在相邻的另一块区域。程序结束后由系统释放空间。 4、文字常量区：常量字符串就是放在这里的。 程序结束后由系统释放空间。 5、程序代码区：存放函数体的二进制代码。 下面的例子可以完全展示不同的变量所占的内存区域： //main.cpp int a = 0; // 全局初始化区 char *p1; // 全局未初始化区 int main&#40;&#41; &#123; int b; //栈中 char s&#91;&#93; = &#34;abc&#34;; //栈中 char *p2; //栈中 char *p3 = &#34;123456&#34;; //123456在常量区，p3在栈上 static int c =0; //全局（静态）初始化区 &#160; //以下分配得到的10和20字节的区域就在堆区 p1 = &#40;char *&#41;malloc&#40;10&#41;; [...]]]></description>
		<wfw:commentRss>http://blog.zquan.me/?feed=rss2&#038;p=454</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

