<?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.isallan.com/index.php/archives/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.isallan.com</link>
	<description></description>
	<lastBuildDate>Wed, 19 May 2010 18:00:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>修复了被损坏的/bin/ls</title>
		<link>http://www.isallan.com/index.php/archives/442</link>
		<comments>http://www.isallan.com/index.php/archives/442#comments</comments>
		<pubDate>Wed, 10 Mar 2010 08:03:05 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=442</guid>
		<description><![CDATA[系统被黑一次，ls被人搞了，也不是完全不能用，只不过参数h挂掉了。。
[root@vm2 bin]# ls -alh
ls: invalid option &#8212; h
Try `ls &#8211;help&#8217; for more information.
实在懒得管他纵容丫活到现在。。现在是在不能忍了。修复之。懒得找源文件编译，yum install之
先找：
[root@vm2 bin]# yum provides /bin/ls
Searching Packages:
Setting up repositories
Reading repository metadata in from local files
coreutils.i386                           5.2.1-36.el4.centos  [...]]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/442/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>转译：exim on centos</title>
		<link>http://www.isallan.com/index.php/archives/427</link>
		<comments>http://www.isallan.com/index.php/archives/427#comments</comments>
		<pubDate>Wed, 27 Jan 2010 07:24:43 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[it]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=427</guid>
		<description><![CDATA[原文地址：http://www.jervis.ws/2008/03/17/exim-on-centos/
这是我总结的在centos平台安装和基础配置exim快捷手册。这不是一份完整的手册，但是马马虎虎能指引你上路=D。依据这份手册，你可以搞定exim的安装以及使用
我将假设你使用centos4/5平台，yum正常工作并且可以用root登录
首先保证更新
yum update
安装exim以及邮件管理工具
yum install exim
yum install system-switch-mail
把exim设置成开机启动
system-switch-mail
service sendmail stop
service exim start
chkconfig exim on
chkconfig sendmail off
添加一个root别名，类似于: “root: me@example.com”
vi /etc/aliases
同时，你也许希望像这样添加一些配置给你的路由部分，如果你喜欢通过智能host做中转的话
vi /etc/exim/exim.conf
然后在“dnslookup:”section.之前添加这些
to_smart_host:
driver = manualroute
domains = ! +local_domains
transport = remote_smtp
route_list = “* mail1.example.com:mail2.example.com;”
重启exim
service exim restart
发一封邮件来测试
echo “test” &#124;mail -s “$HOSTNAME” me@example.com
之后，你可以刷新Exim Que 并且像这样查看日志
exim -qff ; tail -f /var/log/exim/main.log
好运吧
]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/427/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>转帖译文</title>
		<link>http://www.isallan.com/index.php/archives/396</link>
		<comments>http://www.isallan.com/index.php/archives/396#comments</comments>
		<pubDate>Fri, 20 Nov 2009 08:11:05 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=396</guid>
		<description><![CDATA[1. 在shell中用root登录服务器
2. 進入mysql目录 (linux Server):
代码:
cd /var/lib/mysql/
3. 利用mysql自带的mysqldump功能dump一下原有的latin1编码的数据库:
代码:
mysqldump &#8211;user=username &#8211;password=password &#8211;default-character-set=latin1  &#8211;skip-set-charset dbname > dump.sql
4. 把数据库数据从latin1转换成utf-8编码:
代碼:
      sed  -r &#8217;s/latin1/utf8/g&#8217; dump.sql > dump_utf.sql
5. 创建新的urf-8新数据库:
代码:
       mysql &#8211;user=username &#8211;password=password &#8211;execute=&#8221;DROP DATABASE dbname;  CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;&#8221;
6. 以正确编码导入转码后的数据库数据:
代码:
     [...]]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/396/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RAR的linux版本</title>
		<link>http://www.isallan.com/index.php/archives/199</link>
		<comments>http://www.isallan.com/index.php/archives/199#comments</comments>
		<pubDate>Mon, 11 Jun 2007 06:39:32 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=199</guid>
		<description><![CDATA[以前遇到.rar文件,通常都是传到windows机器里面解压然后传回去.今天偶然间发现rar原来是有linux版本的.点击去下载页
不过不知道为什么我没弄成.-_-#
等有时间研究一下
]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/199/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>again杂记</title>
		<link>http://www.isallan.com/index.php/archives/185</link>
		<comments>http://www.isallan.com/index.php/archives/185#comments</comments>
		<pubDate>Tue, 17 Apr 2007 06:16:28 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=185</guid>
		<description><![CDATA[1.bind的配置文件里面#号是不能作为注释的,bind会无视#后面所有的内容
2.named-checkconf  和named-checkzone两个命令可以检查bind配置文件是否有问题
3.我的firefox不知道为什么打开之后就占去所有的cpu资源.重装无效,试图修改配置文件,无效.最后的解决方法是在系统中新建一个用户,把新用户的C:\Documents and Settings\***\Application Data\Mozilla\Firefox拷贝到原来用户相应位置,问题解决,cp回来原来的收藏,问题搞定!
]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/185/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VI..用于备份</title>
		<link>http://www.isallan.com/index.php/archives/181</link>
		<comments>http://www.isallan.com/index.php/archives/181#comments</comments>
		<pubDate>Tue, 03 Apr 2007 05:53:02 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=181</guid>
		<description><![CDATA[一、简介
Vi命令可以说是Unix/Linux世界里最常用的编辑文件的命令了，很多人不喜欢VI因为它 的众多的命令集，但是我们只需要掌握基本的命令然后灵活地加以运用，相信你会象我一样喜欢它的。 本文旨在更有条理有归纳性地介绍VI的一些最常用命令和一些高级的应用。
二、基本命令介绍
1) 光标命令
k,j,h,l——上下左右光标移动命令，虽然你可以在Linux中使用键盘右边的四个光标键， 但是记住这四个命令还有非常有用的，也就是右手在键盘上放置的位置部分。
nG ——n为行数，该命令立即使光标跳到指定行。
Ctrl+G——光标所在位置的行数和列数报告。
w,b——使光标向前或向后跳过一个单词。
2) 编辑命令
i,a,r——在光标的前,后,上方插入字符命令(i=insert,a=append,r=replace)。
cw,dw——改变(置换)/删除光标所在处的单词的命令 (c=change,d=delete)。
x,d$,dd——删除一个字符，光标所在处到行尾的所有字符，和整行的命令。
3) 查找命令
/string,string——从光标所在处向后/向前查找相应的字符串的命令。
4)拷贝复制命令
yy,p ——拷贝一行到剪贴板/取出剪贴板中内容的命令。
三、常见问题及应用技巧
1) 在一个新文件中读/etc/passwd中的内容，取出用户名部分
vi file
:r /etc/passwd 在打开的文件file中光标所在处读入/etc/passwd。
:%s/:.*//g 删除/etc/passwd中用户名后面的从冒号开始直到行尾的所有部分。
:3r /etc/passwd 这是在指定的行号后面读入文件内容。
另外一种方法删掉文件中所有的空行及以#开始的注释行。
#cat squid.conf.default &#124; grep -v &#8216;^$&#8217; &#124; grep -v &#8216;^#&#8217;
2) 在打开一个文件编辑后才知道登录的用户对该文件没有写权，不能存盘。
vi file
:w /tmp/1 既然没法存盘，不想放弃所做的所有修改，先临时存到/tmp/1。
:20,59w /tmp/1 或者仅仅把第20到59行之间的内容存盘成文件/tmp/1。
3) 用VI编辑一个文件，但需要删除大段大段的内容。
vi file
Ctrl+G 把光标移到需要删除的行的处按ctrl+G显示行号，再到结尾处再按Ctrl+G。
:23,1045d 假定两次行号为23和1045，则把这几间的内容全删除。 也可以在开始和结束两行中用ma,mb命令标记后用:&#8217;a,&#8217;bd删除。
4) 在整个文件或某几行中在行首或行尾加一些字符串
vi file
:3,$s/^/some string /
在文件的第一行至最后一行的行首前插入some string。
:%s/$/ some string/g 在整个文件每一行的行尾添加 some string。
:%s/string1/string2/g 在整个文件中替换string1成string2。
:3,7s/string1/string2/ 仅替换文件中的第三到七行中的string1成string2。
Note: s为substitute,%表示所有行,g表示global。
5) 同时编辑两个文件,在两个文件中拷贝剪贴文本
vi file1 file2
yy 同时打开两个文件,在文件1的光标所在处拷贝所在行。
:n 切换到文件2 [...]]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/181/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware Server 的安装说明</title>
		<link>http://www.isallan.com/index.php/archives/173</link>
		<comments>http://www.isallan.com/index.php/archives/173#comments</comments>
		<pubDate>Fri, 02 Mar 2007 09:44:24 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[it]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=173</guid>
		<description><![CDATA[VMware Server 现在是一个免费软件（freeware），只不过配置的某个步骤需要 SN，SN 是可以在 vmware.com 上免费申请的，我一次就申请了 100 个。:)
因为 VMware 需要加载内核模块，所以其 Linux 版本支持的操作系统数目是有限的，从说明看，host 操作系统推荐是 SUSE Linux 10.1 或 Ubuntu 6.x，Red Hat Enterprise Linux 3.0 Update 8 和 Red Hat Enterprise Linux 4.0 Update 4 也能工作，现在我们是在 CentOS 4.3 上安装的，看起来似乎一切良好。
安装：rpm -i VMware-server-1.0.0-28343.i386.rpm
执行 /usr/bin/vmware-config.pl 进行配置
基本上一路回车下来，最后输入 SN，然后服务就自动启动了.
以后可以通过 /etc/init.d/vmware start/stop 来维护
下面就是安装 VMware-server-console，有 linux 版本（要求 gtk 环境），也有windows版本。server-console 是连接 server 进行管理的，比如创建虚拟机这样的活动。我们的 host [...]]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/173/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>转载：如何在Linux 修复系统的 MBR</title>
		<link>http://www.isallan.com/index.php/archives/160</link>
		<comments>http://www.isallan.com/index.php/archives/160#comments</comments>
		<pubDate>Mon, 27 Nov 2006 05:52:17 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=160</guid>
		<description><![CDATA[1, MBR 总共有 512 个字节，前面446个字节是一个最简单的 boot loader，这个boot loader 的任务很简单，就是将第一个要启动的分区的第一个扇区装入内存。boot loader 之后64个字节是分区表，最后两个字节是 0&#215;55AA.
2, M$ dos 下的 fdisk /mbr 命令就是将 M$ 的boot loader 写入 MBR 的前 446 个字节。M$ 的位于 mbr 的 boot loader 是根据分区的 activity 信息来决定装入哪个分区的。
3, Linux 的 grub-install /dev/hda 也会将自身的 stage1 内容写入 MBR 的前 446 个字节。实际上 grub 是一个很大的 boot loader，不可能全部放在 MBR 的 446 个字节里面，其他内容放在 /boot/grub 下面（debian [...]]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/160/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVS基本配置（转）</title>
		<link>http://www.isallan.com/index.php/archives/103</link>
		<comments>http://www.isallan.com/index.php/archives/103#comments</comments>
		<pubDate>Wed, 31 May 2006 02:28:51 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=103</guid>
		<description><![CDATA[简单术语：
Director：前端负载均衡器，运行lvs，目前只能为Linux，针对FreeBSD刚刚出来，性能不知道如何。可以针对web、ftp、cache、mms甚至mysql等服务做loadbalance。
RealServer：后段需要负载均衡的服务器，可以为各类系统，Linux、Solaris、Aix、BSD、Windows都可，甚至Director本身也可以作为RealServer使用
过完春节一直忙的稀里糊涂，脑袋一直转的太快，下午暂时有点空闲，正好最近N多朋友要做web 方式下的负载均衡，简单描述一下lvs的设置（不涉及HA、Mult-homing），当做大脑休息好了:p
lvs Linux Virtual Server，Linux下的负载均衡器，不多作介绍了，跟DNS轮询以及一些商业产品的比较等不做论述，具体看看LVS网站，支持LVS-NAT、 LVS-DR、LVS-TUNL三种不同的方式，nat用的不是很多，这里简单介绍一下DR、TUNL方式。
DR方式适合所有的RealServer同一网段下，即接在同一个交换机上
TUNL方式就RealServer可以任意了，完全可以跨地域、空间，只要系统支持Tunnel就成（Win2k3好像已经不支持了……）
方便以后扩充的话直接Tunl方式即可
Director系统为RHEL3＋ClusterSuite（偶是懒人，懒得打kernel patch了:p）
RealServer系统为Rhel3＋noarp补丁
Director设置：
需要在Director设置的就是/etc/sysconfig/ha/lvs.cf，以及安装ClusterSuite后启动pulse服务（Redhat的lvs服务，当然也可以手动），下面是一个简单的lvs设置（没有设置director HA），man lvs.cf看看详细设置，RHEL3里已经有了详细的手册
203.x.x.a为Director公网ip地址
203.x.x.b为需要Loadbance的域名的Ip地址
203.x.x.c 为第一个RealServer
203.x.x.d为第二个RealServer
#cat /etc/sysconfig/ha/lvs.cf
serial_no = 45
primary = 203.x.x.a
service = lvs
rsh_command = ssh
backup_active = 0
backup = 0.0.0.0
heartbeat = 1
heartbeat_port = 539
keepalive = 10
deadtime = 20
network = direct（Tunl方式改为tunnel）
nat_nmask = 255.255.255.255
reservation_conflict_action = preempt
debug_level = NONE
virtual www.test.com {
active = 1
address = 203.x.x.b eth0:0
vip_nmask = 255.255.255.255
port = 80
send = “GET / HTTP/1.0\r\n\r\n”
expect = [...]]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/103/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>升级2。6的内核</title>
		<link>http://www.isallan.com/index.php/archives/89</link>
		<comments>http://www.isallan.com/index.php/archives/89#comments</comments>
		<pubDate>Sat, 15 Apr 2006 09:06:25 +0000</pubDate>
		<dc:creator>allan</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.isallan.com/?p=89</guid>
		<description><![CDATA[要关掉
/etc/selinux/config 中的enforcing
谁知道这是个什么参数？
]]></description>
		<wfw:commentRss>http://www.isallan.com/index.php/archives/89/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
