2009年4月29日

出来混,迟早要还

原来,学历是我混得不好的证据。

昨天,腾讯在广州举行一个现场招聘会。而我又没头没脑的闯了进去,直递简历给面试官看了几MS,就说了一句雷我的话:“你是专科的啊,不好意思,我们要求的最低学历是本科。”

请问,面试官在怪我当初为什么不好好学习吗??

身体敏捷

从前,我只以为我身手敏捷,直至今天,我才发现,我不止身手敏捷,还有就是身体敏捷,竟然可以用身体把蚊子压死!!!

证据: 我穿来睡觉的衣服上留下的血;拿去验检的话肯定是ABC型的,因为我的血型就是ABC型的。

注:绝对不是我自己流的,因为血在衣服的外表,并没渗入到内表,SO..............

顿时,我佩服我自己!

2009年4月22日

vim

vim选择一个文件里的全部内容:

ggVG

使用替代命令:

%s/old/new/g

是%s而不是s,其中g是全局的简写!

快速到达某一行

在可视模式下直接按行数加回车就行了

lighttpd支持PHP

今天用top查看进程,发现里面多了几个php-cgi进程,我还惊讶了一会,还以为开了apache,不过想了一下,我只是开了lighttpd,难道它支持了php??之前我试了不过还没算支持啊,难道一reboot真的那么神奇!于是我写了一个简单的php网页,试下了,果真支持了!!
我的lighttpd的配置如下:

# lighttpd configuration file
#
# use it as a base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

############ Options you really have to take care of ####################

## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules = (
"mod_rewrite",
# "mod_redirect",
# "mod_alias",
"mod_access",
# "mod_cml",
# "mod_trigger_b4_dl",
"mod_auth",
# "mod_status",
# "mod_setenv",
"mod_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
"mod_cgi",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog" )

## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/home/minix/data"

## where to send error-messages to
server.errorlog = "/var/log/lighttpd.error.log"

# files to check for if .../ is requested
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )

## set the event-handler (read the performance section in the manual)
server.event-handler = "freebsd-kqueue" # needed on OS X

# mimetype mapping
mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jar" => "application/x-java-archive",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar",
# default mime type
"" => "application/octet-stream",
)

# Use the "Content-Type" extended attribute to obtain mime type if possible
#mimetype.use-xattr = "enable"


## send a different Server: header
## be nice and keep it at lighttpd
# server.tag = "lighttpd"

#### accesslog module
accesslog.filename = "/var/log/lighttpd.access.log"

## deny access the file-extensions
#
# ~ is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
# of the document-root
url.access-deny = ( "~", ".inc" )

$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}

##
# which extensions should not be handle via static-file transfer
#
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

######### Options that are good to be but not neccesary to be changed #######

## bind to port (default: 80)
server.port = 80

## bind to localhost (default: all interfaces)
#server.bind = "127.0.0.1"

## error-handler for status 404
#server.error-handler-404 = "/error-handler.html"
#server.error-handler-404 = "/error-handler.php"

## to help the rc.scripts
server.pid-file = "/var/run/lighttpd.pid"


###### virtual hosts
##
## If you want name-based virtual hosting add the next three settings and load
## mod_simple_vhost
##
## document-root =
## virtual-server-root + virtual-server-default-host + virtual-server-docroot
## or
## virtual-server-root + http-host + virtual-server-docroot
##
#simple-vhost.server-root = "/srv/www/vhosts/"
#simple-vhost.default-host = "www.example.org"
#simple-vhost.document-root = "/htdocs/"


##
## Format: .html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/usr/share/lighttpd/errors/status-"
#server.errorfile-prefix = "/srv/www/errors/status-"

## virtual directory listings
#dir-listing.activate = "enable"
## select encoding for directory listings
#dir-listing.encoding = "utf-8"

## enable debugging
#debug.log-request-header = "enable"
#debug.log-response-header = "enable"
#debug.log-request-handling = "enable"
#debug.log-file-not-found = "enable"

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"

## change uid to (default: don't care)
server.username = "www"

## change uid to (default: don't care)
server.groupname = "www"

#### compress module
#compress.cache-dir = "/var/cache/lighttpd/compress/"
#compress.filetype = ("text/plain", "text/html")

#### proxy module
## read proxy.txt for more info
#proxy.server = ( ".php" =>
# ( "localhost" =>
# (
# "host" => "192.168.0.101",
# "port" => 80
# )
# )
# )

#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" =>
( "OS.minix.org" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php-cgi"
)
)
)

#### CGI module
#cgi.assign = ( ".pl" => "/usr/bin/perl",
# ".cgi" => "/usr/bin/perl" )

#cgi.assign = ( "/cgi-bin/openwebmail/openwebmail.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-abook.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-advsearch.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-cal.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-folder.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-main.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-prefs.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-read.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-saprefs.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-send.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-spell.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-tool.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-vdomain.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-viewatt.pl" => "",
# "/cgi-bin/openwebmail/openwebmail-webdisk.pl" => "" )

#### SSL engine
#ssl.engine = "enable" ## read authentication.txt for more info
#ssl.pemfile = "/etc/ssl/private#auth.backend = "plain"
#auth.backend.plain.userfile = "lighttpd.user"
#### status module #auth.backend.plain.groupfile = "lighttpd.group"
#### auth module
#status.status-url = "/server-status"
#status.config-url = "/server-config" #auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
#auth.backend.ldap.filter = "(uid=$)"

#auth.require = ( "/server-status" =>
# (
# "method" => "digest",
# "realm" => "download archiv",
# "require" => "user=jan"
# ),
# "/server-config" =>
# (
# "method" => "digest",
# "realm" => "download archiv",
# "require" => "valid-user"
# )
# )

#### url handling modules (rewrite, redirect, access)
#url.rewrite = ( "^/$" => "/server-status" )
#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
#### both rewrite/redirect support back reference to regex conditional using %n
#$HTTP["host"] =~ "^www\.(.*)" {
# url.redirect = ( "^/(.*)" => "http://%1/$1" )
#}

#
# define a pattern for the host url finding
# %% => % sign
# %0 => domain name + tld
# %1 => tld
# %2 => domain name without tld
# %3 => subdomain 1 name
# %4 => subdomain 2 name
#
#evhost.path-pattern = "/srv/www/vhosts/%3/htdocs/"

#### expire module
#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")

#### ssi
#ssi.extension = ( ".shtml" )

#### rrdtool
#rrdtool.binary = "/usr/bin/rrdtool"
#rrdtool.db-name = "/var/lib/lighttpd/lighttpd.rrd"

#### setenv
#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
#setenv.add-response-header = ( "X-Secret-Message" => "42" )

## for mod_trigger_b4_dl
# trigger-before-download.gdbm-filename = "/var/lib/lighttpd/trigger.db"
# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
# trigger-before-download.trigger-url = "^/trigger/"
# trigger-before-download.download-url = "^/download/"
# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
# trigger-before-download.trigger-timeout = 10

## for mod_cml
## don't forget to add index.cml to server.indexfiles
# cml.extension = ".cml"
# cml.memcache-hosts = ( "127.0.0.1:11211" )

#### variable usage:
## variable name without "." is auto prefixed by "var." and becomes "var.bar"
#bar = 1
#var.mystring = "foo"

## integer add
#bar += 1
## string concat, with integer cast as string, result: "www.foo1.com"
#server.name = "www." + mystring + var.bar + ".com"
## array merge
#index-file.names = (foo + ".php") + index-file.names
#index-file.names += (foo + ".php")

#### include
#include /etc/lighttpd/lighttpd-inc.conf
## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
#include "lighttpd-inc.conf"

#### include_shell
#include_shell "echo var.a=1"
## the above is same as:
#var.a=1

# Enable IPV6 and IPV4 together
#server.use-ipv6 = "enable"
#$SERVER["socket"] == "0.0.0.0:80" { }

难道和将php.ini-dist改为php.ini有关??

还有一个问题是:怎样使用lighttpd支持perl??

2009年4月21日

狗才是语言专家

今天在回来的路上,看到一个阿姨对着一个宠物狗用粤语说:“过来”。那宠物狗真的向那位阿姨走了过去。我也曾看过有人分别用普通话和英语对着狗使用一些简单的命令,狗也真的服从了。我相信用其它国家的语言狗也会听的。突然想到,狗是精通各国语言的动物,它们才是语言专家!!

2009年4月20日

奢侈

今天太奢侈了,还没找到工作,吃饭钱都要家里给。竟然和两个朋友一起去了长隆的水上乐园玩,因为是刚重开的,所以门票打了个五折,不过还得要90块啊!!这个数字让我的心痛了一会!!
今天玩了三个项目和泡了一个凉水。第一个玩的是在水池里泡水,泡了很久,有一个遗憾就是:不会游泳,而且还是第一次在水池里玩。
然后的三个项目就不会怎样表达了,总之挺刺激的。还有几个好玩的没有玩到啊,有机会一定要玩完剩下的!
这是有生以来第一次去玩这个,觉得不够的是:
没短裤。只能穿着泳裤左串右串。
没拖鞋。赤着脚很不爽,我的脚都快起泡了。
没浴巾。泡完水后坐在椅子里都快冻死了,加上有一点感冒,真的很惨的没浴巾啊!!
有了这次教训也好,等到下次就不会那么狼狈了!

总之,今天真的很好玩,很开心!!

2009年4月19日

mailman在FreeBSD下的安装和使用

下面这篇文章是我在kingsoft里最有贡献的一件事了!当时老大叫我构建内部邮件列表服务来作为试用期的考核。我记得这个任务花了几个星期的时间来搞好!浪费时间的地方就是我太死板和知识缺乏啊!!

先说一下自己对邮件列表的理解:
邮件列表就类似于论坛,不过它与论坛最大的不同就是,它是通过邮件来发表主题和回复的。它和google group差不多吧

今天在CU的BLOG里看到了这篇文章,感触良多!所以把它搬过来,让思念的地方再多一处!!

下面就是内容:

在安装配置过程中,按顺序来是一种很好的习惯!

我认为邮件列表的 工作流程是(mailman可以说是一个MDA(邮件传递代理(Mail Delivery Agent)):

大体上是:

mailmanelements.png #这里本来是用mind画的一幅图,用于让我表达我对邮件列表的工作流程的理解,我把这图保存到了gmail,不过现在这个目录打不开了,so

对以上的这幅图我的理解是:第一次用户通过Email地址来通过订阅邮件列表,而postfix作为邮件服务来接收发到这个地址的邮件然后交到mailman,mailman就通过postfix来给这些Email地址发送确认信。Email地址点击确认后mailman就把这些Email地址存到Manage User Email add里面去。第二次,第三次。。。当用户要把信息分享给其它的Email的时候,它只须要将信发给Mailman这个地址,mailman就从Manage User Email addr里取出其它Email地址然后通过postfix服务来进行转发。同时,它也将这个信息放到Archive里面去以便以后查看。

以下就是安装和配置mailman的过程:

平台

FreeBSD-7.0-release

软件

邮件服务器:

postfix-2.5.5,1

邮件列表服务器:

mailman-2.1.11

web服务器:

apache-2.2.6_2

安装过程

我是通过ports来安装mailman(不过在安装mailman的同时也要安装postfix邮件服务)

cd /usr/ports/mail/mailman
make install clean #在弹出的对话框中选择CHINESE and POSTFIX,我的做法
#是让postfix和mailman结合

postfix:

cd /usr/ports/mail/postfix
make config
make install

在postfix中, 最重要的文件就是main.cf and master.cf

在freebsd下,有一个在系统安装后就会自带的一个邮件服务了,叫做sendmail.为什么它会出现在freebsd安装完成之后就有了?

这里有一个说法:

sendmail是FreeBSD上的标准邮件传输代理(Mail Transport Agent, MTA -- 不过又有人说MTA是 messages Transport Agent)!

那为什么要用postfix来替代sendmail呢??因为sendmail的单体式结构已成为许多安全隐患的主因,而且难以配置和维护。而 postfix的目标是可靠性,安全性效率,灵活性,容易使用,可兼容sendmail,这样就成就了postfix替换sendmail的一个很好的理由。

配置postfix:

我们现在要把sendmail替换成postfix,所做的工作是:

#vim /etc/rc.conf

加入:

sendmail_enable="YES"
sendmail_flags="-bg"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

安装完成后必须要修改的地方:

#vim /usr/local/etc/postfix/main.cf

修改以下两句话:

myhostname = YOUR_DOMAIN
mydomail = YOUR_DOMAIN

还在一个是:

/usr/loca/sbin/postalias /etc/aliases # 产生aliases.db文件,如果没有的话postfix会启动,控制台下会出现错误信息

启动postfix服务:

#/usr/local/etc/rc.d/postfix start

上面就是简单的安装postfix的过程。其实,邮件服务器的安装配置并不是这么简单!!这里只是用来作为一个平台和还没细化它才会这样的!

配置mailman,使mailman和postfix结合:

(在这里我套用的mailman源码目录下的doc/mailman-install.txt文件,在任何情况下,源码目录下的安装或配置文件都是最好的,最全的)

安装完mailman后,最好进行以下的一个命令:

# $PREFIX/bin/check_perms -f # 它能检测到mailman的完整性并加以修复!

改变归档目录下的各个目录的权限

# cd /archives
# chown private
# chmod o-x private

接下来就是配置WEB服务器让它支持WEB上的mailman(用Apache WEB服务器):

在文件/usr/local/etc/apache22/httpd.conf中添加如下内容。

ScriptAlias /mailman "/usr/local/mailman/cgi-bin/"
Alias /pipermail /usr/local/mailman/archives/public/

Options FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all


整合Postfix和mailman

在main.cf里加入

recipient_delimiter = + # Using "+" as the delimiter works well with the default values for
# VERP_FORMAT and VERP_REGEXP in Defaults.py.
unknown_local_recipient_reject_code = 550

在mailman的配置文件mm_cfg.py里加入

MTA = 'Postfix' # The MTA variable names a module in the Mailman/MTA directory which
# contains the mail server-specific functions to be executed when a
# list is created or removed.

执行命令:

% cd /usr/local/mailman
% bin/genaliases #initialize your aliases file.

创建aliases和virtual-mailman文件,当mailman创建邮件列表名的时候,所有的邮件地址都会写到里面去!

touch /usr/local/mailman/data/aliases

touch /usr/local/mailman/data/virtual-mailman

产生DB文件

/usr/local/sbin/postalias /usr/local/mailman/data/aliases

/usr/local/sbin/postmap /usr/local/mailman/data/virtual-mailman

修改这些文件的权限

% su
% chown mailman:mailman data/aliases*
% chmod g+w data/aliases*

配置postfix的配置文件main.cf,加入:

alias_maps=hash:/etc/aliases, hash:/usr/local/mailman/data/aliases

virtual_alias_maps = hash:/usr/local/mailman/data/virtual-mailman

配置mailman的配置文件mm_cfg.py,加入:

POSTFIX_STYLE_VIRTUAL_DOMAINS = ['DOMAIN']
MTA = 'Postfix'
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['YOUR_DOMAIL']
add_virtualhost('ALIAS1_YOUR_DOMAIL','ALIAS2_YOUR_DOMAIL') # 当不想使用虚拟域名的话,您可把VIRTUAL_HOST_OVERVIEW = off写到 mm_cfg.py中
DEFAULT_EMAIL_HOST = 'YOUR_DOMAIL'
DEFAULT_URL_HOST = 'YOUR_DOMAIL'
DEFAULT_SERVER_LANGUAGE = 'zh_CN' # 这里是把服务语言改为zh_CN,如果不写这句,它会默认变成英文

创建一个邮件列表,默认要得先创建一个名为mailman的邮件列表,如果您不想用mailman作为一个邮件列表的话,那可在mailman的配置文件里加入:MAILMAN_SITE_LIST = '您的邮件列表名'

% bin/newlist mailman
% bin/config_list -i data/sitelist.cfg mailman

创建密码:这密码创建和管理所有的邮件列表的

% $prefix/bin/mmsitepass


这是管理您创建的邮件列表的密码

% $prefix/bin/mmsitepass -c

* 以上就是我在FreeBSD下配置mailman和postfix结合的过程,也是在mailman/doc/mailman-install.txt下拿过来用的,如果你想安装一个mailman邮件列表而又不想出很多错误的话,我建议您去看下这个完整的配置文件吧。 其实,配置过程真的就只有这么多了,启动mailman后应该可能通过Web界面来对它进行订阅了。如果您在外部域名,您应该可以正常地使用mailman 的一般功能了。

* mailman的默认配置在Defaules.py文件里,如果你想改变mailman的话,那就请参考这个文件,然后将您要修改的参数放到mm_cfg.py里吧。

在发送过程中出现过的问题:

* 邮件无法发送出去,提示错误信息:"Domain of sender ADD address don't exist"
o 原因是:当你在mailman/Mailman/mm_cfg.py中的add_virtual()一行中如果填入未注册的域名的时候,mailman无法解析域名。
o 还有当创建列表后在列表管理中的“列表发送邮件时使用的主机名”一行中,它会自动填入mailman/Mailman/mm_cfg.py中的最后一个域名,这就造成了邮件只能从本地发送和接收了
o 解决方法 1:
1. 在mailman/Mailman/mm_cfg.py中的add_virtual一行写入已注册的域名
2. 在列表管理中的“列表发送邮件时使用的主机名”改为邮件服务器上已注册的域名!
o 解决方法2:
+ 在mmcfg.py里加入:

VIRTUAL_HOST_OVERVIEW = off

+ 也可以解决这个问题
* 启动mailman的时候出现 "missing the site : mailman"
原因是:mailman一启动就读取邮件列表,而它默认的首个邮件列表是mailman。当您不想使用mailman作为邮件列表的话,那就在mm_cfg.py文件里加入:

MAILMAN_SITE_LIST = '您的邮件列表名'

* 改变各种提示信息:
当您不想使用mailman自带的各种提示信息(在mailman/templates目录下),那是可能自己定制的。创建mailman/lists /<您的邮件列表>/zh_CN(您的语言),复制mailman/templates目录下的zh_CN的所有文件到这个目录里,然后再进行编辑。默认的,mailman会先读取邮件列表里的任何内容,再去往外读取。而mailman/templates目录里的内容是作为全局的邮件列表的提示信息,它会最后才被读取。
* 复制旧的归档文件到新的列表的方法:
o 当您想在新的邮件列表中显示之前的旧的归档文件的方法如下:

复制mailman/archives/private/OLDLIST.mbox/OLDLIST.mbox 到mailman/archives/private/NEWLIST.mbox/NEWLIST.mbox

改善中文

mailman的页面显示中文的文件是mailman/messages/zh_CN/LC_MESSAGES/mailman.po。在已编译安装好的mailman的 mailman/messages/zh_CN/LC_MESSAGES/目录下会有mailman.po和mailman.mo两个文件。不过有 mailman源码中只有mailman.po文件。这文件就是英文与中文的对照翻译,也是当页面显示中文时的显示结果。当您想在安装好的mailman 中修改mailman.po文件是无法生效的,即使重启mailman。因为在编译时mailman将该文件的设置编译成了mailman.mo文件了,页面只读取mailman.mo里面的内容,而mailman.ml又是一个不知道格式编码的乱码文件,又无法重装mailman的时候.

有两个可以解决的办法:

* 第一个解决办法是(也是最笨的办法):
* 打包备份好已编译的mailman/messages目录
* 下载同一版本的mailman源码
* 在源码目录下通过./configure以令messages产生Makefile文件
* 复制源码中的build目录(用于make messages目录时会用到里面的一些脚本)和messages目录到已编译安装好的mailman目录下。
* 进入编译好的mailman/messages目录下,修改zh_CN/LC_MESSAGES/mailman.po文件,让它适合您的要求。
* 回到mailman/messages目录下运行make命令
* 进入zh_CN/LC_MESSAGES/目录,您会发现会多了一个mailman.mo文件,这时重启mailman,再回到WEB界面下您会发现中文效果的改变
* 第二个解决的办法: 来到mailman/bin/目录下执行:
sudo ./msgfmt.py mailman/messages/zh_CN/LC_MESSAGE/mailman.po
这样就会产生一个mailman.mo文件了。 然后就重启mailman,您就会看到效果了

注意:
1. 当您的mailman无法收信或是发信的时候,第一个要看的地方就是/var/log/messages文件,里面会有关于系统和各个服务的各种信息,包括了错误信息。第二就是看/var/log/maillog文件,里面记述了邮件无法发送的原因和其它很有用的信息
2. 当您使用telnet来发信的时候,请记住发信格式!

2009年4月18日

xfce4.6

刚才安装了xfce4.6,不过启动后它会启动很多我不用的东西,占了我很多的内存,还有就是在top里显示太多我不用的东西了,搞得我有点烦燥了。而我的用xfce4主要是使用它的theme之类的,这样好看一点啊,其它的都不想用了。于是我在~/.xinitrc里写入xfce4启动后要启动的模块,如下:

xfsettingsd &
xfwm4 --daemon

* Fix possible monitor cache size inconsistency when the screen size changes.
* Fix fill function not working with multiscreen.
* Fix size not properly computed by the fill function with a dock on top or left (Bug #4960).
* Only display the shortcut conflict dialog if the conflict is with a different shortcut than the one being edited.
* When stealing a shortcut from another shortcuts provider, clear the shortcut of that provider first.
* Fix focus stealing prevention with applications which support the NET_WM_USER_TIME_WINDOW protocol.
* Do not automatically give focus to windows placed on lower layers, but focus those on upper layers at first map.
* Fix compilation failure in debug full without render.
* Fix ICCCM synthetic unmap notify handling causing a race condition with amule when started hidden to system tray (Bug #4928).
* Fix margin maximum value (Bug #4931).
* Apply font settings changes in real time (DPI, hinting, hint style, RGBA).
* Fix key "Super" remaining sticky when used as a modifier shortcut (Bug #4959).
* Updated translations: Polish, Swedish, Brazilian Portuguese, English (GB), Spanish, Czech, Turkish.

exec xfce4-panel

* Block the panel autohide if the widget is grabbed .
* Fix dragging to the submenu items of a launcher .
* Send the event time with startup notification instead of zero, so that focus stealing works properly.
* Set the foreground color of the lcd clock .
* Don't escape the command when dropping a Desktop file in the launcher dialog .
* Updated translations: Turkish, French, Indonesian, Norwegian, Polish, Simplified Chinese, English (GB), Catalan, Ukrainian.


这样它就只使用了xfsettingsd xfwm4和xfce4-panel。如果想使用xfce4-setting-manage来设置xfce4的话,就用命令行来调用

不过有一个问题了我的fcitx占用CPU利用率的100%和98%,我的机子是双核的。不知道这是否和xfce4有关呢??


注: 红色的是关于启动项的注明,等有时间有知识后再翻译为中文。至于xfsettinsd,暂时稳唔到距的资料


有点想换输入法的冲动!!不过找不到合适的。scim也有点不想用!!

2009年4月17日

make.conf和src.conf的不同

make.con


make.conf的主要目的是控制FreeBSD源码,文档,和ports应用程序的编译。这些会经常会是/usr/src, /usr/doc和/usr/ports。当需要修改FreeBSD源码,文档和ports应用程序的编译的默认值时可以去创建和编辑这个文件。

src.conf


src.conf的目的中是去控制FreeBSD源码的编译。这一般会是/usr/src。当需要修改/usr/src的编译的默认值时可以去创建和编辑这个文件。

去探讨和研究的东西

负载


平均负载是系统等待运行队列的长度与当前所有CPU中正在运行的工作的和。


高平均负载通常表示系统任务繁重,因而响应时间变慢。
高平均负载是多少?一般来说,要根据系统来判断。理想情况下,总是希望平均负载低一点,3就比较合适。基本上来说,这里的“高”是指足够高,而不需要命令uptime来指出系统已经超载。


平均负载试图衡量任何时间内的活动进程数量。在被当作CPU利用率的衡量标准时,虽然平均负载数是简单的和缺乏定义的,但远不是无用的。


……不同的系统在相同平均负载下的表现不同。……运行一个绑定CPU的后台工作……虽然平均负载很低,也能将反应拖得很慢。


如果这个绑定CPU的进程运行足够长的时间,它会驱使平均负载升高,因为这个这个进程一直处在正在执行或可以执行状态。这个事实默默地指出,平均负载并不是你认为的平均。正如我们上述介绍的,这是一个时间依赖的平均水平。不仅如此,它是一种有阻尼的时间依赖性的平均水平。


1. 负载不是利用率,而是任务队列长度。
2. 他们指出了3种不同的样本时间序列。
3. 他们是成倍阻尼的移动平均线。
4. 他们使用了错误的顺序来代表趋势信息。

2009年4月16日

css创建圆角和透明

玩了一下CSS,又在READER上看到了有人介绍CSS3的5个一定要知道的特性。现在我把它们合有一起用了一下,真的很不错啊!!
code是:

-moz-border-radius: 10px; #支持firerfox的四个角的圆角方案
-webkit-border-radius: 10px; #支持safari/chrome的四个角的圆角方案
background-color: #fff;
border: 1px solid #fff;
opacity: 0.3; #透明度为30%

这样只用几句话就可以写出一个圆角和透明了,真的很方便!!

解决man的乱码问题

最近发现自己的man出现了乱码,出现乱码的地方也只是那一条横线 “ - ”。经过在论坛的讨论和研究得到的结果是:编码问题。
我之前的编码除了LC_CTYPE是zh_CN.UTF-8外,其它的都是en_US.UTF-8.
而现在我把编码改成了:

LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

而单单这样设置的话会影响到fcitx的工作的,我就在改变了一下.xinitrc文件的内容,改变后的内容如下:

export XMODIFIERS='@im=fcitx'
export LC_CTYPE=zh_CN.UTF-8
exec fcitx &

当这样子还是不行的话,有您的shell的配置文件(如.cshrc, .profile, .zshrc)下写入:

LC_CTYPE=C

这样子设置的话man就不会出现乱码而且fcitx能正常工作了!

2009年4月8日

给FreeBSD加上sound

一个X桌面如果没有声音的话也说不过去啊,我使用的是FreeBSD-8.0-current,桌面用的是awesome,今天安装了一下mplayer,发觉没有声音。的确,没声音真的不爽!!
搞了一下,终于搞定了声音问题,下面是修改过程:
在/boot/loader.conf加入:
snd_driver_load="YES"

在一些文章里写着要加上机子的声卡名称才行,如ICH Hda...那些。不过我刚才试了一下,只写入上面的一段就会有声音了!

还发现了默认的声音设置,那就是:在/boot/dervice.hint里加入
hint.pcm.0.vol="80"

这句话的意思是:设置音量的默认大小为80%。
其实这句话是在手册里看来的,当有人叫你看手册不是完成没道理的

2009年4月2日

sudo限制rm

经过昨晚的sudo rm -rf /var/* 使我决心不再使用sudo rm这个命令了,所以今天有个想法就是:在sudo里把rm给禁了,经过一番试验得到的结果是,在/usr/local/etc/sudoers里加入:
minix ALL=ALL, !/bin/rm

这句话的意思是:用户minix可以使用所有命令,除了/bin/rm之外.其中的 " ! "就是说不要使用/bin/rm了,它是害人的啊!!

如果想禁掉更多的命令,那就在这句话后面加上你的command吧,记得要加" ! "号,这个才是关键

把/var里面的目录给删了

今天不知怎了,竟用了一个 sudo rm -rf /var/* 命令,本来是想把/var/tmp/目录里面的东西删的,最后竟然把/var/下面的东西给作了。
一直想挽回自己的错误,但深想一层,觉得意义不大,因为这里面装的是FreeBSD一特性的表现目录:/var/db/pkg下安装了系统的所有软件,当想删除软件的话可以从这里入手,直接用pkg_delete就可以了。还有/var/db/ports和/var/db/portsnap,它们保存了ports下的各软件的信息。/var/db/portsnap是根据这里面来使用portsnap fetch update的,不过用不用它都没什么关系的,因为还有一个csup啊。还有很多很多!!
在删除这目录我想到的一个方法是使用mtree命令,至于这个命令的使用方法,我现在还没搞懂,我想到它是因为我之前有买过一本叫"BSD Hack"的书,里面有介绍如何恢复一个目录和子目录,不过我没带着,所以就没办法用了,不过为什么我的man出现在乱码啊现在,在文本模式和X下都有,看起来觉得很乱,所以就不怎么看了。这个问题要深究,要让自己懂得为什么会出现这个情况,初步怀疑是编码问题,不过又觉得不是编码的问题!做人啊!!!!
这些都值得我去考虑,去解决!在问题才会有解决问题的动力,难道这就是被动??