<?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>vifix.cn &#187; Software</title>
	<atom:link href="http://vifix.cn/blog/category/software/feed" rel="self" type="application/rss+xml" />
	<link>http://vifix.cn/blog</link>
	<description>compile the dream, compile tomorrow</description>
	<lastBuildDate>Tue, 15 May 2012 11:42:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CentOS 安装 KVM 因 nc.openbsd 不存在导致无法使用远程 virt-manager 连接的问题</title>
		<link>http://vifix.cn/blog/centos-6-2-install-kvm-remote-virt-manager-nc-openbsd-exception.html</link>
		<comments>http://vifix.cn/blog/centos-6-2-install-kvm-remote-virt-manager-nc-openbsd-exception.html#comments</comments>
		<pubDate>Tue, 15 May 2012 07:36:42 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2321</guid>
		<description><![CDATA[这两天公司里面准备配置一台专门的机器作为开发这边的共同测试环境 虽然前段时间早就配置过真实的生产环境机器的kvm，但是发现这次有些东西还是想不起来了，所以还是记录一下 安装KVM本身没什么，在yum的帮助下完成即可： yum install libvirt kvm 就行了，然后使用modprobe加载下kvm模块，并且启动libvirtd服务（或者重启也可以） 但是在接下去的用远程的virt-manager连接的时候会碰到远程管理无法连接的问题，使用virt-manager &#8211;debug可以看到错误输出如下： 2012-05-14 20:35:10,068 (connection:991): Scheduling background open thread for qemu+ssh://root@hxdev/system 2012-05-14 20:35:10,068 (connection:1177): Background &#8216;open connection&#8217; thread is running 2012-05-14 20:35:10,095 (connection:1227): Background open thread complete, scheduling notify 2012-05-14 20:35:10,096 (connection:1232): Notifying open result 2012-05-14 20:35:10,096 (create:158): Closing new vm wizard 2012-05-14 20:35:10,097 (storagebrowse:80): Closing storage [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2012/05/virt-manager-kvm.png" rel="shadowbox[sbpost-2321];player=img;" title="virt-manager-kvm"><img class="alignnone size-medium wp-image-2363" title="virt-manager-kvm" src="http://vifix.cn/blog/wp-content/uploads/2012/05/virt-manager-kvm-300x240.png" alt="" width="300" height="240" /></a></p>
<p>这两天公司里面准备配置一台专门的机器作为开发这边的共同测试环境</p>
<p>虽然前段时间早就配置过真实的生产环境机器的kvm，但是发现这次有些东西还是想不起来了，所以还是记录一下</p>
<p>安装KVM本身没什么，在yum的帮助下完成即可：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> libvirt kvm</pre></div></div>

<p>就行了，然后使用modprobe加载下kvm模块，并且启动libvirtd服务（或者重启也可以）</p>
<p>但是在接下去的用远程的virt-manager连接的时候会碰到远程管理无法连接的问题，使用virt-manager &#8211;debug可以看到错误输出如下：<br />
<span id="more-2321"></span></p>
<blockquote><p>2012-05-14 20:35:10,068 (connection:991): Scheduling background open thread for qemu+ssh://root@hxdev/system<br />
2012-05-14 20:35:10,068 (connection:1177): Background &#8216;open connection&#8217; thread is running<br />
2012-05-14 20:35:10,095 (connection:1227): Background open thread complete, scheduling notify<br />
2012-05-14 20:35:10,096 (connection:1232): Notifying open result<br />
2012-05-14 20:35:10,096 (create:158): Closing new vm wizard<br />
2012-05-14 20:35:10,097 (storagebrowse:80): Closing storage browser<br />
2012-05-14 20:35:10,097 (createvol:80): Closing new volume wizard<br />
2012-05-14 20:35:10,100 (cli:83): Uncaught exception:<br />
Traceback (most recent call last):<br />
File &#8220;/usr/share/virt-manager/virtManager/manager.py&#8221;, line 665, in _connect_error<br />
if conn.is_remote() and re.search(r&#8221;nc.openbsd: .* &#8212; &#8216;U&#8217;&#8221;, details):<br />
UnboundLocalError: local variable &#8216;details&#8217; referenced before assignment</p>
<p>Traceback (most recent call last):<br />
File &#8220;/usr/share/virt-manager/virtManager/manager.py&#8221;, line 665, in _connect_error<br />
if conn.is_remote() and re.search(r&#8221;nc.openbsd: .* &#8212; &#8216;U&#8217;&#8221;, details):<br />
UnboundLocalError: local variable &#8216;details&#8217; referenced before assignment</p></blockquote>
<p>原因是virtmanager依赖的nc.openbsd不存在，但实际上nc（netcat）在CentOS中是有的，所以只要在服务器上为nc建立一个符号链接即可：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>nc <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>nc.openbsd</pre></div></div>

<p>小TIP: virt-manager貌似bug还不少，很多时候实际发生错误的时候它都不会报错，如果你在使用它连接远程的时候，connect发现毫无动静，那就说明实际上已经出错了，可以通过virt-manager &#8211;debug进行查看。先前靠着这个信息还发现了一个变量在使用前没有初始化的问题，可见其代码质量并不是很好……</p>
<p>可以参考此文：<a href="http://korprulu.blogspot.com/2011/05/virt-manager-problem-in-archlinux.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/korprulu.blogspot.com/2011/05/virt-manager-problem-in-archlinux.html?referer=');">http://korprulu.blogspot.com/2011/05/virt-manager-problem-in-archlinux.html</a> （讲的也是上面的问题，当时找这个错误的原因花了好久……）</p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/centos-6-2-install-kvm-remote-virt-manager-nc-openbsd-exception.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coreseek在GCC 4.7上编译不通过的问题</title>
		<link>http://vifix.cn/blog/coreseek-cant-make-in-gcc-4-7-enviroment.html</link>
		<comments>http://vifix.cn/blog/coreseek-cant-make-in-gcc-4-7-enviroment.html#comments</comments>
		<pubDate>Mon, 16 Apr 2012 06:31:35 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Coreseek]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2342</guid>
		<description><![CDATA[今天在archlinux在安装coreseek 4.1-beta时碰到的问题，在g++编译sphinxexpr.cpp时： &#160; g++ -DHAVE_CONFIG_H -I. -I../config -DSYSCONFDIR=&#34;\&#34;/opt/coreseek-3.2.14/etc\&#34;&#34; -DDATADIR=&#34;\&#34;/opt/coreseek-3.2.14/var/data\&#34;&#34; -I/usr/local/include -pthread -I/usr/include/mysql -fPIC -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer -g -I/opt/mmseg-3.2.14/include/mmseg/ -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -MT sphinxexpr.o -MD -MP -MF .deps/sphinxexpr.Tpo -c -o sphinxexpr.o sphinxexpr.cpp sphinxexpr.cpp: In constructor ‘ExprParser_t::ExprParser_t&#40;CSphSchema*, ISphExprHook*&#41;’: sphinxexpr.cpp:742:17: warning: ‘ExprParser_t::m_pExtra’ will be initialized after &#91;-Wreorder&#93; sphinxexpr.cpp:711:19: warning: ‘ISphExprHook* ExprParser_t::m_pHook’ &#91;-Wreorder&#93; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2012/04/coreseek.gif" rel="shadowbox[sbpost-2342];player=img;" title="coreseek"><img src="http://vifix.cn/blog/wp-content/uploads/2012/04/coreseek.gif" alt="" title="coreseek" width="180" height="55" class="alignnone size-full wp-image-2344" /></a></p>
<p>今天在archlinux在安装coreseek 4.1-beta时碰到的问题，在g++编译sphinxexpr.cpp时：</p>
<p><span id="more-2342"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">g++</span> -DHAVE_CONFIG_H -I. -I..<span style="color: #000000; font-weight: bold;">/</span>config  <span style="color: #660033;">-DSYSCONFDIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>/opt/coreseek-3.2.14/etc<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #660033;">-DDATADIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>/opt/coreseek-3.2.14/var/data<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include <span style="color: #660033;">-pthread</span> -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">-fPIC</span> <span style="color: #660033;">-pipe</span> <span style="color: #660033;">-fstack-protector</span> <span style="color: #660033;">--param</span>=ssp-buffer-size=<span style="color: #000000;">4</span> -D_FORTIFY_SOURCE=<span style="color: #000000;">2</span> <span style="color: #660033;">-fno-strict-aliasing</span> -DBIG_JOINS=<span style="color: #000000;">1</span> <span style="color: #660033;">-fomit-frame-pointer</span>  <span style="color: #660033;">-g</span>  -I<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>mmseg-3.2.14<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>mmseg<span style="color: #000000; font-weight: bold;">/</span>   <span style="color: #660033;">-Wall</span> <span style="color: #660033;">-g</span> -D_FILE_OFFSET_BITS=<span style="color: #000000;">64</span> <span style="color: #660033;">-O3</span> <span style="color: #660033;">-DNDEBUG</span> <span style="color: #660033;">-MT</span> sphinxexpr.o <span style="color: #660033;">-MD</span> <span style="color: #660033;">-MP</span> <span style="color: #660033;">-MF</span> .deps<span style="color: #000000; font-weight: bold;">/</span>sphinxexpr.Tpo <span style="color: #660033;">-c</span> <span style="color: #660033;">-o</span> sphinxexpr.o sphinxexpr.cpp
sphinxexpr.cpp: In constructor ‘ExprParser_t::ExprParser_t<span style="color: #7a0874; font-weight: bold;">&#40;</span>CSphSchema<span style="color: #000000; font-weight: bold;">*</span>, ISphExprHook<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">742</span>:<span style="color: #000000;">17</span>: warning: ‘ExprParser_t::m_pExtra’ will be initialized after <span style="color: #7a0874; font-weight: bold;">&#91;</span>-Wreorder<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">711</span>:<span style="color: #000000;">19</span>: warning:   ‘ISphExprHook<span style="color: #000000; font-weight: bold;">*</span> ExprParser_t::m_pHook’ <span style="color: #7a0874; font-weight: bold;">&#91;</span>-Wreorder<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">698</span>:<span style="color: #000000;">2</span>: warning:   when initialized here <span style="color: #7a0874; font-weight: bold;">&#91;</span>-Wreorder<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp: In instantiation of ‘int Expr_In_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = float<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>float<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_In_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = long long int<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>long long int<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_In_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = int<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>int<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1823</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_Interval_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = float<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>float<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_Interval_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = long long int<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>long long int<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_Interval_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = int<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>int<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1777</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_IntervalConst_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = float<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>float<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_IntervalConst_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = long long int<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>long long int<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_IntervalConst_c<span style="color: #000000; font-weight: bold;">&lt;</span>T<span style="color: #000000; font-weight: bold;">&gt;</span>::IntEval<span style="color: #7a0874; font-weight: bold;">&#40;</span>const CSphMatch<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> const <span style="color: #7a0874; font-weight: bold;">&#91;</span>with T = int<span style="color: #7a0874; font-weight: bold;">&#93;</span>’:
sphinxexpr.cpp:<span style="color: #000000;">3152</span>:<span style="color: #000000;">1</span>:   required from here
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: error: ‘ExprEval’ was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope, and no declarations were found by argument-dependent lookup at the point of instantiation <span style="color: #7a0874; font-weight: bold;">&#91;</span>-fpermissive<span style="color: #7a0874; font-weight: bold;">&#93;</span>
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: note: declarations <span style="color: #000000; font-weight: bold;">in</span> dependent base ‘Expr_ArgVsSet_c<span style="color: #000000; font-weight: bold;">&lt;</span>int<span style="color: #000000; font-weight: bold;">&gt;</span>’ are not found by unqualified lookup
sphinxexpr.cpp:<span style="color: #000000;">1746</span>:<span style="color: #000000;">43</span>: note: use ‘this-<span style="color: #000000; font-weight: bold;">&gt;</span>ExprEval’ instead
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>sphinxexpr.o<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span>
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Leaving directory <span style="color: #000000; font-weight: bold;">`/</span>home<span style="color: #000000; font-weight: bold;">/</span>mac<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>coreseek-<span style="color: #000000;">4.1</span>-beta<span style="color: #000000; font-weight: bold;">/</span>csft-<span style="color: #000000;">4.1</span><span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #ff0000;">'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mac/Downloads/coreseek-4.1-beta/csft-4.1/src'</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>all-recursive<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span></pre></div></div>

<p>在替换为coreseek 3.2.13后仍然发生了类似问题，但是在自己的Mac OS X 10.6.8上类似的编译却没有碰到这个问题，于是觉得很奇怪。</p>
<p>搜索之后，仅找到一个有用的链接：<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667378" target="_blank" onclick="pageTracker._trackPageview('/outgoing/bugs.debian.org/cgi-bin/bugreport.cgi?bug=667378&amp;referer=');">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667378</a>，是关于coreseek上游的sphinx的同样问题的，看了一下了解似乎是gcc 4.7的C++作用域的问题（？），上面的debian bugs里面提供了一个patch，看了下patch的内容，也对自己本地的coreseek的制作了同样的补丁，压缩包发布如下，使用时注意版本：</p>
<p><a href="http://vifix.cn/blog/wp-content/uploads/2012/04/sphinxexpr.cpp_.patch_.zip">sphinxexpr.cpp.patch.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/coreseek-cant-make-in-gcc-4-7-enviroment.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>KVM + libvirtd 配置iptables端口转发</title>
		<link>http://vifix.cn/blog/kvm-libvirtd-iptables-port-forward.html</link>
		<comments>http://vifix.cn/blog/kvm-libvirtd-iptables-port-forward.html#comments</comments>
		<pubDate>Sat, 14 Apr 2012 07:43:47 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[libvirtd]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2328</guid>
		<description><![CDATA[（标题图与文章正文没有关系！ orz） 这个玩意儿不好好找文档看是真心不知道的，中文的iptables和libvirt的资源又比较零碎，所以特此总结下。 这两天在配置一个KVM虚拟机在宿主机（MAIN）上的端口转发，环境如下： 宿主机MAIN： eth0 &#8211; 连接外网，有一个固定IP（例如12.34.56.78），并且可以被外网直接访问到 virbr0 &#8211; libvirtd自动建立的虚拟网卡，用于连接内网，IP:192.168.122.1 虚拟机VM： eth0 &#8211; 连接MAIN的virbr0，IP:192.168.122.100 MySQL在端口3306上提供真实服务 现在要在外网上通过访问外网的MAIN的某个端口（例如12345），实现访问内网VM的3306，最初我想当然的在iptables.rules（CentOS位于/etc/sysconfig/iptables）里面增加了两条规则： *filter #... 其他规则 -A FORWARD -p tcp --dport 3306 -d 192.168.122.100 -j ACCEPT #... 其他规则 COMMIT #... *nat #... 其他规则 -A PREROUTING -p tcp -d 12.34.56.78 --dport 12345 -j DNAT --to 192.168.122.100:80 -A POSTROUTING -p tcp -d 192.168.122.100 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2012/04/snapshot-haiku.png" rel="shadowbox[sbpost-2328];player=img;" title="snapshot-haiku"><img class="alignnone size-medium wp-image-2329" title="snapshot-haiku" src="http://vifix.cn/blog/wp-content/uploads/2012/04/snapshot-haiku-300x240.png" alt="" width="300" height="240" /></a></p>
<p>（标题图与文章正文没有关系！ orz）</p>
<p>这个玩意儿不好好找文档看是真心不知道的，中文的iptables和libvirt的资源又比较零碎，所以特此总结下。</p>
<p>这两天在配置一个KVM虚拟机在宿主机（MAIN）上的端口转发，环境如下：</p>
<blockquote><p>宿主机MAIN：<br />
eth0 &#8211; 连接外网，有一个固定IP（例如12.34.56.78），并且可以被外网直接访问到<br />
virbr0 &#8211; libvirtd自动建立的虚拟网卡，用于连接内网，IP:192.168.122.1</p>
<p>虚拟机VM：<br />
eth0 &#8211; 连接MAIN的virbr0，IP:192.168.122.100<br />
MySQL在端口3306上提供真实服务</p></blockquote>
<p>现在要在外网上通过访问外网的MAIN的某个端口（例如12345），实现访问内网VM的3306，最初我想当然的在iptables.rules（CentOS位于/etc/sysconfig/iptables）里面增加了两条规则：</p>
<p><span id="more-2328"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">*</span>filter
<span style="color: #666666; font-style: italic;">#... 其他规则</span>
<span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">3306</span> <span style="color: #660033;">-d</span> 192.168.122.100 <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #666666; font-style: italic;">#... 其他规则</span>
COMMIT
<span style="color: #666666; font-style: italic;">#...</span>
<span style="color: #000000; font-weight: bold;">*</span>nat
<span style="color: #666666; font-style: italic;">#... 其他规则</span>
<span style="color: #660033;">-A</span> PREROUTING <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-d</span> 12.34.56.78 <span style="color: #660033;">--dport</span> <span style="color: #000000;">12345</span> <span style="color: #660033;">-j</span> DNAT <span style="color: #660033;">--to</span> 192.168.122.100:<span style="color: #000000;">80</span>
<span style="color: #660033;">-A</span> POSTROUTING <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-d</span> 192.168.122.100 <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> SNAT <span style="color: #660033;">--to</span> 192.168.122.1
<span style="color: #666666; font-style: italic;">#... 其他规则</span>
COMMIT</pre></div></div>

<p>结果测试发现，在系统只有这些规则的情况下是没有问题的，但一旦libvirtd启动时自己加入的确保虚拟内网正常访问外网的NAT规则进来的话会产生冲突，原因很简单，就是libvirtd后来加入规则优先级高过我在iptables.rules里面设置的规则，所以就失去作用了。在这里我几乎花费了一天的时间来找问题到底如何解决，其中包括尝试修改iptables的优先级，详细阅读各种iptables的各种文档，用iptables-save导出被libvirtd修改后的iptables表在这基础上进行修改。最后终于搜到了libvirtd官网上的文档，讲libvirt管理下的虚拟机应该如何处理传入的连接，才了解到要用libvirtd的钩子脚本，会在任何虚拟机启动时启动这个脚本，位于/etc/libvirt/hooks/qemu 这个位置，于是编写脚本如下：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">Guest_name</span>=vm-database
<span style="color: #007800;">Host_external_ipaddr</span>=12.34.56.78
<span style="color: #007800;">Host_port</span>=<span style="color: #000000;">12345</span>
<span style="color: #007800;">Host_ipaddr</span>=192.168.122.1
<span style="color: #007800;">Guest_ipaddr</span>=192.168.122.100
<span style="color: #007800;">Guest_port</span>=<span style="color: #000000;">3306</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${Guest_name}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${2}</span>&quot;</span> = <span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
     iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> PREROUTING <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #800000;">${Host_port}</span> <span style="color: #660033;">-d</span> <span style="color: #800000;">${Host_external_ipaddr}</span> \
              <span style="color: #660033;">-j</span> DNAT <span style="color: #660033;">--to</span> <span style="color: #800000;">${Guest_ipaddr}</span>:<span style="color: #800000;">${Guest_port}</span>
     iptables <span style="color: #660033;">-I</span> FORWARD <span style="color: #660033;">-d</span> <span style="color: #800000;">${Guest_ipaddr}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span> <span style="color: #660033;">-p</span> tcp \
              <span style="color: #660033;">--dport</span> <span style="color: #800000;">${Guest_port}</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${2}</span>&quot;</span> = <span style="color: #ff0000;">&quot;stopped&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
     iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-D</span> PREROUTING <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #800000;">${Host_port}</span> <span style="color: #660033;">-d</span> <span style="color: #800000;">${Host_external_ipaddr}</span> \
              <span style="color: #660033;">-j</span> DNAT <span style="color: #660033;">--to</span> <span style="color: #800000;">${Guest_ipaddr}</span>:<span style="color: #800000;">${Guest_port}</span>
     iptables <span style="color: #660033;">-D</span> FORWARD <span style="color: #660033;">-d</span> <span style="color: #800000;">${Guest_ipaddr}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span> <span style="color: #660033;">-p</span> tcp \
              <span style="color: #660033;">--dport</span> <span style="color: #800000;">${Guest_port}</span> <span style="color: #660033;">-j</span> ACCEPT
 <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>这样的话，就可以确保新建的FORWARD规则的优先级是最高的了，从而不被libvirtd的规则给盖住。不过要注意的是这里无需做SNAT，因为libvirtd自己添加的在NAT表的MASQUERADE规则相当于已经给你做掉了SNAT转换！</p>
<p>这是值得一看的中文iptables文档，对于理解如何配置iptables的NAT配置非常有帮助！：<a href="http://blog.chinaunix.net/space.php?uid=276597&amp;do=blog&amp;id=2014536" target="_blank" onclick="pageTracker._trackPageview('/outgoing/blog.chinaunix.net/space.php?uid=276597_amp_do=blog_amp_id=2014536&amp;referer=');">iptables 应用初探（nat+三层访问控制）</a></p>
<p>libvirt的官网文档：<a href="http://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections" target="_blank" onclick="pageTracker._trackPageview('/outgoing/wiki.libvirt.org/page/Networking_Forwarding_Incoming_Connections?referer=');">http://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections</a> （里面提供了一个hooks钩子脚本的范例，不过这个里面提供的脚本不够全面，实际的生产环境因为可能更加复杂所以那个无法产生效果，）</p>
<p>最后和本文主题无关的~感谢下<a href="http://haiku-os.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/haiku-os.org/?referer=');">Haiku</a>里面的&#8221;PoorMan&#8221;，也就是文章顶图中虚拟机中高亮的窗口，是Haiku内建的一个超级轻量级的http服务器，在我本地archlinux上研究iptables和libvirtd的时候，作为主要测试对象立下了汗马功劳。Haiku是一个开源项目，立足于创立一个与BeOS兼容的操作系统，是一个很有趣的系统，感兴趣的童鞋可以去官网下载一个玩一下~</p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/kvm-libvirtd-iptables-port-forward.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parted Magic</title>
		<link>http://vifix.cn/blog/parted-magic.html</link>
		<comments>http://vifix.cn/blog/parted-magic.html#comments</comments>
		<pubDate>Thu, 05 Jan 2012 11:10:44 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2224</guid>
		<description><![CDATA[近来在朋友送了个512M的小U盘给我，在这文件动辄上G的年代，这小巧的容量显得并不是那么实用，于是一直在考虑到底该拿它来干吗。然后自己公司里面的PC因为是去年安装的kubuntu，当时出于可能仍然还会双系统的考虑，所以分区划分的太小，一年过去了已经渐渐的不堪用起来了，于是开始考虑把还没利用起来的仍然存在的ntfs分区合并入已有的ext4当中。以前做这种事情都是在Windows下面的Acronis Disk Director这个工具，这次打算在Linux下面处理掉这个问题。所以就google到了一个名为Parted Magic的Linux LiveCD发行版，从名字就可以看得出来，这是在模仿曾经的经典的分区软件Norton PartitionMagic的名字。 gparted是这个发行版最核心的应用，此外还提供了testdisk这个非常优秀的恢复软件（我曾经用过它的windows版本恢复过一个彻底被覆盖的分区表），当然还有其他很多和磁盘相关的应用（包括但不限于磁盘检查，磁盘备份，磁盘镜像等等等等等），并且可以使用firefox随时上网查相关的问题。 照着官网的说明，很容易就做成了自启动U盘，通过在gparted约一个小时的折腾（其中主要是因为分区位置变动所以其自动复制几十G数据时的消耗的时间），搞定了相关的问题，觉得此物还是蛮不错的，所以就写了这篇日志。 PS:  开始的时候还担心移动分区的位置可能会导致uuid变动导致grub2无法正常引导的问题，事实证明（操作前后进行了对比）这个是不会发生变化的，所以可以安心使用移动分区位置的功能（当然还是要小心操作啦～丢了数据还是伤不起的 = 。 =）]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2012/01/partedmagic.png" rel="shadowbox[sbpost-2224];player=img;" title="partedmagic"><img class="alignnone size-medium wp-image-2225" title="partedmagic" src="http://vifix.cn/blog/wp-content/uploads/2012/01/partedmagic-300x240.png" alt="" width="300" height="240" /></a></p>
<p>近来在朋友送了个512M的小U盘给我，在这文件动辄上G的年代，这小巧的容量显得并不是那么实用，于是一直在考虑到底该拿它来干吗。然后自己公司里面的PC因为是去年安装的kubuntu，当时出于可能仍然还会双系统的考虑，所以分区划分的太小，一年过去了已经渐渐的不堪用起来了，于是开始考虑把还没利用起来的仍然存在的ntfs分区合并入已有的ext4当中。以前做这种事情都是在Windows下面的Acronis Disk Director这个工具，这次打算在Linux下面处理掉这个问题。所以就google到了一个名为<a href="http://partedmagic.com/doku.php" target="_blank" onclick="pageTracker._trackPageview('/outgoing/partedmagic.com/doku.php?referer=');">Parted Magic</a>的Linux LiveCD发行版，从名字就可以看得出来，这是在模仿曾经的经典的分区软件<a href="http://zh.wikipedia.org/zh/Norton_PartitionMagic" target="_blank" onclick="pageTracker._trackPageview('/outgoing/zh.wikipedia.org/zh/Norton_PartitionMagic?referer=');">Norton PartitionMagic</a>的名字。</p>
<p>gparted是这个发行版最核心的应用，此外还提供了testdisk这个非常优秀的恢复软件（我曾经用过它的windows版本恢复过一个彻底被覆盖的分区表），当然还有其他很多和磁盘相关的应用（包括但不限于磁盘检查，磁盘备份，磁盘镜像等等等等等），并且可以使用firefox随时上网查相关的问题。</p>
<p>照着官网的说明，很容易就做成了自启动U盘，通过在gparted约一个小时的折腾（其中主要是因为分区位置变动所以其自动复制几十G数据时的消耗的时间），搞定了相关的问题，觉得此物还是蛮不错的，所以就写了这篇日志。</p>
<p>PS:  开始的时候还担心移动分区的位置可能会导致uuid变动导致grub2无法正常引导的问题，事实证明（操作前后进行了对比）这个是不会发生变化的，所以可以安心使用移动分区位置的功能（当然还是要小心操作啦～丢了数据还是伤不起的 = 。 =）</p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/parted-magic.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stellarium</title>
		<link>http://vifix.cn/blog/stellarium.html</link>
		<comments>http://vifix.cn/blog/stellarium.html#comments</comments>
		<pubDate>Fri, 09 Dec 2011 11:33:27 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Sky]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2182</guid>
		<description><![CDATA[从小就热爱星空，然而住在城市，无缘于干净的天空不免是件很遗憾的事情，来了月全食和日全食这种盛事自然也是不能错过了。 所以这里推荐下用了多年的名为Stellarium这个好物，是个可以模拟太阳系内任意位置任意时间的天空运行的软件（包括日食月食这种天象），当然模拟的看起来并不是那么过瘾，但作为爱好者的必备软件，这个还是非常值得推荐的。 官网是：http://www.stellarium.org/ 现代人真的应该好好保护下夜空了，周围很多人都觉得看过流星就是件很稀奇的事情，这个真的有点遗憾啊……]]></description>
			<content:encoded><![CDATA[<div id="attachment_2183" class="wp-caption alignnone" style="width: 310px"><a href="http://vifix.cn/blog/wp-content/uploads/2011/12/snapshot43.png" rel="shadowbox[sbpost-2182];player=img;" title="Stellarium"><img class="size-medium wp-image-2183" title="Stellarium" src="http://vifix.cn/blog/wp-content/uploads/2011/12/snapshot43-300x187.png" alt="" width="300" height="187" /></a><p class="wp-caption-text">Stellarium模拟的杭州在北京时间2011年12月10日22:17时的星空，十字选中的是正在发生月食的月亮</p></div>
<p>从小就热爱星空，然而住在城市，无缘于干净的天空不免是件很遗憾的事情，来了月全食和日全食这种盛事自然也是不能错过了。</p>
<p>所以这里推荐下用了多年的名为Stellarium这个好物，是个可以模拟太阳系内任意位置任意时间的天空运行的软件（包括日食月食这种天象），当然模拟的看起来并不是那么过瘾，但作为爱好者的必备软件，这个还是非常值得推荐的。</p>
<p>官网是：<a title="Stellarium" href="http://www.stellarium.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.stellarium.org/?referer=');">http://www.stellarium.org/</a></p>
<p>现代人真的应该好好保护下夜空了，周围很多人都觉得看过流星就是件很稀奇的事情，这个真的有点遗憾啊……</p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/stellarium.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DoubanFM-CLI</title>
		<link>http://vifix.cn/blog/doubanfm-cli.html</link>
		<comments>http://vifix.cn/blog/doubanfm-cli.html#comments</comments>
		<pubDate>Wed, 12 Oct 2011 09:14:36 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2158</guid>
		<description><![CDATA[嗯……一直想在Linux下面搞个好使的豆瓣FM客户端好在工作时听听（不然要专门开个浏览器），于是google了下找到了这个，于是什么桌面客户端之类的弱爆了啊，这个才是Geeker听音乐的方式 = 。 = 东西是Python写的，代码短小精干，也可以自己研究下 github: https://github.com/zhendi/DoubanFM-CLI 作者豆瓣: http://www.douban.com/people/KaKa9527/]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2011/10/douban_cli.png" rel="shadowbox[sbpost-2158];player=img;" title="douban_cli"><img class="alignnone size-medium wp-image-2160" title="douban_cli" src="http://vifix.cn/blog/wp-content/uploads/2011/10/douban_cli-300x187.png" alt="" width="300" height="187" /></a></p>
<p>嗯……一直想在Linux下面搞个好使的豆瓣FM客户端好在工作时听听（不然要专门开个浏览器），于是google了下找到了这个，于是什么桌面客户端之类的弱爆了啊，这个才是Geeker听音乐的方式 = 。 =</p>
<p>东西是Python写的，代码短小精干，也可以自己研究下</p>
<p>github: <a href="https://github.com/zhendi/DoubanFM-CLI" target="_blank" onclick="pageTracker._trackPageview('/outgoing/github.com/zhendi/DoubanFM-CLI?referer=');">https://github.com/zhendi/DoubanFM-CLI</a></p>
<p>作者豆瓣: <a href="http://www.douban.com/people/KaKa9527/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.douban.com/people/KaKa9527/?referer=');">http://www.douban.com/people/KaKa9527/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/doubanfm-cli.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>fbterm—支持freetype2字体库的帧缓冲终端控制台</title>
		<link>http://vifix.cn/blog/fbterm.html</link>
		<comments>http://vifix.cn/blog/fbterm.html#comments</comments>
		<pubDate>Sat, 20 Aug 2011 18:02:18 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2134</guid>
		<description><![CDATA[http://code.google.com/p/fbterm/ 继续来推荐Linux下面的software，这是最近发现的好物，fbterm，可以在帧缓冲的终端控制台下提供中文显示的支持，并且也能支持输入法，比起那个已经数年没有更新的zhcon好多了（zhcon也容易导致没有响应或有奇怪的问题）。更重要的是，它的字体显示是调用freetype2的，所以能和X下面的GUI应用达到相同的字体显示效果，看着文泉驿非常舒服～ 中文输入法可以用来自对岸的香草输入法，在ubuntu下面（我是11.04），需要安装的包为 libucimf fbterm-ucimf ucimf-openvanilla openvanilla-modules 装完openvanilla后可以去/usr/share/openvanilla/OVIMGeneric把文件移走到别的目录（其实就是删除），只剩拼音或者其它你熟悉的输入法～ 然后配置一下你自己的.fbtermrc，做如下设置即可： input-method=fbterm_ucimf 输入效果： PS.1: 如果不介意中文输入，也可以尝试下jfbterm这个另外的控制台终端程序，貌似也还行，就是不知道为什么我这里退出的时候程序会死掉。 PS.2:KDE 4.6的性能提升不少啊，用着很舒服，KDE加油！ PS.3: 最近工作真的是忙死了，各种求RP啊]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2011/08/vim.png" rel="shadowbox[sbpost-2134];player=img;" title="vim"><img class="alignnone size-medium wp-image-2135" title="vim" src="http://vifix.cn/blog/wp-content/uploads/2011/08/vim-300x187.png" alt="" width="300" height="187" /></a></p>
<p><a href="http://code.google.com/p/fbterm/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/fbterm/?referer=');">http://code.google.com/p/fbterm/</a></p>
<p>继续来推荐Linux下面的software，这是最近发现的好物，fbterm，可以在帧缓冲的终端控制台下提供中文显示的支持，并且也能支持输入法，比起那个已经数年没有更新的zhcon好多了（zhcon也容易导致没有响应或有奇怪的问题）。更重要的是，它的字体显示是调用freetype2的，所以能和X下面的GUI应用达到相同的字体显示效果，看着文泉驿非常舒服～</p>
<p><span id="more-2134"></span></p>
<p>中文输入法可以用来自对岸的香草输入法，在ubuntu下面（我是11.04），需要安装的包为</p>
<ul>
<li>libucimf</li>
<li>fbterm-ucimf</li>
<li>ucimf-openvanilla</li>
<li>openvanilla-modules</li>
</ul>
<p>装完openvanilla后可以去/usr/share/openvanilla/OVIMGeneric把文件移走到别的目录（其实就是删除），只剩拼音或者其它你熟悉的输入法～</p>
<p>然后配置一下你自己的.fbtermrc，做如下设置即可：</p>
<blockquote><p>input-method=fbterm_ucimf</p></blockquote>
<p>输入效果：</p>
<p><a href="http://vifix.cn/blog/wp-content/uploads/2011/08/w3m-img.png" rel="shadowbox[sbpost-2134];player=img;" title="w3m-img"><img class="alignnone size-medium wp-image-2136" title="w3m-img" src="http://vifix.cn/blog/wp-content/uploads/2011/08/w3m-img-300x187.png" alt="" width="300" height="187" /></a></p>
<p>PS.1: 如果不介意中文输入，也可以尝试下jfbterm这个另外的控制台终端程序，貌似也还行，就是不知道为什么我这里退出的时候程序会死掉。</p>
<p>PS.2:KDE 4.6的性能提升不少啊，用着很舒服，KDE加油！</p>
<p>PS.3: 最近工作真的是忙死了，各种求RP啊</p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/fbterm.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>推荐下mintty</title>
		<link>http://vifix.cn/blog/mintty.html</link>
		<comments>http://vifix.cn/blog/mintty.html#comments</comments>
		<pubDate>Sat, 25 Jun 2011 10:10:14 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=2086</guid>
		<description><![CDATA[没啥好说的，cmd.exe太挫了，找到了这个mintty用来替换之，非常不错，对于CLI一直很薄弱的windows来说已经觉得很满意了。 项目似乎是基于putty的，推荐给那些整天Unix世界（Linux/BSD/OSX）和Windows世界来回奔波的geeker们（伤不起啊有木有！！！）]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2011/06/mintty.png" rel="shadowbox[sbpost-2086];player=img;" title="mintty"><img class="alignnone size-medium wp-image-2087" title="mintty" src="http://vifix.cn/blog/wp-content/uploads/2011/06/mintty-300x240.png" alt="" width="300" height="240" /></a></p>
<p>没啥好说的，cmd.exe太挫了，找到了这个mintty用来替换之，非常不错，对于CLI一直很薄弱的windows来说已经觉得很满意了。</p>
<p>项目似乎是基于putty的，推荐给那些整天Unix世界（Linux/BSD/OSX）和Windows世界来回奔波的geeker们（伤不起啊有木有！！！）</p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/mintty.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>我的KDE4不可能这么华丽</title>
		<link>http://vifix.cn/blog/my-linux-workspace-kde4-cant-be-this-deluxe.html</link>
		<comments>http://vifix.cn/blog/my-linux-workspace-kde4-cant-be-this-deluxe.html#comments</comments>
		<pubDate>Wed, 26 Jan 2011 11:45:38 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=1848</guid>
		<description><![CDATA[呃，想了半天脑子里面还是跳出这个标题……也罢，这个就这个吧，囧 （另一个候选是“关于我的桌面的二三事”……呃…… 在公司里去年11月的时候把90%的工作转向了Linux下面（偶尔要用下photoshop或者改下老项目的代码则不得不重启到windows xp），选择了一直最顺手的发行版也就是ubuntu（因为一直是kde用户，所以是直接kubuntu了），一开始装的是10.04，后来直接apt升级到了10.10。 几个月下来一直用的还算蛮顺手的，不过还是主要得益于去年11月的时候有一个项目比较空档的时候，所以能有比较多的时间来调教和熟悉KDE4（KDE1.x-KDE2.x-KDE3.x的时代一直很顺手），没有调教过的kubuntu的KDE4总觉得怪怪的，不如ubuntu的gnome那样精致。 那么记录几条算是心得的东西： BFS，介个是个好东西，虽然名字比较囧，全称为Brain F**k Scheduler ，嗯你没想错，F**k正是那个地球人都知道的单词……这玩意儿是一个针对16个核心以下的cpu优化的调度器，以内核补丁的形式存在，不过懒得自己去捣鼓编译内核，就找了个适合ubuntu 10.10的第三方apt源，其地址为https://launchpad.net/~chogydan/+archive/ppa。总之一句话，快，人能感觉到的快！（不过要注意的是，nvidia的显卡需要自己去官网下一个重新安装过，ubuntu预编译的都是针对ubuntu官方预编译的内核的，对于这个第三方打过补丁的预编译内核无效） 第二个好东西叫yakuake，全名为Yet Another Quake，为什么是这么奇怪的名字，是因为它是模仿Quake那个游戏内建的控制台的终端程序，装备之后，真可谓CLI anywhere了，按一下默认快捷键F12就出来一个半透明终端，拉风，又非常实用。 KDE4的KWin是个好东西，KDE官方的桌面效果的实现，但是它用了双缓冲这种以往只有游戏里面才会用的技术，于是在公司的intel集显上显得很不给力（甚至屏幕刷新都有问题），所以还是用compiz来做桌面装饰，首先apt安装compiz后，去KDE的settings里修改默认程序（和修改默认web浏览器同一个地方），把窗口管理改成compiz，然后在~/.kde/Autostart/下面加一个脚本，在里面启动emerald。再重启KDE即可在低端集成卡上体验到流畅的桌面效果了（这样设置不会有kpager认compiz的workspace数量认错的问题）。 最后例行的晒桌面（好吧其实也就这样……） 在公司办公桌上放了一份同事给的vim快捷键cheetsheet，努力习惯vim中……希望能过段时间写篇啥《我的VIM不可能这么华丽》吧……]]></description>
			<content:encoded><![CDATA[<p><a href="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot1.jpg" rel="shadowbox[sbpost-1848];player=img;" title="snapshot1"><img class="alignnone size-medium wp-image-1851" title="snapshot1" src="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot1-300x187.jpg" alt="" width="300" height="187" /></a></p>
<p>呃，想了半天脑子里面还是跳出这个标题……也罢，这个就这个吧，囧 （另一个候选是“关于我的桌面的二三事”……呃……</p>
<p>在公司里去年11月的时候把90%的工作转向了Linux下面（偶尔要用下photoshop或者改下老项目的代码则不得不重启到windows xp），选择了一直最顺手的发行版也就是ubuntu（因为一直是kde用户，所以是直接kubuntu了），一开始装的是10.04，后来直接apt升级到了10.10。</p>
<p>几个月下来一直用的还算蛮顺手的，不过还是主要得益于去年11月的时候有一个项目比较空档的时候，所以能有比较多的时间来调教和熟悉KDE4（KDE1.x-KDE2.x-KDE3.x的时代一直很顺手），没有调教过的kubuntu的KDE4总觉得怪怪的，不如ubuntu的gnome那样精致。</p>
<p>那么记录几条算是心得的东西：</p>
<p><span id="more-1848"></span></p>
<ul>
<li>BFS，介个是个好东西，虽然名字比较囧，全称为Brain F**k Scheduler ，嗯你没想错，F**k正是那个地球人都知道的单词……这玩意儿是一个针对16个核心以下的cpu优化的调度器，以内核补丁的形式存在，不过懒得自己去捣鼓编译内核，就找了个适合ubuntu 10.10的第三方apt源，其地址为<a href="https://launchpad.net/~chogydan/+archive/ppa" target="_blank" onclick="pageTracker._trackPageview('/outgoing/launchpad.net/_chogydan/+archive/ppa?referer=');">https://launchpad.net/~chogydan/+archive/ppa</a>。总之一句话，快，人能感觉到的快！（不过要注意的是，nvidia的显卡需要自己去官网下一个重新安装过，ubuntu预编译的都是针对ubuntu官方预编译的内核的，对于这个第三方打过补丁的预编译内核无效）</li>
<li>第二个好东西叫yakuake，全名为Yet Another Quake，为什么是这么奇怪的名字，是因为它是模仿Quake那个游戏内建的控制台的终端程序，装备之后，真可谓CLI anywhere了，按一下默认快捷键F12就出来一个半透明终端，拉风，又非常实用。</li>
<li>KDE4的KWin是个好东西，KDE官方的桌面效果的实现，但是它用了双缓冲这种以往只有游戏里面才会用的技术，于是在公司的intel集显上显得很不给力（甚至屏幕刷新都有问题），所以还是用compiz来做桌面装饰，首先apt安装compiz后，去KDE的settings里修改默认程序（和修改默认web浏览器同一个地方），把窗口管理改成compiz，然后在~/.kde/Autostart/下面加一个脚本，在里面启动emerald。再重启KDE即可在低端集成卡上体验到流畅的桌面效果了（这样设置不会有kpager认compiz的workspace数量认错的问题）。</li>
</ul>
<p>最后例行的晒桌面（好吧其实也就这样……）</p>

<a href='http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot1.jpg' rel='shadowbox[sbalbum-1848];player=img;' title='snapshot1' title="snapshot1"><img width="150" height="150" src="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot1-150x150.jpg" class="attachment-thumbnail" alt="snapshot1" title="snapshot1" /></a>
<a href='http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot2.jpg' rel='shadowbox[sbalbum-1848];player=img;' title='snapshot2' title="snapshot2"><img width="150" height="150" src="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot2-150x150.jpg" class="attachment-thumbnail" alt="snapshot2" title="snapshot2" /></a>
<a href='http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot3.jpg' rel='shadowbox[sbalbum-1848];player=img;' title='snapshot3' title="snapshot3"><img width="150" height="150" src="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot3-150x150.jpg" class="attachment-thumbnail" alt="snapshot3" title="snapshot3" /></a>
<a href='http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot4.jpg' rel='shadowbox[sbalbum-1848];player=img;' title='snapshot4' title="snapshot4"><img width="150" height="150" src="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot4-150x150.jpg" class="attachment-thumbnail" alt="snapshot4" title="snapshot4" /></a>
<a href='http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot5.jpg' rel='shadowbox[sbalbum-1848];player=img;' title='snapshot5' title="snapshot5"><img width="150" height="150" src="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot5-150x150.jpg" class="attachment-thumbnail" alt="snapshot5" title="snapshot5" /></a>
<a href='http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot6.jpg' rel='shadowbox[sbalbum-1848];player=img;' title='snapshot6' title="snapshot6"><img width="150" height="150" src="http://vifix.cn/blog/wp-content/uploads/2011/01/snapshot6-150x150.jpg" class="attachment-thumbnail" alt="snapshot6" title="snapshot6" /></a>

<p>在公司办公桌上放了一份同事给的vim快捷键cheetsheet，努力习惯vim中……希望能过段时间写篇啥《我的VIM不可能这么华丽》吧……</p>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/my-linux-workspace-kde4-cant-be-this-deluxe.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>wget使用ssh socks代理</title>
		<link>http://vifix.cn/blog/wget-use-socks-proxy-as-http-proxy.html</link>
		<comments>http://vifix.cn/blog/wget-use-socks-proxy-as-http-proxy.html#comments</comments>
		<pubDate>Tue, 14 Sep 2010 07:40:26 +0000</pubDate>
		<dc:creator>Mac</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vifix.cn/blog/?p=1557</guid>
		<description><![CDATA[在apt自动调用wget下载http://archive.canonical.com/上的一个二进制文件的时候遇到了一个问题，那就是速度太慢，然而wget又无法直接指定ssh通道建立的socks代理服务器，于是google来了这个方法解决了这个问题。 wget不支持socks代理而仅支持http/https/ftp代理，而有时候又只有ssh可以用，这时候这个两部即可完成的技巧就很管用： 用ssh的-L参数指定一个端口到目标服务器的SSH Tunnel 将wget的http代理设置为localhost的对应端口，并增加一个http header 实际操作，指定端口转发到目标服务器，并和ssh服务器建立连接： ssh -L 8888:&#91;要访问的服务器IP&#93;:&#91;服务器HTTP端口&#93; &#91;ssh服务器地址&#93; 使用wget时则需要： wget -header=&#34;Host: [要访问的服务器IP]:[服务器HTTP端口]&#34; http://localhost:8888/&#91;文件路径&#93; 如果是apt那种应用环境自动调用的wget，则可以在/etc/wgetrc里面修改参数，加入 header = Host: [要访问的服务器IP]:[服务器HTTP端口] http_proxy = http://localhost:8888/]]></description>
			<content:encoded><![CDATA[<p>在apt自动调用wget下载http://archive.canonical.com/上的一个二进制文件的时候遇到了一个问题，那就是速度太慢，然而wget又无法直接指定ssh通道建立的socks代理服务器，于是google来了这个方法解决了这个问题。<br />
wget不支持socks代理而仅支持http/https/ftp代理，而有时候又只有ssh可以用，这时候这个两部即可完成的技巧就很管用：</p>
<ol>
<li>用ssh的-L参数指定一个端口到目标服务器的SSH Tunnel</li>
<li>将wget的http代理设置为localhost的对应端口，并增加一个http header</li>
</ol>
<p>实际操作，指定端口转发到目标服务器，并和ssh服务器建立连接：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-L</span> <span style="color: #000000;">8888</span>:<span style="color: #7a0874; font-weight: bold;">&#91;</span>要访问的服务器IP<span style="color: #7a0874; font-weight: bold;">&#93;</span>:<span style="color: #7a0874; font-weight: bold;">&#91;</span>服务器HTTP端口<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">ssh</span>服务器地址<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>使用wget时则需要：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-header</span>=<span style="color: #ff0000;">&quot;Host: [要访问的服务器IP]:[服务器HTTP端口]&quot;</span> http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">8888</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>文件路径<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>如果是apt那种应用环境自动调用的wget，则可以在/etc/wgetrc里面修改参数，加入</p>
<blockquote><p>header = Host: [要访问的服务器IP]:[服务器HTTP端口]<br />
http_proxy = http://localhost:8888/</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://vifix.cn/blog/wget-use-socks-proxy-as-http-proxy.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

