关于Gnome
11月 26th, 2007 by lisir1、在系统──首选项──会话的会话选项标签页下发现有个登出时自动记录运行的程序,应该可以实现KDE的重启自动打开原来的会话的功能。
2、在《个人电脑》2007年11月的期刊上,有篇介绍Gnome2.22.0的改进的介绍,里面谈到在面板上的打开窗口不再象原来那样自动收缩了,而是保持固定大小了,这才发现它的改进。而原来还曾经在论坛上发过帖子,谈及这个问题。
1、在系统──首选项──会话的会话选项标签页下发现有个登出时自动记录运行的程序,应该可以实现KDE的重启自动打开原来的会话的功能。
2、在《个人电脑》2007年11月的期刊上,有篇介绍Gnome2.22.0的改进的介绍,里面谈到在面板上的打开窗口不再象原来那样自动收缩了,而是保持固定大小了,这才发现它的改进。而原来还曾经在论坛上发过帖子,谈及这个问题。
这个扩展可以同步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.
原来虽知道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都是双短划线。
Section: 用户命令 (1)
Updated: Plucker 1.2 - http://plkr.org/
索引 返回主目录
plucker-build - 生成plucker格式(电子书)文档
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中,或者在默认的配置文件中使用。应用后,配置文件参数的名字显示在选项文档之后。在命令行给定一个选项将覆盖配置文件参数。更多配置文件的信息,请看下面。
创建一个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
%
解释两个配置文件来定制不同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中丢弃。
理解下列参数
Plucker用户指南, at http://plkr.org/docs/.
使用Debian BTs和reportbug工具报告bugs,或者直接反馈到http://bugs.plkr.org/ 或 <plucker-bugs@rubberchicken.org>
Holger Duerer, <holly@starship.python.net>, and Bill Janssen, <bill@janssen.org>
自动挂载
自动挂载的原理说明: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.
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包的一个命令。
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盘着手安装到现在已经大约一周了,原来虽说看过Gentoo安装手册,但一看那繁琐的安装程序(与Ubuntu比)就头晕,也就没仔细看。一次次的重装,现在总算有点眉目了。也谈谈对它的第一印象。
Ubuntu更象是针对普通用户的,安装程序简单,用LiveCD只有七步,而且安装界面友好,安装完后直接按快速设置指南就可以很轻松地完成工作环境设置,立刻上手使用。Ubuntu在提供极佳易用性的同时也容易掩盖了后面的底层技术。
Gentoo并不适合普通用户,至少技术难道比Ubuntu大,感觉它更适合于技术狂人,或者追求性能极限的人。它充满了选择,而面对这些选择,用户就得了解它背后的意义和相关资料才能较好地使用它。它安装程序繁琐,可正因为详细地把每一步都提供给了用户,所以才可能从底层了解它。 这应该是我第一个比较详细地阅读了它的相关文档的系统,不读不行啊!
现在机器上保留着3个系统:XP保留,照顾一下国内的网站;Ubuntu日用,安全又省心;Gentoo把玩,多学点东西没坏处。
最简单的,莫过于将内容保存成txt格式了,编码保存成GB18030就可以。
如果是想将网页保存下来,就得用几个软件了,虽然Plucker提供了RPM格式,但安装上转换后的deb格式,却在抓取网页时出错,无法正常使用。幸好可以wine使用Sunrise XP,但这个只能抓取英文的,如果抓取中文的会因为编码问题而显示乱码。不过已经足够了,毕竟Plucker格式可以更好地支持zdic词典,即点即译。
对付中文网页,更好用的是iSiloX,同样是wine。
我用的是ADSL,在用pppoeconf设置中已经设置好自动运行,所以每次开机后都是已经将网络连接好了,但有时系统死机时不得不硬重启,这时就会出现无法自动激活网络连接的情况,即开机后网络连接没有自动设置好,这时就需要使用
| 代码: |
| pon dsl-provider |
命令激活一下。此后,系统就会恢复到原来的状态了。