<?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; Linux</title>
	<atom:link href="http://www.9wy.net/archives/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.9wy.net</link>
	<description>王府重地，宵小回避</description>
	<lastBuildDate>Wed, 01 Sep 2010 03:41:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>linux下连接windows桌面【转】</title>
		<link>http://www.9wy.net/archives/701</link>
		<comments>http://www.9wy.net/archives/701#comments</comments>
		<pubDate>Wed, 01 Sep 2010 00:15:05 +0000</pubDate>
		<dc:creator>九王爷</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.9wy.net/?p=701</guid>
		<description><![CDATA[软件：rdesktop-1.6.0 下载地址： 安装：./configure;make;make install 使用命令：rdesktop -u administrator -g 80% 192.168.0.254 工作时一般是开两台电脑 ，一台linux,一台windows,以前也用过虚拟机什么的，但是 有时候 跑起来拖泥带水的十分不爽，所以慢慢的就习惯了两台电脑的工作方式，一般我大部时间都在linux下面。用rdesktop远程控制Windows是在好 不过的了，redesktop 使用简单，windows也不和装什么服务端，是要把远程桌面共享打开就行了，下面来看一下rdesktop怎么使用吧，开个终端吧 $ info rdesktop //看一下帮助信息吧 $rdesktop 192.168.1.1 //打开了一个8位色彩的 $rdesktop -a 16 192.168.1.1 //这个是16位色彩的了，看起来好多了 $rdesktop -u administrator -p ****** -a 16 192.168.1.1 //都直接登陆了，呵,还差点什么呢 还有就是 －f 全屏操作，－g 指定使用屏幕大小 －g 800*600+0+0 这个＋0啊就是，就是你 这个窗口的在你linux上出现的位置，其它没什么了吧!加上-r sound:local可以把声音也搞过来了 $rdesktop -u administrator -p ****** -a 16 -r sound:local [...]]]></description>
			<content:encoded><![CDATA[<p>软件：rdesktop-1.6.0</p>
<p>下载地址：</p>
<p>安装：./configure;make;make install</p>
<p>使用命令：rdesktop -u administrator -g 80% 192.168.0.254</p>
<p>工作时一般是开两台电脑 ，一台linux,一台windows,以前也用过虚拟机什么的，但是 有时候  跑起来拖泥带水的十分不爽，所以慢慢的就习惯了两台电脑的工作方式，一般我大部时间都在linux下面。用rdesktop远程控制Windows是在好  不过的了，redesktop  使用简单，windows也不和装什么服务端，是要把远程桌面共享打开就行了，下面来看一下rdesktop怎么使用吧，开个终端吧</p>
<p>$ info rdesktop   //看一下帮助信息吧</p>
<p>$rdesktop 192.168.1.1 //打开了一个8位色彩的</p>
<p>$rdesktop -a 16 192.168.1.1 //这个是16位色彩的了，看起来好多了</p>
<p>$rdesktop -u administrator -p ****** -a 16 192.168.1.1 //都直接登陆了，呵,还差点什么呢</p>
<p>还有就是 －f 全屏操作，－g 指定使用屏幕大小 －g 800*600+0+0 这个＋0啊就是，就是你</p>
<p>这个窗口的在你linux上出现的位置，其它没什么了吧!加上-r sound:local可以把声音也搞过来了</p>
<p>$rdesktop -u administrator -p ****** -a 16 -r sound:local 192.168.1.1</p>
<p>其它吧,-r 的作用挺多的可以重定向许多东西，看一下帮助就会收获不少了。</p>
<p>丛网上看一个文章不错，从那复制一块吧，大家看一下：</p>
<p>-r comport:COM1=/dev/ttyS0 // 将串口 /dev/ttyS0 重定向为 COM1<br />
-r comport:COM1=/dev/ttyS0,COM2=/dev/ttyS1 // 多个串口重定向<br />
-r disk:floppy=/mnt/floppy // 将 /mnt/floppy 重定向为远程共享磁盘 &#8216;floppy&#8217;<br />
-r disk:floppy=/mnt/floppy,cdrom=/mnt/cdrom,root=/,c=/mnt/c // 多个磁盘重定向<br />
-r clientname= // 为重定向的磁盘设置显示的客户端名称<br />
-r lptport:LPT1=/dev/lp0 // 将并口 /dev/lp0 重定向为 LPT1<br />
-r lptport:LPT1=/dev/lp0,LPT2=/dev/lp1 // 多个并口重定向<br />
-r printer:mydeskjet // 打印机重定向<br />
-r printer:mydeskjet=&#8221;HP LaserJet IIIP&#8221; // 打印机重定向<br />
-r sound:[local|off|remote] // 声音重定向</p>
<p>提示：如果你的本地中文文件名在远程机器上显示为乱码的话，可能是你没有安装编码转化库，或者你安装的编码转化库不能正确运行。</p>
<p>另外，如果要在 Win98 里面使用远程桌面的客户端功能的话，只需要将 Windows XP/2003 中的远程桌面程序复制到 Windows 98 里面就可以了。相应的文件可以点击此处下载，一共只有 2 个文件，非常小的。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/701/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一句话搞定linux下ssh代理</title>
		<link>http://www.9wy.net/archives/698</link>
		<comments>http://www.9wy.net/archives/698#comments</comments>
		<pubDate>Wed, 01 Sep 2010 00:13:06 +0000</pubDate>
		<dc:creator>九王爷</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.9wy.net/?p=698</guid>
		<description><![CDATA[linux下面用ssh代理非常的方便 只需要在任何一个终端窗口输入： ssh -qTfnN -D 7070 用户名@远程ssh主机 ssh -qTfnN -D 7070 remotehost 参数详解： -D 7070 建立动态Tunnel，监听在本地7070端口。 -q  安静模式。 -T  不分配 TTY ,只做代理用 -f   将 ssh 转到后台运行，即认证之后，ssh 自动以后台运行。不会显示出来。 -n  将 stdio 重定向到 /dev/null，与-f配合使用。 -N  不运行远程程序。即通知 sshd 不运行设定的 shell。 当然，上面一个命令已经在本地建立了一个7070端口，所有到7070端口的数据都会转到远程ssh主机上。所以现在要做的是在本地需代理的程序上设置代理，发到本地7070端口就OK了]]></description>
			<content:encoded><![CDATA[<p>linux下面用ssh代理非常的方便</p>
<p>只需要在任何一个终端窗口输入：</p>
<div>
<div>
<pre>ssh -qTfnN -D 7070 用户名@远程ssh主机
ssh -qTfnN -D 7070 remotehost</pre>
</div>
</div>
<p>参数详解：<br />
-D 7070 建立动态Tunnel，监听在本地7070端口。<br />
-q  安静模式。<br />
-T  不分配 TTY ,只做代理用<br />
-f   将 ssh 转到后台运行，即认证之后，ssh 自动以后台运行。不会显示出来。<br />
-n  将 stdio 重定向到 /dev/null，与-f配合使用。<br />
-N  不运行远程程序。即通知 sshd 不运行设定的 shell。</p>
<p>当然，上面一个命令已经在本地建立了一个7070端口，所有到7070端口的数据都会转到远程ssh主机上。所以现在要做的是在本地需代理的程序上设置代理，发到本地7070端口就OK了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/698/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux下面关闭讨厌的比比声音</title>
		<link>http://www.9wy.net/archives/566</link>
		<comments>http://www.9wy.net/archives/566#comments</comments>
		<pubDate>Fri, 19 Jun 2009 01:10:52 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://9wy.net/archives/566.html</guid>
		<description><![CDATA[经常使用tab键的时候都会比比的叫，这不影响老婆大人休息吗！去掉它在/etc/inputrc里面添加一句set bell-style none 就OK 了。当然也可以在每个用户家目录里的 .inputrc里面添加这个（如果没有就自己建立一个) 世界终于清静了]]></description>
			<content:encoded><![CDATA[<p>经常使用tab键的时候都会比比的叫，这不影响老婆大人休息吗！去掉它在/etc/inputrc里面添加一句set bell-style none 就OK<br />
了。当然也可以在每个用户家目录里的<br />
.inputrc里面添加这个（如果没有就自己建立一个)<br />
世界终于清静了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/566/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gentoo升级 xorg</title>
		<link>http://www.9wy.net/archives/564</link>
		<comments>http://www.9wy.net/archives/564#comments</comments>
		<pubDate>Fri, 19 Jun 2009 01:10:08 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=564</guid>
		<description><![CDATA[不确定是不是中邪了，今天看到gentoo提示可以升级xorg以后就一直想者升级。终于没能挡 住诱惑，开始了升级。。。。1.3升级到1.5r3 查看了下需要更新的东西，好像很多哦，如下 simon@HomeC1 ~ $ sudo emerge -pv xorg-server These are the packages that would be merged, in order: Calculating dependencies&#8230; done! [ebuild U ] x11-proto/xproto-7.0.14 [7.0.10] 149 kB [ebuild U ] x11-proto/inputproto-1.5.0 [1.4.2.1] 57 kB [ebuild U ] x11-libs/xtrans-1.2.3 [1.0.3] USE=&#8221;-debug&#8221; 102 kB [ebuild U ] x11-proto/randrproto-1.2.2 [1.2.1] 62 kB [ebuild U ] [...]]]></description>
			<content:encoded><![CDATA[<p>不确定是不是中邪了，今天看到gentoo提示可以升级xorg以后就一直想者升级。终于没能挡<br />
住诱惑，开始了升级。。。。1.3升级到1.5r3</p>
<p>查看了下需要更新的东西，好像很多哦，如下<br />
simon@HomeC1 ~ $ sudo emerge -pv xorg-server</p>
<p>These are the packages that would be merged, in order:</p>
<p>Calculating dependencies&#8230; done!<br />
[ebuild U ] x11-proto/xproto-7.0.14 [7.0.10] 149 kB<br />
[ebuild U ] x11-proto/inputproto-1.5.0 [1.4.2.1] 57 kB<br />
[ebuild U ] x11-libs/xtrans-1.2.3 [1.0.3] USE=&#8221;-debug&#8221; 102 kB<br />
[ebuild U ] x11-proto/randrproto-1.2.2 [1.2.1] 62 kB<br />
[ebuild U ] x11-proto/xf86driproto-2.0.4 [2.0.3] 43 kB<br />
[ebuild U ] x11-proto/renderproto-0.9.3 [0.9.2] 53 kB<br />
[ebuild U ] x11-libs/libdrm-2.4.5 [2.3.0] USE=&#8221;-debug&#8221; 551 kB<br />
[ebuild N ] x11-proto/dri2proto-1.99.3 42 kB<br />
[ebuild U ] x11-libs/libXau-1.0.4 [1.0.3] USE=&#8221;-debug&#8221; 223 kB<br />
[ebuild U ] x11-proto/xextproto-7.0.4 [7.0.2] 78 kB<br />
[ebuild U ] x11-apps/rgb-1.0.3 [1.0.1] USE=&#8221;-debug&#8221; 102 kB<br />
[ebuild U ] x11-libs/libX11-1.1.5 [1.1.4] USE=&#8221;ipv6 xcb -debug&#8221; 1,548 kB<br />
[ebuild U ] x11-libs/libXext-1.0.4 [1.0.3] USE=&#8221;-debug&#8221; 259 kB<br />
[ebuild U ] x11-libs/libXrender-0.9.4 [0.9.2] USE=&#8221;-debug&#8221; 222 kB<br />
[ebuild U ] x11-libs/libXxf86vm-1.0.2 [1.0.1] USE=&#8221;-debug&#8221; 235 kB<br />
[ebuild U ] x11-libs/libXfont-1.3.4 [1.3.1-r1] USE=&#8221;ipv6 -debug&#8221; 558 kB<br />
[ebuild U ] media-libs/mesa-7.3-r1 [6.5.2-r1] USE=&#8221;nptl -debug -doc -motif -pic -xcb&#8221; VIDEO_CARDS=&#8221;-intel -mach64 -mga -none -r128 -radeon -s3virge -savage -sis (-sunffb) -tdfx -trident -via&#8221; 3,323 kB<br />
[ebuild U ] x11-apps/xauth-1.0.3 [1.0.2] USE=&#8221;ipv6 -debug&#8221; 110 kB<br />
[ebuild U ] x11-misc/xkeyboard-config-1.5 [1.1] 559 kB<br />
[ebuild U ] x11-apps/xinit-1.0.8-r4 [1.0.5-r1] USE=&#8221;hal pam -debug -minimal&#8221; 115 kB<br />
[ebuild U ] x11-drivers/xf86-input-mouse-1.4.0 [1.2.3] USE=&#8221;-debug&#8221; 286 kB<br />
[ebuild N ] x11-libs/libpciaccess-0.10.5 USE=&#8221;-debug -minimal&#8221; 255 kB<br />
[uninstall ] x11-base/xorg-server-1.3.0.0-r6 USE=&#8221;dri ipv6 nptl xorg -3dfx -debug -dmx -kdrive -minimal -sdl -xprint&#8221; INPUT_DEVICES=&#8221;keyboard mouse -acecad -aiptek -calcomp -citron -digitaledge -dmc -dynapro -elo2300 -elographics -evdev -fpit -hyperpen -jamstudio -joystick -magellan -microtouch -mutouch -palmax -penmount -spaceorb -summa -synaptics -tek4957 -ur98 -vmmouse -void -wacom&#8221; VIDEO_CARDS=&#8221;nvidia -apm -ark -chips -cirrus -cyrix -dummy -epson -fbdev -fglrx -glint -i128 -i740 (-impact) -imstt -intel -mach64 -mga -neomagic (-newport) -nsc -nv -r128 -radeon -rendition -s3 -s3virge -savage -siliconmotion -sis -sisusb (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx) -tdfx -tga -trident -tseng -v4l -vesa -vga -via -vmware -voodoo&#8221;<br />
[blocks b ] Tags cannot enclose tags x11-base/xorg-server-1.5 (<br />
晚上11：30现在已经开始更新了，希望能一次成功啥都不用改动 现场直播哦，不断更新</p>
<p>凌晨0：10分更新完了，重新生成配置文件<br />
，拷贝到/etc/Xorg里面startx启动，启动成功。但是键盘鼠标不能使用，搜索了一下需要安装 xf86-input-evdev，直接emerge xf86-input-evdev 安装好后就可以使用了。<br />
需要注意的是如果你把xdm或啥的桌面管理器添加到了启动里面，得在初始化时按I键进入交互模式，把这个给关掉，不然进去了就鼠标键盘都失灵，看你怎么加xf86-input-evdev</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/564/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wine里面玩魔兽注意事项</title>
		<link>http://www.9wy.net/archives/562</link>
		<comments>http://www.9wy.net/archives/562#comments</comments>
		<pubDate>Fri, 19 Jun 2009 01:09:19 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=562</guid>
		<description><![CDATA[1、必须将Movies文件夹重命名为_Movies,不然会黑屏 2、在启动时需要后添加参数 -opengl,如/mnt/w3/war3.exe -opengl]]></description>
			<content:encoded><![CDATA[<p>1、必须将Movies文件夹重命名为_Movies,不然会黑屏<br />
2、在启动时需要后添加参数 -opengl,如/mnt/w3/war3.exe -opengl</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/562/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决linux下nvidiactl权限不足</title>
		<link>http://www.9wy.net/archives/560</link>
		<comments>http://www.9wy.net/archives/560#comments</comments>
		<pubDate>Thu, 23 Apr 2009 01:07:56 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=560</guid>
		<description><![CDATA[转到gentoo后发现startx后经常会出现说： NVIDIA: could not open the device file /dev/nvidiactl (Permission denied). NVIDIA: Direct rendering failed; attempting indirect rendering. 的错误，原因很明显，就是权限不足，可以直接更改 /dev/nvidiactl的权限为666以上如：sudo chmod 666 /dev/nvidia* 。 我前面也是这样解决的，但是这样做有个很大的缺点：每重新启动一次就需要重新指定下权限 当然，可以使用脚本的办法来解决这个问题，每次启动后就指定权限。 但是这样是治标不治本的解决方法。到网上查了下：原来是因为使用的帐号没有加入到video用户组，直接加入用户组就可以了-_-!,好囧。sudo usermod -G wheel,video,game simon。simon是我的用户名^-^]]></description>
			<content:encoded><![CDATA[<p>转到gentoo后发现startx后经常会出现说：<br />
NVIDIA: could not open the device file /dev/nvidiactl (Permission denied).<br />
NVIDIA: Direct rendering failed; attempting indirect rendering.<br />
的错误，原因很明显，就是权限不足，可以直接更改<br />
/dev/nvidiactl的权限为666以上如：sudo chmod 666 /dev/nvidia* 。<br />
我前面也是这样解决的，但是这样做有个很大的缺点：每重新启动一次就需要重新指定下权限<br />
当然，可以使用脚本的办法来解决这个问题，每次启动后就指定权限。<br />
但是这样是治标不治本的解决方法。到网上查了下：原来是因为使用的帐号没有加入到video用户组，直接加入用户组就可以了-_-!,好囧。sudo usermod -G wheel,video,game simon。simon是我的用户名^-^</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/560/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>终于在fvwmbuttons里面swallow成功了tray</title>
		<link>http://www.9wy.net/archives/557</link>
		<comments>http://www.9wy.net/archives/557#comments</comments>
		<pubDate>Thu, 16 Apr 2009 01:06:22 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Fvwm]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=557</guid>
		<description><![CDATA[已经困扰我好几天的问题了，想在fvwm里面使用托盘，但是老是不成功，试了好几个tray程序，如trayer等，都不能完美的swallow。但是单独使用是没有问题的。但我希望能swallow到fvwmbuttons里面（因为我用的fvwmbuttons做的taskbar)。 今天再次仔细的阅读了stalonetray的man页。然后终于成功了，HOHO，非常的完美，只需要一个参数p参数就OK。表示使用父颜色。如下： *FvwmTopBar: (100&#215;25+885+0,Swallow(NoClose, UseOld)   `stalonetray` `Exec       exec stalonetray  -p`)]]></description>
			<content:encoded><![CDATA[<p>已经困扰我好几天的问题了，想在fvwm里面使用托盘，但是老是不成功，试了好几个tray程序，如trayer等，都不能完美的swallow。但是单独使用是没有问题的。但我希望能swallow到fvwmbuttons里面（因为我用的fvwmbuttons做的taskbar)。<br />
今天再次仔细的阅读了stalonetray的man页。然后终于成功了，HOHO，非常的完美，只需要一个参数p参数就OK。表示使用父颜色。如下：<br />
*FvwmTopBar: (100&#215;25+885+0,Swallow(NoClose, UseOld)   `stalonetray` `Exec       exec stalonetray  -p`)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/557/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gentoo 下面配置xorg</title>
		<link>http://www.9wy.net/archives/553</link>
		<comments>http://www.9wy.net/archives/553#comments</comments>
		<pubDate>Mon, 23 Mar 2009 01:04:09 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=553</guid>
		<description><![CDATA[Gentoo下面配置xorg是非常容易的，步骤如下： emerge xorg-x11 安装好xorg 然后 只需要Xorg -configure 一下就会自动产生xorg的配置文件，不过要注意的是产生的新配置文件是在/root里面 下一步测试新配置文件 X -config /root/xorg.conf.new 正常情况下是不会启动成功的：），因为还没安装卡的驱动 emerge nvidia-drivers （这里因为我的是n卡所以用的nvidia-drivers,根据自己的情况看） 安装显卡驱动 安装完以后再 Xorg -configure X -config /root/xorg.conf.new 看看是不是成功了呢？反正我是没成功（好事多磨哦） 看失败原因（直接会显示在屏幕上，如果你有 兴趣也可以去/var/log/里看xorg的log） Failed to load module &#8220;wfb&#8221; (module does not exist, 0) 解决方法如下： 执行 eselect opengl set nvidia 然后再 Xorg -configure X -config /root/xorg.conf.new 一下，终于成功了，看到了几个简陋的窗口 其实gentoo的文档资源是非常的丰富的，只要遇到问题你去gentoo上面查找一般都能找到howto。当然，google更是好老师，遇到问题就去Google一般都能找到答案]]></description>
			<content:encoded><![CDATA[<p>Gentoo下面配置xorg是非常容易的，步骤如下：<br />
emerge xorg-x11 安装好xorg<br />
然后 只需要Xorg -configure 一下就会自动产生xorg的配置文件，不过要注意的是产生的新配置文件是在/root里面<br />
下一步测试新配置文件<br />
X -config /root/xorg.conf.new<br />
正常情况下是不会启动成功的：），因为还没安装卡的驱动<br />
emerge nvidia-drivers （这里因为我的是n卡所以用的nvidia-drivers,根据自己的情况看）<br />
安装显卡驱动<br />
安装完以后再<br />
Xorg -configure<br />
X -config /root/xorg.conf.new</p>
<p>看看是不是成功了呢？反正我是没成功（好事多磨哦）<br />
看失败原因（直接会显示在屏幕上，如果你有 兴趣也可以去/var/log/里看xorg的log）<br />
Failed to load module &#8220;wfb&#8221; (module does not exist, 0)</p>
<p>解决方法如下：<br />
执行<br />
eselect opengl set nvidia<br />
然后再<br />
Xorg -configure<br />
X -config /root/xorg.conf.new<br />
一下，终于成功了，看到了几个简陋的窗口</p>
<p>其实gentoo的文档资源是非常的丰富的，只要遇到问题你去gentoo上面查找一般都能找到howto。当然，google更是好老师，遇到问题就去Google一般都能找到答案</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/553/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux webserver 常用维护命令</title>
		<link>http://www.9wy.net/archives/551</link>
		<comments>http://www.9wy.net/archives/551#comments</comments>
		<pubDate>Fri, 20 Mar 2009 01:03:22 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=551</guid>
		<description><![CDATA[这里是维护时常用的一些命令，放在这里，备忘 注：大部分非原创，只是收集到这里而已 * 实时查看正在执行的sql语句 1./usr/sbin/tcpdump -i eth0 -s 0 -l -w &#8211; dst port 3306 &#124; strings &#124; egrep -i &#8216;SELECT&#124;UPDATE&#124;DELETE&#124;INSERT&#124;SET&#124;COMMIT&#124;ROLLBACK&#124;CREATE&#124;DROP&#124;ALTER&#124;CALL&#8217; * 查看http连接 1.netstat -n &#124; awk &#8216;/^tcp/ {++state[$NF]} END {for(key in state) print key,&#8221;\t&#8221;,state[key]}&#8217; * 查看SYN状态的http连接 1.netstat -an &#124; grep SYN &#124; awk &#8216;{print $5}&#8217; &#124; awk -F: &#8216;{print $1}&#8217; &#124; sort &#124; uniq [...]]]></description>
			<content:encoded><![CDATA[<p>这里是维护时常用的一些命令，放在这里，备忘</p>
<p><span style="color: #ff0000;">注：大部分非原创，只是收集到这里而已</span></p>
<p>* 实时查看正在执行的sql语句<br />
1./usr/sbin/tcpdump -i eth0 -s 0 -l -w &#8211; dst port 3306 | strings | egrep -i &#8216;SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL&#8217;</p>
<p>* 查看http连接<br />
1.netstat -n | awk &#8216;/^tcp/ {++state[$NF]} END {for(key in state) print key,&#8221;\t&#8221;,state[key]}&#8217;</p>
<p>* 查看SYN状态的http连接<br />
1.netstat -an | grep SYN | awk &#8216;{print $5}&#8217; | awk -F: &#8216;{print $1}&#8217; | sort | uniq -c | sort -nr | more</p>
<p>* 查看TIME_WAIT状态的http连接<br />
1.netstat -tna | cut -b 49- |grep TIME_WAIT | sort |more<br />
2.netstat -an | grep TIME_WAIT | awk &#8216;{print $5}&#8217; | awk -F: &#8216;{print $1}&#8217; | sort | uniq -c | sort -nr | more</p>
<p>* 查看ESTABLISHED状态的http连接<br />
1.netstat -an | grep ESTABLISHED | awk &#8216;{print $5}&#8217; | awk -F: &#8216;{print $1}&#8217; | sort | uniq -c | sort -nr | more<br />
2.netstat -an | grep &#8220;:80&#8243; | grep ESTABLISHED | sort | more</p>
<p>* 批量kill进程<br />
1.ps -efww|grep sqlr-listener|grep -v grep|cut -c 9-15|xargs kill -9</p>
<p>* 查看活动的php-cgi连接数<br />
1.netstat -anpo|grep php-cgi|wc -l</p>
<p>* 按ip查看httpd连接数<br />
1.netstat -anlp | grep 80 | grep tcp | awk {&#8216;print $5&#8242;} | awk -F: {&#8216;print $1&#8242;}| sort |uniq -c | sort -nr</p>
<p>* 禁IP<br />
1.iptables -A INPUT -s IP地址 -j REJECT<br />
2.iptables -A INPUT -s IP地址/24 -j REJECT<br />
3.route add -net IP地址 netmask 255.255.255.0 reject</p>
<p>* 调试命令<br />
1.strace -p pid</p>
<p>* 跟踪指定的进程pid.<br />
1.gdb -p pid</p>
<p>* 跟踪指定的进程pid.</p>
<p>* 批量查找文件并删除<br />
1.find . -name test.php -exec rm {} \;<br />
2.find . -name test.php | xargs rm -rf</p>
<p>* 更改某一目录下所有目录的权限, 不包括文件, aaa 是目录名<br />
1.find aaa -type d -exec chmod 755 {} \;</p>
<p>* 替换文件内容<br />
1.sed -i &#8216;s/b/strong/g&#8217; index.html</p>
<p>此命令搜索 index.html 文件中的 b 并将其替换为 strong。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/551/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>调整SSHD的启动优先级别</title>
		<link>http://www.9wy.net/archives/548</link>
		<comments>http://www.9wy.net/archives/548#comments</comments>
		<pubDate>Fri, 20 Mar 2009 01:00:57 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CMD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=548</guid>
		<description><![CDATA[在实际的服务器使用中，我们经常遇到的一个情况就是服务器无响应，有可能是由于apache或者是mysql等服务过载造成服务器无响应。九王爷就遇到过几次这种情况，好几次说服务器没响应，ssh也上不去，只好请机房的人员帮助重启机器。重启机器后发现log等服务还是在运行的，也就是说服务器不是真的死机了，而是反应不过来，如果当时能ssh上去看看的话就能找到原因了。所以希望能在apache等没反应以后还能ssh上服务器 这就需要将ssh的运行优先级给调高一些，而我又是个懒人，希望能每次重启后自动的就把优先级给调整了。查看sshd_conf里面没有相应的选项，就只好在启动脚本里面打主意了。 查看启动脚本/etc/init.d/sshd ，修改里面的 $SSHD $OPTIONS &#38;&#38; success &#124;&#124; failure 为 nice -n -2 $SSHD $OPTIONS &#38;&#38; success &#124;&#124; failure 使用-2优先级是希望sshd服务的优先级高于apache等的0，但低于log等的-5 sudo /etc/init.d/sshd restart 一下，然后 ps -aeo cmd,pid,nice &#124;grep sshd 看下优先级是不是变成-2了呢？]]></description>
			<content:encoded><![CDATA[<p>在实际的服务器使用中，我们经常遇到的一个情况就是服务器无响应，有可能是由于apache或者是mysql等服务过载造成服务器无响应。九王爷就遇到过几次这种情况，好几次说服务器没响应，ssh也上不去，只好请机房的人员帮助重启机器。重启机器后发现log等服务还是在运行的，也就是说服务器不是真的死机了，而是反应不过来，如果当时能ssh上去看看的话就能找到原因了。所以希望能在apache等没反应以后还能ssh上服务器<br />
<span><br />
这就需要将ssh的运行优先级给调高一些，而我又是个懒人，希望能每次重启后自动的就把优先级给调整了。查看sshd_conf里面没有相应的选项，就只好在启动脚本里面打主意了。<br />
查看启动脚本/etc/init.d/sshd ，修改里面的<br />
$SSHD $OPTIONS &amp;&amp; success || failure<br />
为<br />
nice -n -2 $SSHD $OPTIONS &amp;&amp; success || failure<br />
使用-2优先级是希望sshd服务的优先级高于apache等的0，但低于log等的-5</p>
<p>sudo /etc/init.d/sshd restart<br />
一下，然后<br />
ps -aeo cmd,pid,nice |grep sshd<br />
看下优先级是不是变成-2了呢？</p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/548/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
