<?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; 技术相关</title>
	<atom:link href="http://blog.xcyh.org/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xcyh.org</link>
	<description>时时检点，到得从多入少，从有入无，才是学问的真消息。</description>
	<lastBuildDate>Sat, 24 Sep 2011 04:35:27 +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>VC切换注释宏代码</title>
		<link>http://blog.xcyh.org/note-macro-code-vc-switch/</link>
		<comments>http://blog.xcyh.org/note-macro-code-vc-switch/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 15:54:47 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[宏]]></category>
		<category><![CDATA[注释]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=1049</guid>
		<description><![CDATA[如题，懂的入。 Sub ToggleComment () 'DESCRIPTION: Toggle Comments a selected block of text. Dim win Set win = ActiveWindow If win.type &#60;&#62; &#34;Text&#34; Then MsgBox &#34;This macro can only be run when a text editor window is active.&#34; Else StartLine = ActiveDocument.Selection.TopLine EndLine = ActiveDocument.Selection.BottomLine If EndLine &#60; StartLine Then Temp = StartLine StartLine = EndLine [...]]]></description>
			<content:encoded><![CDATA[<p>如题，懂的入。</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">Sub</span> ToggleComment ()
<span style="color: #008000;">'DESCRIPTION: Toggle Comments a selected block of text.
</span>	<span style="color: #151B8D; font-weight: bold;">Dim</span> win
	<span style="color: #151B8D; font-weight: bold;">Set</span> win = ActiveWindow
	<span style="color: #8D38C9; font-weight: bold;">If</span> win.<span style="color: #151B8D; font-weight: bold;">type</span> &lt;&gt; <span style="color: #800000;">&quot;Text&quot;</span> <span style="color: #8D38C9; font-weight: bold;">Then</span>
		MsgBox <span style="color: #800000;">&quot;This macro can only be run when a text editor window is active.&quot;</span>
	<span style="color: #8D38C9; font-weight: bold;">Else</span>
		StartLine = ActiveDocument.Selection.TopLine
		EndLine = ActiveDocument.Selection.BottomLine
		<span style="color: #8D38C9; font-weight: bold;">If</span> EndLine &lt; StartLine <span style="color: #8D38C9; font-weight: bold;">Then</span>
			Temp = StartLine
			StartLine = EndLine
			EndLine = Temp
		<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
&nbsp;
		<span style="color: #8D38C9; font-weight: bold;">For</span> i = StartLine <span style="color: #8D38C9; font-weight: bold;">To</span> EndLine
			ActiveDocument.Selection.GoToLine i
			ActiveDocument.Selection.SelectLine
&nbsp;
			LineBlock = Trim(ActiveDocument.Selection)
			<span style="color: #8D38C9; font-weight: bold;">If</span> LineBlock &lt;&gt; <span style="color: #800000;">&quot;&quot;</span> <span style="color: #8D38C9; font-weight: bold;">Then</span>
				<span style="color: #8D38C9; font-weight: bold;">If</span> Left(LineBlock, 2) = <span style="color: #800000;">&quot;//&quot;</span> <span style="color: #8D38C9; font-weight: bold;">Then</span>
					LineBlock = mid(LineBlock, 3)
				<span style="color: #8D38C9; font-weight: bold;">Else</span>
					LineBlock = <span style="color: #800000;">&quot;//&quot;</span> + LineBlock
				<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
				ActiveDocument.Selection = LineBlock
			<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
		<span style="color: #8D38C9; font-weight: bold;">Next</span>
		ActiveDocument.Selection.GoToLine EndLine
	<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/note-macro-code-vc-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[原创]SHELL自动备份网站和数据库同时发邮件</title>
		<link>http://blog.xcyh.org/auto-backup-web-and-send-mail/</link>
		<comments>http://blog.xcyh.org/auto-backup-web-and-send-mail/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 03:10:03 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[备份]]></category>
		<category><![CDATA[邮件]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=1037</guid>
		<description><![CDATA[本空间支持SSH，一来为了cross wall，二来整理网站什么的也能方便点，比如打个包，解个包，check out点代码什么的。 好了，直接贴代码吧。 #!/bin/bash # # Backup web source code and database data to a tarball # Also can send it to your email as a attachment # # crontab -e # 0 0 * * * /home/burgess/backup.sh &#62;/dev/null 2&#62;&#38;1 # &#160; # set variables web_path=~/public_html db_name=your_db_name db_user=your_db_user db_pass=your_db_pass email=burgess@163.com email_title=&#34;Web Backup - xyh.org [...]]]></description>
			<content:encoded><![CDATA[<p>本空间支持SSH，一来为了cross wall，二来整理网站什么的也能方便点，比如打个包，解个包，check out点代码什么的。<br />
好了，直接贴代码吧。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Backup web source code and database data to a tarball</span>
<span style="color: #666666; font-style: italic;"># Also can send it to your email as a attachment</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># crontab -e</span>
<span style="color: #666666; font-style: italic;"># 0 0 * * * /home/burgess/backup.sh &gt;/dev/null 2&gt;&amp;1</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># set variables</span>
<span style="color: #007800;">web_path</span>=~<span style="color: #000000; font-weight: bold;">/</span>public_html
<span style="color: #007800;">db_name</span>=your_db_name
<span style="color: #007800;">db_user</span>=your_db_user
<span style="color: #007800;">db_pass</span>=your_db_pass
<span style="color: #007800;">email</span>=burgess<span style="color: #000000; font-weight: bold;">@</span>163.com
<span style="color: #007800;">email_title</span>=<span style="color: #ff0000;">&quot;Web Backup - xyh.org - &quot;</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%Y-%m-%d&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #007800;">new_file</span>=Backup_$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;yesterday&quot;</span> +<span style="color: #ff0000;">&quot;%Y%m%d&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.tar.gz
<span style="color: #007800;">old_file</span>=Backup_$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;-2days&quot;</span> +<span style="color: #ff0000;">&quot;%Y%m%d&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.tar.gz
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$web_path</span>
<span style="color: #666666; font-style: italic;"># dump database data to a sql file</span>
mysqldump --add-drop-table\
		--comments\
		--complete-insert\
		--allow-keywords\
		--triggers\
		--routines\
		--force\
		<span style="color: #660033;">--password</span>=<span style="color: #007800;">$db_pass</span>\
		<span style="color: #660033;">--user</span>=<span style="color: #007800;">$db_user</span>\
		<span style="color: #007800;">$db_name</span> <span style="color: #000000; font-weight: bold;">&gt;</span> database.sql
&nbsp;
<span style="color: #666666; font-style: italic;"># make it to a tarball</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> zcf ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$new_file</span> <span style="color: #000000; font-weight: bold;">*</span> .<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">!</span>.<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #660033;">--exclude</span>=cgi-bin
&nbsp;
<span style="color: #666666; font-style: italic;"># remove old files</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> database.sql
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$old_file</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> 
	<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$old_file</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># send attachment email</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Hi, I'm the postman.&quot;</span>;uuencode ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$new_file</span> <span style="color: #007800;">$new_file</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #007800;">$email_title</span> <span style="color: #007800;">$email</span></pre></div></div>

<p>使用时只要修改前面6个变量的值就可以了，然后把它放到任务里定时执行。<br />
先执行“crontab -e”<br />
然后添加一行<br />
0 0 * * * /home/burgess/backup.sh >/dev/null 2>&#038;1<br />
然后就可以每天0点自动执行打包备份并把压缩包当附件发送到你的邮箱里了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/auto-backup-web-and-send-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>修改配置防止日志文件过大</title>
		<link>http://blog.xcyh.org/prevent-log-too-large/</link>
		<comments>http://blog.xcyh.org/prevent-log-too-large/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 05:06:10 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[日志]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=1024</guid>
		<description><![CDATA[几天前服务器根目录空间使用100%导致MySQL使用出错，看了下发现是/var/log/maillog文件太大了，直接使用>/var/log/maillog清空暂时了事。 今天研究了下，发现可以通过修改/etc/syslog.conf文件来过滤无用的信息。修改如下： 把 mail.* -/var/log/maillog 替换为 mail.notice -/var/log/maillog]]></description>
			<content:encoded><![CDATA[<p>几天前服务器根目录空间使用100%导致MySQL使用出错，看了下发现是/var/log/maillog文件太大了，直接使用>/var/log/maillog清空暂时了事。<br />
今天研究了下，发现可以通过修改/etc/syslog.conf文件来过滤无用的信息。修改如下：<br />
把</p>
<blockquote><p>mail.*							-/var/log/maillog</p></blockquote>
<p>替换为</p>
<blockquote><p>mail.notice							-/var/log/maillog</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/prevent-log-too-large/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【原创】网络电视直播WEB版</title>
		<link>http://blog.xcyh.org/weblive/</link>
		<comments>http://blog.xcyh.org/weblive/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 14:30:22 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[电视]]></category>
		<category><![CDATA[网络]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=1015</guid>
		<description><![CDATA[近来找到一个网站上有不少网络电视直播，但是网站做的广告太多，不想每次都去人家那里，于是自己花了几天时间用Python脚本把列表给取了来，自己用cmp.swf做了这么个东西。 不截图了，直接上地址 http://tv.xcyh.org/ 其中很多地址都是WMP格式的，没关系用FLASH和JS交互在FLASH上弄了一层WMP控件就OK了。 P.S.页面很干净的说，WMP控件上双击可以全屏，按ESC恢复，点下面出现的“停止播放并返回播放器”可以返回FLASH界面！]]></description>
			<content:encoded><![CDATA[<p>近来找到一个网站上有不少网络电视直播，但是网站做的广告太多，不想每次都去人家那里，于是自己花了几天时间用Python脚本把列表给取了来，自己用cmp.swf做了这么个东西。<br />
不截图了，直接上地址<br />
<a href="http://tv.xcyh.org/">http://tv.xcyh.org/</a><br />
其中很多地址都是WMP格式的，没关系用FLASH和JS交互在FLASH上弄了一层WMP控件就OK了。</p>
<p>P.S.页面很干净的说，WMP控件上双击可以全屏，按ESC恢复，点下面出现的“停止播放并返回播放器”可以返回FLASH界面！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/weblive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python防止urllib2自动跳转</title>
		<link>http://blog.xcyh.org/python-urllib2-auto-redirect/</link>
		<comments>http://blog.xcyh.org/python-urllib2-auto-redirect/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 09:48:21 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=1004</guid>
		<description><![CDATA[有的时候我们想知道未跳转前的内容，可是Python的urllib2却自动跟随跳转，研究了下库里的代码，发现我们修改下就可以了。 注释的三行代码可以返回当前的code，比如301或302什么的，如果只想知道code，那么只要去掉这三行注释再把return response注释了就可以了。 “debug_handler = urllib2.HTTPHandler(debuglevel = 1)”是调试跟踪用的，不想跟踪改为0就可以了。 import urllib2 import socket &#160; class SimpleRedirectHandler&#40;urllib2.HTTPRedirectHandler&#41;: def http_error_301&#40;self, req, response, code, msg, headers&#41;: # result = urllib2.HTTPRedirectHandler.http_error_301(self, req, response, code, msg, headers) # result.status = code # return result return response &#160; http_error_302 = http_error_303 = http_error_307 = http_error_301 &#160; def unRedirectUrl&#40;url&#41;: socket.setdefaulttimeout&#40;90&#41; req = urllib2.Request&#40;url&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>有的时候我们想知道未跳转前的内容，可是Python的urllib2却自动跟随跳转，研究了下库里的代码，发现我们修改下就可以了。<br />
注释的三行代码可以返回当前的code，比如301或302什么的，如果只想知道code，那么只要去掉这三行注释再把return response注释了就可以了。<br />
“debug_handler = urllib2.HTTPHandler(debuglevel = 1)”是调试跟踪用的，不想跟踪改为0就可以了。</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib2</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> SimpleRedirectHandler<span style="color: black;">&#40;</span><span style="color: #dc143c;">urllib2</span>.<span style="color: black;">HTTPRedirectHandler</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">def</span> http_error_301<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, req, response, <span style="color: #dc143c;">code</span>, msg, headers<span style="color: black;">&#41;</span>:
		<span style="color: #808080; font-style: italic;"># result = urllib2.HTTPRedirectHandler.http_error_301(self, req, response, code, msg, headers)</span>
		<span style="color: #808080; font-style: italic;"># result.status = code</span>
		<span style="color: #808080; font-style: italic;"># return result</span>
		<span style="color: #ff7700;font-weight:bold;">return</span> response
&nbsp;
	http_error_302 = http_error_303 = http_error_307 = http_error_301
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> unRedirectUrl<span style="color: black;">&#40;</span>url<span style="color: black;">&#41;</span>:
	<span style="color: #dc143c;">socket</span>.<span style="color: black;">setdefaulttimeout</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">90</span><span style="color: black;">&#41;</span>
	req = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">Request</span><span style="color: black;">&#40;</span>url<span style="color: black;">&#41;</span>
	debug_handler = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">HTTPHandler</span><span style="color: black;">&#40;</span>debuglevel = <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
	opener = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">build_opener</span><span style="color: black;">&#40;</span>debug_handler, SimpleRedirectHandler<span style="color: black;">&#41;</span>
	content = <span style="color: #483d8b;">''</span>
	<span style="color: #ff7700;font-weight:bold;">try</span>:
		response = opener.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>req<span style="color: black;">&#41;</span>
		content = response.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
		response.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #dc143c;">socket</span>.<span style="color: black;">timeout</span>, e:
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'socket.timeout:'</span>, e
	<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">IOError</span>, e:
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'IOError:'</span>, e
	<span style="color: #ff7700;font-weight:bold;">except</span>:
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'unknown error'</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> content
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> unRedirectUrl<span style="color: black;">&#40;</span><span style="color: #483d8b;">'http://localhost/test'</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/python-urllib2-auto-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>squid编译时出现libltdl错误</title>
		<link>http://blog.xcyh.org/squid-make-libltdl-error/</link>
		<comments>http://blog.xcyh.org/squid-make-libltdl-error/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 02:20:10 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[libltdl]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=988</guid>
		<description><![CDATA[默认编译时出现如下错误。 在包含自 ../libltdl/ltdl.h：37 的文件中， 从 LoadableModule.cc：10: ../libltdl/libltdl/lt_error.h:35:31: 错误：libltdl/lt_system.h：没有那个文件或目录 网上找了下，发现只要在configure的时候禁用eCAP(&#8211;disable-loadable-modules)，就可以了。]]></description>
			<content:encoded><![CDATA[<p>默认编译时出现如下错误。</p>
<blockquote><p>
在包含自 ../libltdl/ltdl.h：37 的文件中，<br />
                 从 LoadableModule.cc：10:<br />
../libltdl/libltdl/lt_error.h:35:31: 错误：libltdl/lt_system.h：没有那个文件或目录
</p></blockquote>
<p>网上找了下，发现只要在configure的时候禁用eCAP(&#8211;disable-loadable-modules)，就可以了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/squid-make-libltdl-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>把Word或Excel中的swf文件取出来</title>
		<link>http://blog.xcyh.org/export-swf-from-word-or-excel/</link>
		<comments>http://blog.xcyh.org/export-swf-from-word-or-excel/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 09:26:57 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=981</guid>
		<description><![CDATA[以Word为例，Excel也是一样的。 找到视图＝》工具栏＝》控件工具箱。 这时“控制工具箱”就出来了，点上面的“设计模式”，然后在Flash文件上右键复制，然后粘贴到桌面上。 现在桌面上会有个叫“片段”的文件，用十六进制编辑器（如WinHex）打开它，搜索十六进制值“465753”，找到后删除“465753”前面的所有内容，最后把剩下的内容另存为“文件名.swf”文件就可以了。]]></description>
			<content:encoded><![CDATA[<p>以Word为例，Excel也是一样的。<br />
找到视图＝》工具栏＝》控件工具箱。<br />
这时“控制工具箱”就出来了，点上面的“设计模式”，然后在Flash文件上右键复制，然后粘贴到桌面上。<br />
现在桌面上会有个叫“片段”的文件，用十六进制编辑器（如WinHex）打开它，搜索十六进制值“465753”，找到后删除“465753”前面的所有内容，最后把剩下的内容另存为“文件名.swf”文件就可以了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/export-swf-from-word-or-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>简单修复Nginx文件类型错误解析漏洞</title>
		<link>http://blog.xcyh.org/nginx-bug-fix/</link>
		<comments>http://blog.xcyh.org/nginx-bug-fix/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 03:28:14 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=942</guid>
		<description><![CDATA[这个漏洞好像从今年5月20号就开始公布了，修复方法有几个，我就不说了，这里说下我的方法，简单快速。 在fastcgi_params文件前面加上下面代码，然后reload下nginx就可以了。 if &#40;$request_filename ~* &#40;.*&#41;\.php&#41; &#123; set $php_url $1; &#125; if &#40;!-e $php_url.php&#41; &#123; return 403; &#125;]]></description>
			<content:encoded><![CDATA[<p>这个漏洞好像从今年5月20号就开始公布了，修复方法有几个，我就不说了，这里说下我的方法，简单快速。<br />
在fastcgi_params文件前面加上下面代码，然后reload下nginx就可以了。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$request_filename</span> ~<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>\.php<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">$php_url</span> <span style="color: #007800;">$1</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>-e <span style="color: #007800;">$php_url</span>.php<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">403</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/nginx-bug-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>网页变灰代码</title>
		<link>http://blog.xcyh.org/change-web-gray/</link>
		<comments>http://blog.xcyh.org/change-web-gray/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 00:58:56 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[变灰]]></category>
		<category><![CDATA[网页]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=937</guid>
		<description><![CDATA[把下面代码放入网页的&#60;head&#62;和&#60;/head&#62;之间就行了。 P.S.这个方法只支持IE浏览器，再说了，领导们一般都用IE的。 &#60;style&#62; html{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);} &#60;/style&#62;]]></description>
			<content:encoded><![CDATA[<p>把下面代码放入网页的&lt;head&gt;和&lt;/head&gt;之间就行了。<br />
P.S.这个方法只支持IE浏览器，再说了，领导们一般都用IE的。</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
html{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/change-web-gray/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL外键约束备份恢复问题</title>
		<link>http://blog.xcyh.org/mysql-foreign-key-backup-restore/</link>
		<comments>http://blog.xcyh.org/mysql-foreign-key-backup-restore/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 06:38:06 +0000</pubDate>
		<dc:creator>Burgess Lee</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[外键]]></category>

		<guid isPermaLink="false">http://blog.xcyh.org/?p=856</guid>
		<description><![CDATA[备份一点问题都没有，恢复时就不行了，原来是外键约束惹的祸。 恢复前执行 SET FOREIGN_KEY_CHECKS=0; 恢复后执行 SET FOREIGN_KEY_CHECKS=1;]]></description>
			<content:encoded><![CDATA[<p>备份一点问题都没有，恢复时就不行了，原来是外键约束惹的祸。</p>
<p>恢复前执行</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>;</pre></div></div>

<p>恢复后执行</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.xcyh.org/mysql-foreign-key-backup-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

