关于Gnome

11月 26th, 2007 by lisir

1、在系统──首选项──会话会话选项标签页下发现有个登出时自动记录运行的程序,应该可以实现KDE的重启自动打开原来的会话的功能。

2、在《个人电脑》2007年11月的期刊上,有篇介绍Gnome2.22.0的改进的介绍,里面谈到在面板上的打开窗口不再象原来那样自动收缩了,而是保持固定大小了,这才发现它的改进。而原来还曾经在论坛上发过帖子,谈及这个问题。

Google Browser Sync──用于同步firefox的扩展

11月 26th, 2007 by lisir

这个扩展可以同步Firefox设置──包括书签、历史记录、cookies和保存的密码。

http://www.google.com/tools/firefox/browsersync/

Google Browser Sync for Firefox is an extension that continuously synchronizes your browser settings – including bookmarks, his×y, persistent cookies, and saved passwords – across your computers. It also allows you to res×e open tabs and windows across different machines and browser sessions. For more info, please visit our FAQ.

另一个可以用来同步书签的是Gmarks,可以将Firefox的书签与Google Bookmarks同步。

用plucker_build打包生成Palm用的电子书

11月 19th, 2007 by lisir

原来虽知道Plucker有个Linux命令行终端,但一直没用过,只是在使用wine来运行SunRise XP和iSlioX来生成Palm掌上电脑用的电子书。后来花了点时间翻译了一个man手册,现在来试用一下吧:

man手册里plucker_build的选项是相当多,但一般我们也用不到这么多,只要简单设置一下~/.pluckerrc文件,整个命令行就简单多了。

.pluckerrc文件中已经提供了许多设置,只要将前面的注释符号(,,)去掉,再加上自己的参数就可以了,何况还有说明,我的.pluckerrc文件有效设置如下(都在[Default]下):

pluckerdir = /home/lisir/文档/plucker/ 输出文档保存路径

compression = zlib 输出文档的压缩格式,若为doc则压缩率相对较低;若为zlib,压缩率更高。

home_maxdepth = 3 最大链接数,数值3表示包括首页共3级链接(向下链接两层)。

home_stayonhost = True 抓取内容限同一主机。

bpp = 1 图像色深

下面是两个使用例子:

plucker-build -H /media/sda7/man-html-20071110/html/manpageindex.html -f manpage
-H后接要抓取的文件,既可以是html文件,也可以是txt文件,若为本地文件前面也可加file://,不加用这样的路径名也可以。

-f后接输出的文件名

lisir@lisir-desktop:~$ plucker-build -H file:///usr/share/doc/Debian/reference/index.zh-cn.html -f “debian_referrence_zh” -M 2 –charset=114

-M后接最大链接深度,因为这个文件向下只有一级链接,所以取2而不用默认配置中的3。(其实3也没问题)

–charset是设置使用的字符集,默认是使用的英文的,而我们这里使用的是中文的,所以要自己再设一下,而在默认配置中设置字符集没有必要,除非你确定你只做一种语言的电子书。plucker_build支持的字符集名没有GBK和GB18030,所以我们要使用十进制的MIBenum值,查阅http://www.iana.org/assignments/character-sets可以知道,113代表GBK,而114代表GB18030.

还有一个比较常用的选项是–staybelow,仅抓取某子目录下的内容。用法是:–staybelow=http://xx.xx.xx/xx/xx/,如果是本地文件,则把URL换成路径名。

注意:上面的选项,短名的如H、f、M都是一个短划线,而长名的选项如charset、staybelow都是双短划线。

plucker的man手册

11月 17th, 2007 by lisir

PLUCKER-BUILD

Section: 用户命令 (1)
Updated: Plucker 1.2 - http://plkr.org/
索引 返回主目录


名称

plucker-build - 生成plucker格式(电子书)文档

SYNOPSIS

plucker-build [--alt-maxheight=pixel-height] [--alt-maxwidth=pixel-width] [--author=string] [--backup] [--beamable] [--bpp=image-depth] [--category=default-category-name] [--charset=charset-indica×] [--compression=compression-type] [--depth-first] [--doc-file=name-prefix] [--doc-name=document-name] [--doc-compression] [--exclusion-list=filename] [--extra-section=section-name] [--help] [--home-url=base-URL] [--icon=image-filename] [--launchable] [--maxdepth=depth] [--maxheight=pixel-height] [--maxwidth=pixel-width] [--no-backup] [--noimages] [--not-beamable] [--not-launchable] [--no-urlinfo] [--owner-id=name] [--pluckerdir=output-direc×y] [--pluckerhome=plucker-home-direc×y] [--quiet] [--referrer=string] [--status-file=filename] [--staybelow=url-prefix] [--stayonhost] [--title=string] [--update-cache] [--url-pattern=pattern] [--user-agent=string] [--verbosity=verbosity-level] [--zlib-compression] [HOME-URL]

描述

plucker-build 从URL建立Plucker二进制文档,一种电子书。本文档为运行在Palm设备上的Plucker阅读器程序提供格式化。 操作的普通模式是抓取一个 home URL生成Plucker文档, 或者输出到标准输出,如果指定了 –doc-file 则到一个文件。 或者,指定选项–update-cache会更新Plucker记录的缓存(though it’s not clear what this is good for)。Plucker文档格式在 http://www.plkr.org/index.pl/cvs/docs/DBFormat.html?rev=HEAD.规定了。

选项

有许多选项和参数可以在配置文件$HOME/.pluckerrc中,或者在默认的配置文件中使用。应用后,配置文件参数的名字显示在选项文档之后。在命令行给定一个选项将覆盖配置文件参数。更多配置文件的信息,请看下面。

–alt-maxheight=pixel-height
以像素为单位,指定一个图像的 alternate rendition 的最大高度。(当嵌入图像太大,无法完整包含时,就转换为比较小的版本,尺寸由参数MAXHEIGHT和MAXWIDTH决定,并且链接到比较大的图像,叫做 alternate rendition。) [alt_maxheight]
–alt-maxwidth=pixel-width
以像素为单位,指定一个图像的 alternate rendition 的最大宽度。 (当嵌入图像太大,无法完整包含时,就转换为比较小的版本,尺寸由参数MAXHEIGHT和MAXWIDTH决定,并且链接到比较大的图像,叫做 alternate rendition。) [alt_maxwidth]
–author=string
设置文档作者为 string,string要在文档的字符集内(参考–charset),如果字符集没有指定默认为ASCII。 [author_md]
–backup
设置输出文档的备份位,使文档可以在Palm同步时备份。默认备份文档。[backup_bit]
–beamable
设置输出文档的发射位,允许文档发射传播。默认,文档可以发射。[copyprevention_bit]
–bpp=image-depth
指定用于图像的分辨率(单位为bpp)。Plucker 1.1的有效值为0、1(默认值)、2、4、8。如果为0,则文档不包括图像。参见–noimages. [bpp]
–category=default-category-name
指定默认默认Plucker分类或包含在文档中的分类。如果指定了超过一个的分类,分类名应该用逗号隔开。[category]
–charset=charset-indica×
指定攫取文档文本时使用的编码的默认字符集。charset-indica× 既可以是一个字符集名(来自一个小列表;参考src/parser/python/PyPlucker/__init__.py.in查看可用字符集名列表),或者一个代表字符集MIBenum值的十进制整数,见表http://www.iana.org/assignments/character-sets. [default_charset]
–compression=compression-type
指定文档中使用的压缩类型。有两个compression-type可用值:doc zlib。默认是doc,与Palm的DOC格式文档使用的压缩系统相同。zlib压缩通常生成较小的文档。参考–zlib-compression–doc-compression。 [compression]
–depth-first
指定网络遍历深度优先,而非默认的宽度优先。This often works better on bushy acyclic graph structures than the breadth-first traversal. [depth_first]
–doc-file=name-prefix (or -f name-prefix)
也可作 -f name-prefix。 指定不带目录(由–pluckerdir指定)的文档输出的名字, 不带扩展名(总是.pdb)。如果不指定,而且标准输出不是一个tty,文档输出到stdout。 [doc_file]
–doc-name=document-name (or -N document-name)
指定文档在阅读器中识别用的短名。默认为 –doc-file的值。如果–doc-file没有指定,文档名默认使用home URL。名字要限制在26个字符。[doc_name]
–doc-compression
指定文档压缩为Palm Doc格式开发的压缩方案,应该应用到这个文档的各个部分。这是默认。参考–zlib-compression–compression.
–exclusion-list=filename (or -E filename)
用于添加附加文件到exclusion list,一个包含从文档中排除的URLs信息的文件列表。有关排除列表的更多信息,参考用户手册。[exclusion_lists]
–extra-section=section-name (or -s section-name)
用于添加附加section到配置文件中searched section的列表中。一个section是一个命名的配置信息的集合。默认,DEFAULT section将被搜索,然后是所有操作系统指定的sections,再次是在命令行指定的sections。
–help (or -h)
输出命令行参数的帮助。
–home-url=base-url (or -H base-URL)
指定抓取文档的URL。这也可以在命令行指定为一个独立的参数。如果home URL没有指定,则默认为文件:/$HOME/.plucker/home.html。这个默认值可以在你的.pluckerrc文件中改变。注意,这个 值必须是一个有效的绝对URL。支持一个特殊的URL方案: plucker:。它指定在包含在PluckerDir(Plucker当前工作目录)和PluckerHome(Plucker家目录)里的Plucker搜索路径中的文件。[home_url]
–icon=image-filename
如果输出文件是 launchable,这个开关可以为文档在应用程序中指定大图标。如果不指定,就使用默认的图标。如果输出文件不是launchable,这个开关无效。参考–launchable. [big_icon]
–launchable
指定输出文档在系统launcher中显示为一个图标。点击这个图标会启动Plucker并执行这个文档。默认文档不是launchable。[launchable_bit]
–maxdepth=depth (or -M depth)
这指定了转换输入文档时语法分析器遍历链接的级数。最好保持这个值小一点,否则文件尺寸会很大。如果你只有一页,没有指向的页面,使用值为1。[home_maxdepth]
–maxheight=pixel-height
以像素为单位,为内嵌图像指定最大高度。覆盖了配置文件中的MAXHEIGHT参数,但会依次被图像链接自身的任一高度规格覆盖。[maxheight]
–maxwidth=pixel-width
以像素为单位,为内嵌图像指定最大宽度。覆盖了配置文件中的MAXWIDTH参数,但会依次被图像链接自身的任一宽度规格覆盖。 [maxwidth]
–no-backup
清除输出文件的备份位(会使文档在Palm同步时被备份)。默认,文档被备份。 [backup_bit]
–noimages
指定不包含图像。等同于–bpp=0。参考 –bpp.
–not-beamable
阻止文档发射传播。默认,文档可以发射。 [copyprevention_bit]
–not-launchable
指定输出文档不在系统launcher中显示为图标。默认,文档不可执行。[launchable_bit]
–no-urlinfo
指定文档中不含URL信息。当链接包含在文档中时,默认包括真实URL的信息。用于外部参考非常方便(链接到文档外的文档)。使用这一选项可能生成更小些的文档。[no_urlinfo]
–owner-id=name
指定文档的所有者ID。以这种方式稍微给文档加密,它只能在匹配所有者id的机器上打开。PalmOS阅读器中,同步用户名作为所有者id。 [owner_id_build]
–pluckerhome=plucker-home-direc×y (or -P plucker-home-direc×y)
覆盖PluckerHome的默认值,默认值为 $HOME/.plucker/。也可以通过设置环境变量PLUCKERHOME指定。一个明确的–pluckerhome的值覆盖所有的PLUCKERHOME设置。 [PLUCKERHOME]
–pluckerdir=output-direc×y (or -p output-direc×y)
覆盖PluckerDir的默认值,默认值为 PluckerHome (见–pluckerhome)。 PluckerDir是输出文档的默认目录,如果使用plucker: URL机制,则搜索该目录寻找输入文件。[pluckerdir]
–quiet (or -q)
同–verbosity=0.
–referrer=string
当使用HTTP获取输入时,发送string作为Referrer HTTP header的值。默认不改善referrer header. [referrer]
–status-file=filename
Gives the name of a file to read to get an estimate for the total number of pages that have to be processed, and to continually write with a single line giving the number of pages collected so far, the number of links still to process, and the estimated number of total pages that will be gathered (or zero if this is not known). The three values are written as space-separated ASCII numbers. The status line in the file is continually over-written as the pluck progresses, so the file will always contain only a single line. [status_file]
–staybelow=url-prefix
获取文档仅包括url-prefix下的URLs。处理子目录的一个方便方法。[home_staybelow]
–stayondomain
指定获取文档仅限同一域。[home_stayondomain]
–stayonhost
指定获取文档仅限同一主机。[home_stayonhost]
–title=string
设置文档标题为string。这与文档名(见–doc-name=)不同在于它相对长一些。string使用文档的字符集(见–charset),或者如果未指定字符集就使用 ASCII。[title_md]
–update-cache (or -c)
更新记录的Plucker 缓存,而不是建立文档。 [use_cache]
–url-pattern=pattern
自动排除不匹配规则表达式pattern的所有URLs。使用的规则表达式语言是在http://www.python.org/doc/current/lib/re-syntax.html.规定的Python ‘re’模块。 [home_url_pattern]
–user-agent=string
当使用HTTP获取输入时,改善string作为User-Agent HTTP header的值。默认是发送 “Plucker/Py-XX“,这里的XX是Plucker的版本。[user_agent]
–verbosity=verbosity-level (or -V verbosity-level)
设置状态信息输出的等级为verbosity-level指定的值。大约上,0是完全静默,1是标准处理状态(默认值),2是许多有关获取和分析输入的输出(通常用于调试)。大于2的值也可以用,但倾向给出大量输出仅对开发者有用。参考–quiet. [verbosity]
–zlib-compression
指定Zlib压缩用于文档。这被公认比默认压缩格式Doc压缩更高效。参考–doc-compression–compression.

例子

创建一个foo.com自助餐厅的每周自助餐菜单的pocket版,访问网址 http://www.foo.com/ops/cafe/weeklymenu.html, ,不跟随任何链接,不包含任何图片,命名文档为”Cafeteria Menu”,将文档输出到名为/tmp/Menu.pdb的文件,代码如下: % plucker-build http://www.foo.com/cafe/weeklymenu.html >/tmp/Menu.pdb

Or alternatively,

% plucker-build –pluckerdir=/tmp \

–doc-name=”Cafeteria Menu” \

–doc-file=Menu \

–home-url=”http://www.foo.com/cafe/weeklymenu.html“ \

–maxdepth=1 \

–bpp=0
Pluckerdir is ‘/tmp’…
—- 0 collected, 1 to do —-
Processing http://www.foo.com/cafe/weeklymenu.html…

Retrieved ok.

Parsed ok.
—- all pages retrieved and parsed —-

Writing out collected data…
Writing document ‘Cafeteria Menu’ to file /tmp/Menu.pdb
Converting http://www.foo.com/cafe/weeklymenu.html…
Wrote 1 <= plucker:/~special~/index
Wrote 2 <= http://www.foo.com/cafe/weeklymenu.html
Wrote 3 <= plucker:/~special~/pluckerlinks
Wrote 5 <= plucker:/~special~/metadata
Wrote 11 <= plucker:/~special~/links1
Done!
% ls -l /tmp/Menu.pdb
-rw-rw-r– 1 user somegroup 2646 Nov 2 21:19 /tmp/Menu.pdb
%

环境变量

HOME
用来决定用户配置文件的位置。如果不设定,就使用系统级的配置文件。
HTTP_PROXY, HTTP_PROXY_USER, HTTP_PROXY_PASS
如果设置了,就使用http URL机制取回URLs。
PLUCKERHOME
指定PluckerHome的值。更多信息见选项 –pluckerhome
PLUCKERDIR
指定PluckerDir的值。更多信息见选项–pluckerdir

配置文件

解释两个配置文件来定制不同plucker-build参数的设置。第一个是系统级配置文件,默认是/usr/local/etc/pluckerrc或你的Debian系统中的 /etc/pluckerrc。这个文件中的任何设置都会被个人配置文件$HOME/.pluckerrc覆盖。这两个文件包含了许多sections,每个都有一个名字,都用中括弧围住,跟着变量设置。通常,只有名为”default”的会被examined。额外的sections可能会特别用–extra-section选项;这些sections中的设置会覆盖默认section中的值 参数设置有个格式name = value,这里名字是plucker-build参数的名字,值是一个字符串、整数、浮点数或 布尔值。冒号可能用来替代等号来分隔名字和值。注释由”rem”在行首开头,或者用字符”#”,或者用字符”;”。布尔值为真表示为”TRUE”, “true”, “True” , “on”,或 “1″。布尔值为假表示为”FALSE”, “false”, “False” ,”off”,或 “0″。

配置sections常用于特定的常用选项组。可能在配置文件的一个section中定义这些选项,然后指定section为plucker-build的参数;其它选项全部从section中丢弃。

理解下列参数

PLUCKERHOME
见选项–pluckerhome.
alt_maxheight
见选项–alt-maxheight.
alt_maxwidth
见选项–alt-maxwidth.
anchor_color
链接所用颜色,表示为16个标准web颜色之一,或用web标准的RGB色彩概念。更多允许的颜色名和RGB概念见HTTP 4.0.1标准。
author_md
见选项–author.
auto_scale_images
一个布尔值;如果为真,plucker-build会自动尝试转换包含在文档中过大的图片到适合文档的较小的格式。默认为假。
backup_bit
见选项–backup.
big_icon
见选项–icon.
bmp_to_tbmp
windows中bmp2bmp程序名。默认为Bmp2Tbmp.exe。
bmp_to_tbmp_parameter
Windows中bmp2tbmp程序的参数。ImageMagick image parser.
bpp
见选项 –bpp.
cache_dir_name
指定PluckerDir的子目录用于存储缓存。默认为 “cache”。
category
见选项–category
color_paragraphs
布尔值;若为真,则在每段开始时插入特定的前景色。不是必要,默认关闭。
compression
见选项–compression.
convert_program
If using the deprecated imagemagick image parser, the name of the convert program. Defaults to convert (convert.exe for Windows).
convert_program_parameter
Windows ImageMagick 使用convert图像分析的参数。
copyprevention_bit
见选项–beamable.
db_file
Deprecated alternative to doc_file. May disappear in any release.
db_name
Deprecated alternative to doc_name. May disappear in any release.
default_charset
见选项–charset.
depth_first
见选项 –depth-first.
djpeg_program
djpeg程序名字。默认为djpeg.被netpbm2 image parser使用。
doc_file
见选项 –doc-file.
doc_name
见选项 –doc-name.
exclusion_lists
见选项 –exclusion-list. 如果这里指定了多个文件,它们应该用相应的操作系统的分隔符隔开(Unix平台是冒号,Windows平台是分号)。
filename_extension
用于文件名的扩展,默认为pdb。另一个可能是plkr。
giftopnm_program
用于转换GIF图片文件到PNM图片文件的程序名。用于netpbm和netpbm2 image parsers。默认为giftopnm.
guess_tbmp_size
布尔值,默认为真。用于Windows image parser.
home_maxdepth
见选项–maxdepth.
home_staybelow
见选项–staybelow.
home_stayondomain
见选项 –stayondomain.
home_stayonhost
见选项–stayonhost.
home_url
见选项–home-url.
home_url_pattern
见选项 –url-pattern.
http_proxy
String giving any HTTP proxy server to use. Sets the environment variable HTTP_PROXY to this value.
http_proxy_pass
String giving a password for any HTTP proxy. Sets the environment variable HTTP_PROXY_PASS to this value.
http_proxy_user
String giving a username for any HTTP proxy. Sets the environment variable HTTP_PROXY_USER to this value.
image_compression_limit
整数,设定压缩的图片字节的最小值。默认为0.图片小于这个的不会被压缩。
image_parser
字符串,指定使用的image parser。如果不指定,默认使用一个一个可用的。建议不指定这个配置参数,除非你知道你在做什么。可接受的值是 netpbm2, pil2, imagemagick2, netpbm (deprecated), pil (deprecated), imagemagick (deprecated), windowspil, windows (deprecated)。这个值在Java版的plucker-build中被忽略。
imagemagick_convert_command
imagemagick2 image parser中的ImageMagic转换程序的标识。默认为convert。
indent_paragraphs
布尔值,Boolean which when set will cause paragraphs to have leading indentation, but no extra leading space. Defaults to off.
launchable_bit
见选项 –launchable.
max_tbmp_size
Integer, maximum size for an image in the windows image parser.
maxheight
见选项 –maxheight.
maxwidth
见选项 –maxwidth.
no_dithering_in_java_image_quantization
布尔值,用在Java plucker-build image parser中当 图片量化为用在Palm中灰度或8位色图颜色固定的集合时关闭抖动。默认为假。
no_urlinfo
见选项 –no-urlinfo.
owner_id_build
见选项 –owner-id.
palm1bit_graymap_file
字符串,netpbm2和netpbm image parsers用来获取Palm色图文件的位置。
palm2bit_graymap_file
字符串,netpbm2和netpbm image parsers用来 获取Palm色图文件的位置。
palm4bit_graymap_file
字符串,netpbm2和netpbm image parsers用来获取Palm色图文件的位置。
palm8bit_stdcolormap_file
字符串,netpbm2和netpbm image parsers用来获取Palm色图文件的位置。
palmtopnm_program
字符串,netpbm2 image parser用来指定palmtopnm程序的位置。默认为palmtopnm.
pgmtopbm_program
字符串,netpbm2 image parser用来指定pgmtopbm程序的位置。默认为 pgmtopbm.
pluckerdir
见选项 –pluckerdir.
pngtopnm_program
字符串,netpbm2 image parser用来指定pngtopnm程序的位置。默认为 pngtopnm.
pnmcut_program
字符串,netpbm2 image parser用来指定pnmcut程序的位置。默认为pnmcut.
pnmdepth_program
字符串,netpbm2 image parser用来指定pnmdepth程序的位置。默认为 pnmdepth.
pnmfile_program
字符串,netpbm2 image parser用来指定pnmfile程序的位置。默认为pnmfile.
pnmscale_program
字符串,netpbm2 image parser用来指定pnmscale程序的位置。默认为 pnmscale.
ppmquant_program
字符串,netpbm2 image parser用来指定pnmquant程序的位置。默认为 pnmquant.
ppmtoTbmp_program
字符串,许多image parsers用来指定ppmtoTbmp(in various deprecated image parsers)程序或in netpbm2,the pnmtopalm program. In netpbm2的位置。 默认为pnmtopalm.
ppmtopgm_program
字符串,netpbm2 image parser用于指定ppmtopgm程序的位置。默认为ppmtopgm.
referrer
见选项–referrer.
retrieval_timeout
整数,用来以秒为单位尝试设置所有收取的超时。不会影响Java版plucker-build的超时。
small_icon
包含Palm图标的文件的文件名,用作文档的小图标,如果设定的launchable位。默认为内置的图标。
status_file
见选项–status-file.
status_line_length
整数,以字符数指定distiller输出的状态行的长度。默认为60。如果一行太长,省略中间的一部分字符。
tbmp_compression
布尔值,windows图像分析器用来标示是否在图片上使用Palm压缩。默认为真。
tbmp_compression_type
似乎也是布尔值,windows图像分析器用来标示是否在图片上使用Palm压缩。默认为真。这个参数与tbmp_compression 的不同不太清楚。
title_md
见选项 –title.
try_reduce_bpp
布尔值,控制图像分析器是否尝试缩放一个大图片通过降低图片的bpp数使之合适。只对netpbm2, imagemagick2, pil2, java, and windows parser有效。默认关闭。 try_reduce_bpp优先于 try_reduce_dimensionauto_scale_image.
try_reduce_dimension
布尔值,控制图像分析器是否尝试缩放一个大图片通过降低图片的尺寸使之合适。只对netpbm2, imagemagick2, pil2, java, and windows parser有效。
use_cache
见选项–update-cache. 名字误导人。
user_agent
见选项–user-agent.
verbosity
见选项–verbosity.
zlib_compression
指定使用zlib压缩。Deprecated in favor of compression.

参考

Plucker用户指南, at http://plkr.org/docs/.

BUGS

使用Debian BTs和reportbug工具报告bugs,或者直接反馈到http://bugs.plkr.org/ 或 <plucker-bugs@rubberchicken.org>

作者

Holger Duerer, <holly@starship.python.net>, and Bill Janssen, <bill@janssen.org>


Index

名称
SYNOPSIS
描述
选项
例子
环境变量
配置文件
参考
BUGS
作者

本文档由man2html使用手册页建立。
时间:2007年11月16日 10:30:24 GMT

关于自动挂载

11月 17th, 2007 by lisir

自动挂载
自动挂载的原理说明:http://www.linuxsir.org/bbs/showthread.php?t=157065    RH版

http://www.lowlevel.cz/log/pivot/entry.php?id=95

gnome-mount会在/media/下自动生成.hal-mtab,如果在插入U盘前后看一下它的内容,就会发现它由原来的空白,变成类似下面的内容了。
/dev/sdb1       1000    0       vfat    nosuid,nodev,shortname=mixed,uid=1000,utf8,umask=077,exec,usefree       /media/HARRY__ IPO

同样,用lshal –moni×监视hal,在插入U盘后会出现类似下面的提示:
Start moni×ing devicelist:
————————————————-
10:28:23.914: usb_device_5ac_1300_000A270010336C48 added
10:28:24.006: usb_device_5ac_1300_000A270010336C48_if0 added
10:28:24.016: usb_device_5ac_1300_000A270010336C48_if0 property info.linux.driver = ‘usb-s×age’ (new)
10:28:24.064: usb_device_5ac_1300_000A270010336C48_usbraw added
10:28:29.078: usb_device_5ac_1300_000A270010336C48_if0_scsi_host added
10:28:29.083: usb_device_5ac_1300_000A270010336C48_if0_scsi_host_scsi_device_lun0 added
10:28:29.137: usb_device_5ac_1300_000A270010336C48_if0_scsi_host_scsi_device_lun0_scsi_generic added
10:28:29.298: s×age_serial_Apple_iPod_000A270010336C48_0_0 added
10:28:29.372: volume_label_HARRY___IPO added
10:28:29.567: volume_label_HARRY___IPO property volume.mount_point = ‘/media/HARRY__ IPO’
10:28:29.571: volume_label_HARRY___IPO property volume.is_mounted = true

hal策略文件:
/usr/share/hal/fdi/policy/10osvendor下带s×age的,比如我的Ubuntu是20-s×age-methods.fdi。

gnome-mount用的参数来自:/usr/share/gconf/schemas/gnome-mount.schemas。
在gconf-edi×中/schemas/system/s×age/default_options主键下会有多个主键,比如hft、iso9660、ntfs、ntfs-3g、udf、vfat,每个下都有mount_options的键名,值为<schema>,应该是让它到schema文件去找,只有ntfs是两个主键,还有一个是fstype_override,也是<schema>。

系统有套工具,比如gcontool、gconftool-2,可以用下面的版本把该文件直接导入注册表:
export GCONF_CONFIG_SOURCE=`gconftool-2 –get-default-source`
SCHEMAS=”gnome-mount.schemas”
for S in $SCHEMAS; do
gconftool-2 –makefile-install-rule /usr/share/gconf/schemas/$S > /dev/null
done

gnome-volume-manager  is  a GNOME daemon that acts as a policy agent in top of the kernel, udev, d-bus and HAL. It
listens to HAL events and reacts with user-configurable actions. Currently it supports automount of new media  and
hot-plugged  devices,  au×un,  autoplay for Cd’s and DVDs, and automatic camera management. It is expected to be
simple and free of polling and other evil hacks.
gnome-volume-properties - configure the gnome-volume-manager daemon.
gnome-volume-properties allows you to configure gnome-volume-manager.
This program accepts all the standard GNOME and GTK+ options, which follow  the  usual  GNU command  line  syntax,
with long options starting with two dashes (`-’).

gnome-mount  -  Mount  drives  and volumes using HAL and read settings from the GNOME desktop configuration system
gconf.

SYNOPSIS
gnome-mount [-?|--help] [-v] [-n] [-t] [-b] [-d /dev/file | -h /org/fd/Hal/udi | -p nickname] [--unmount | --eject
|   --write-settings   |  --erase-settings  |  --show-settings]  [--mount-point  where-to-mount]  [--mount-options
opt1,opt2=foo,opt3] [--extra-mount-options opt4,opt5=bar] [--fstype fstype-to-use]

DESCRIPTION
This program is used to mount and unmount file systems for GNOME desktop users. It can also be used to eject discs
from CD drives and other devices that needs to be ejected. For example, iPod’s needs this to make the “Do not dis-
connect” message go away.

Normally, this program is invoked by software in the GNOME stack (specifically gnome-vfs-daemon and  gnome-volume-
manager ). End users should never have to deal with gnome-mount directly on the command line, nor should they have
to read this manual page.

Mounting a file system into the root file system involves a certain degree of configuration and as such is subject
to  whatever preferences an user might have.  gnome-mount allows the user to control the mount point location, the
mount options and what file system to use for mounting a file  system.  The  settings  are  read  from  the  gconf
database  (which is per-user) and can also be overridden on the command line using the appropriate parameters. See
below.

PRIVILEGES
gnome-mount is intended for unprivileged users and HAL ultimately controls if  the  calling  user  is  allowed  to
mount,  unmount or eject volumes as well as what mount options are valid. As such, requests may be denied. See the
(human readable) exception returned from HAL for details if a request fails.

Note that HAL has a notion of what mount options are valid for a given volume. They are listed in the HAL property
volume.mount.valid_options  on  the  device object representing the volume to mount. Consult lshal(1) for details.
Also note that HAL by default appends the options nosuid and nodev to prevent privilege escalation.

In addition to using HAL as the mechanism for mounting file systems, the /etc/fstab file is also consulted as  HAL
will  refuse  to mount any file system listed in this file as it would violate system policy. If this is the case,
gnome-mount will invoke mount(1) as the calling user rather than invoking the Mount method  on  the  org.freedesk-
top.Hal.Device.Volume  interface  on  the  device object representing the volume / drive. This means that settings
(mount point, mount options, file system type) read by gnome-mount are not passed along as these are already spec-
ified in the /etc/fstab file and there are no mechanism to override them. When parsing the /etc/fstab file, gnome-
mount (and also HAL for that matter) resolves symbolic links and also respects the LABEL= and UUID= notations. For
example, if this line is in /etc/fstab

LABEL=MyVolume /mnt/myvolume auto user,defaults 0 0

then  gnome-mount mounts the file system with the label MyVolume via mount(1) and /etc/fstab rather than using the
HAL mechanisms.

hald  is a daemon that maintains a database of the devices connected to the system system in real-time. The daemon
connects to the D-Bus system message bus to provide an API that applications can  use  to  discover,  moni×  and
invoke  operations  on devices. For more information about both the big picture and specific API details, refer to
the HAL spec which can be found in /usr/share/doc/hal-doc/spec/hal-spec.html depending on the distribution.

lisir@lisir-desktop:~$ apt-cache search ivman
ivman - daemon to auto-mount and manage media devices

thunar-volman
The Thunar Volume Manager is an extension for the Thunar file manager, which enables automatic management of removable drives and media.

The advantage of Thunar Volume Manager over other solutions (like gnome-volume-manager or ivman) is that it does not require an additional daemon to be running in the users desktop session, which means it is a very lightweight solution. In addition, the Thunar Volume Manager smoothly integrates into the Thunar file manager and the Xfce desktop.

It was designed to look and behave similar to gnome-volume-manager to get consistent removable drive and media management in Xfce and GNOME. This is to help GNOME refugees and people using both Xfce and GNOME.

几个Linux命令

11月 16th, 2007 by lisir

1、从EE的博客上看到的du,原来虽然知道是显示占用磁盘大小的,但没仔细看man手册,还一个劲地想:怎么没有和dir一样显示目录大小的呢?

du -cah –max-depth=n 目录

2、从linuxgem.org上看到的fuser,恰好能解决卸载文件系统时“Device is busy”的错误:

fuser [-a|-s|-c] [-4|-6] [-n space ] [-k [-i] [-signal ] ] [-muvf] name …

显示使用指定文件或文件系统的进程的PID。

3、dmesg。原来只知道这个能查看日志的一部分。看到EE在论坛的回答,自己又看了看man,这个命令居然就是我一直想看的显示启动时信息的命令。

dmesg [ -c ] [ -n level ] [ -s bufsize ]
显示或控制内核ring buffer。帮助用户显示启动信息。

-c 显示后清空ring buffer

-s bufsize 查询指定大小的内核ring buffer。默认大小16392。
-n level 设定信息记录到终端的运行级。例如 -n 1会使所有信息无法在终端显示。所有运行级的信息仍然记录到/proc/kmsg。使用-n选项,dmesg将不能显示或清除内核ring buffer。
dmesg是util-linux-ng包的一个命令。

Linux文档

11月 16th, 2007 by lisir

1、机器上的/usr/share/doc下。

2、/usr/share/man

3、http://www.tldp.org/ 不过需要爬墙去,里面的资料不错的说,不仅有最新的manpage,还有许多guide、faq、howto,还有一个电子杂志的镜像。基本以英文为主,有个最大的好处是提供多种格式下载,包括html、txt、Plucker(Palm上的一种电子书)、pdf。

4、http://man.chinaunix.net 有许多Linux/Unix的技术文档手册之类,特别是有许多网友做的中文版。

5、才发现的,居然Ubuntu的源里就有部分文档,在新立得的“文档”分组下可以看到,不少呢。这些文档也是安装到/usr/share/doc/下。

感受Gentoo

11月 15th, 2007 by lisir

从刻好Gentoo盘着手安装到现在已经大约一周了,原来虽说看过Gentoo安装手册,但一看那繁琐的安装程序(与Ubuntu比)就头晕,也就没仔细看。一次次的重装,现在总算有点眉目了。也谈谈对它的第一印象。

Ubuntu更象是针对普通用户的,安装程序简单,用LiveCD只有七步,而且安装界面友好,安装完后直接按快速设置指南就可以很轻松地完成工作环境设置,立刻上手使用。Ubuntu在提供极佳易用性的同时也容易掩盖了后面的底层技术。

Gentoo并不适合普通用户,至少技术难道比Ubuntu大,感觉它更适合于技术狂人,或者追求性能极限的人。它充满了选择,而面对这些选择,用户就得了解它背后的意义和相关资料才能较好地使用它。它安装程序繁琐,可正因为详细地把每一步都提供给了用户,所以才可能从底层了解它。 这应该是我第一个比较详细地阅读了它的相关文档的系统,不读不行啊!

现在机器上保留着3个系统:XP保留,照顾一下国内的网站;Ubuntu日用,安全又省心;Gentoo把玩,多学点东西没坏处。

Ubuntu下做Palm的电子书

11月 9th, 2007 by admin

最简单的,莫过于将内容保存成txt格式了,编码保存成GB18030就可以。

如果是想将网页保存下来,就得用几个软件了,虽然Plucker提供了RPM格式,但安装上转换后的deb格式,却在抓取网页时出错,无法正常使用。幸好可以wine使用Sunrise XP,但这个只能抓取英文的,如果抓取中文的会因为编码问题而显示乱码。不过已经足够了,毕竟Plucker格式可以更好地支持zdic词典,即点即译。

对付中文网页,更好用的是iSiloX,同样是wine。

重启后无法自动激活网络连接的解决

11月 9th, 2007 by admin

我用的是ADSL,在用pppoeconf设置中已经设置好自动运行,所以每次开机后都是已经将网络连接好了,但有时系统死机时不得不硬重启,这时就会出现无法自动激活网络连接的情况,即开机后网络连接没有自动设置好,这时就需要使用

代码:
pon dsl-provider

命令激活一下。此后,系统就会恢复到原来的状态了。