计算机

You are currently browsing the archive for the 计算机 category.

前言

kickstart 是 Redhat 开发的一个系统自动安装方案。它可以用来自动安装 RHEL 以及 Fedora。采用 kickstart,用户只需建立一个配置文件,将安装过程中所需的操作(如分区方案、软件包信息、引导程序等等)写入文件,安装程序即可按照该文件进行自动安装。详情请见:kickstart wiki 页面 [1]

BFO 是随 Fedora 13 带来的一个新的安装方式,基于 BKO(http://boot.kernel.org),它通过网络运行安装程序并进行操作系统的安装。BFO 的镜像文件很小,本身不足 1MB,而且几乎无需更新。只需从 bfo.iso 引导,即可安装你想要的 fedora 版本。不过,前提是你要有网络连接。详情请参考:bfo [2]

准备工作

1. kickstart 文件,在你用常规方式安装完系统后会在 /root/ 目录下保留一份 anaconda-ks.cfg,如果想要按照你当前系统的设置来自动安装,不妨直接使用该文件。

注意:系统安装通常都是通过光盘或其它介质安装,安装源都位于本地。为了配合 bfo 安装,需要对生成的 kickstart 文件中的安装源做下修改。

此外,也可以使用 GUI 工具 system-config-kickstart 来生成。当然如果你熟悉 kickstart 文件格式的话,可以直接编辑一个。
1.1 下面我以我虚拟机上的一份 ks.cfg 为例,对 ks.cfg 做个简单介绍。

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --enabled --service=ssh #防火墙开启,ssh为信任服务。
# Install OS instead of upgrade
install #全新安装
# Use network installation
url --url="http://download.fedoraproject.org/pub/fedora/linux/releases/12/Fedora/i386/os/"
#如果使用本地安装后生成的 kickstart 文件,那么就要添加这个选项。
#该选项指定了网络安装时安装文件的位置。
#它的目录结构必须跟光盘中的结构完全相同。
# Root password
rootpw --iscrypted $1$jsonnTig$f7b4NFqCj2UBr.4bfrkH.0 #root用户密码,已经过加密处理
# System authorization information
auth --useshadow --passalgo=md5
# Use text mode install
text #如果不指定 text,那么默认会使用图形安装方式
# System keyboard
keyboard us # 这个是键盘布局,使用 us 键盘
# System language
lang en_US # 系统语言
# SELinux configuration
selinux --enforcing #selinux 选项
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai #系统默认时区
# System bootloader configuration
bootloader --location=mbr #引导程序安装位置
# Partition clearing information
clearpart --all --initlabel #分区选项,clearpart --all 即清空所有分区,--initlabel 表示初始化磁盘
%packages #软件包选项
@base #我的虚拟机配置太低,而且是通过网络安装,因此只选了最基本的包
%end

以上就是一份简单的 kickstart 文件内容,更多的选项可以参考 Fedora 文档 [3]中的 Fedora 安装指南,或者 Kickstart的wiki页面 [1]

2. bfo 镜像文件,这个文件可以直接到 bfo下载页面[4] 下载,我这里使用了光驱镜像文件,bfo.iso。如果你用实体机安装,建议还是用 USB 的镜像比较好,不到 1MB 的小东西,刻张盘太浪费了。
3. 网络连接
这个是必须的:)

安装

1. 首先从含有 bfo 镜像的设备启动,我这里的虚拟机就是用虚拟光盘引导了。引导界面如下图:
bfo 引导画面
2. 通过 bfo 文件引导后,将进入如下的画面:
bfo 引导画面2
3. 选择第二项,Install Media,按回车键;
4. 接下来将看到类似如下图片的屏幕:
bfo 引导屏幕
5. 这次安装的是 32位的 Fedora 12,选中后按 Tab 键,编辑引导选项。
系统选择屏幕
在最后,我们加上 linux ks=http://my.example/ks.cfg,这指定了 kickstart 文件的位置。ks 文件的位置可以为本地,也可以为网络。这要根据具体情况办了。详细参数还是请看 kickstart 的wiki吧。
6. 添加 ks 文件位置后,按回车,自动安装就此开始了。如果 ks 文件配置正确,网络连接正常,过一会我们就可以使用我们的新系统了。

文中参考链接

[1] http://fedoraproject.org/wiki/Anaconda/Kickstart
[2] http://boot.fedoraproject.org/index
[3] http://docs.fedoraproject.org/
[4] http://boot.fedoraproject.org/download

欢迎分享。不过记得加上出处和我的名字啊,毕竟是花了些时间和精力才写出来的。

Tags: , , , , ,

tar

利用 tar 归档和备份
简单的命令
tar cvf archieve_file.tar file
如果被打包文件或目录采用绝对路径,那么 tar 打包后的仍保持绝对路径的结构。
tar cvf file.tar file

tar cvf file.tar ~/file
的结果是不同的

Tags: ,

做为一个Google Reader Fan,它的快捷键你知道多少呢?以下是我在使用过程中学习到的一些快捷键。自认为比较实用。如果您是跟我一样的 Google Reader 阅读狂,那就记住这些键吧。或许您已经在用它们了。

  1. J/K     N/P,下一项/前一项(使用最多);
  2. Shift+J/Shift+K     Shift+N/Shift+P 在左边导航栏目间上下移动,选中栏目将以黄色高亮显示(刚发现);
  3. U 折叠/取消折叠导航栏;
  4. Space 前往下一项,到头后再按会跳至下一个订阅的未读项;
  5. PgUp/PgDn 向上/向下滚动;
  6. Shift+A 全部标记为已读 (我用的不多);
  7. T 编辑标签;
  8. S 加星号/取消星号;
  9. Shift+S 分享/取消分享
  10. L like/unlike;
  11. E 发送到邮件;
  12. A 打开/关闭 添加订阅对话框;
  13. M 保持/取消 未读状态;
  14. H 回到用户主页面(Home);
  15. R 重新加载订阅项(刷新,可以实现更新的目的。如果跟我一样是个reader狂,那应该记住这个键);
  16. / 切换光标至Reader上方搜索栏;
  17. Backspace 在导航栏的当前项和上一次选定项间切换(我理解是这样的);
  18. Esc 取消 A 或 / 的操作。

Tags: , , ,

由于计算机术语的翻译在简体中文和繁体中文之间有较大差异。为了让繁体、简体用户及翻译人员能够互相熟悉了解各自英文术语的翻译,促进交流协作,上个月专门在Google Docs上建立了一个术语对照表。
文档地址:http://spreadsheets.google.com/ccc?key=0Av2Nh83ucp7fdE8zV3hRbk9QU2ZFdlBJbjdmZXV2dEE&hl=en_GB
本术语表使用CC-BY-SA授权,可自由浏览。
编辑则需先加入Fedora Chinese邮件列表(chinese at lists.fedoraproject.org),并且还要有Google Docs帐号。

本术语表目前仍处于完善之中。欢迎各位爱好者前来参与编辑。
谢谢大家。协作的力量不可估量!

Hi everyone,
The translation work is a time-consuming work but sometimes it’s interesting.
Some English terminologies have different translations among zh_CN,
zh_TW and zh_HK. So for the Chinese translator‘s(including zh_CN,
zh_TW, zh_HK) convenience and reference, we now working a
terminology comparison list.

This list now can be publicly viewed and can be edited if you have
subscribed Fedora Chinese mail list(chinese at lists.fedoraproject.org)
and have a Google docs account(we use Google docs just for
collaboration easily) now.
You may find it here:
http://spreadsheets.google.com/ccc?key=0Av2Nh83ucp7fdE8zV3hRbk9QU2ZFdlBJbjdmZXV2dEE&hl=en_GB
The list follows CC-BY-SA license.

We welcome all of you adding new words for us.
We welcome all of you viewing the list if you just want to learn some
Chinese or for other purpose.

Thanks a lot

Tags: , , , , , , ,

!本文基于Fedora

1.首先下载新内核源文件 下载地址:kernel.org
2.之后进行解压,解压位置随意,最好放到无关紧要的目录,或者自己的home,这样方便操作。
3. 进入解压后的目录,
开始配置内核,如果之前配置过,请先执行
$ make mrproper #清理旧的二进制文件
之后使用一下三者之一:

                  $ make config
                  $ make menuconfig
                  $ make xconfig

字符界面下还是用menuconfig比较好些,图形界面可以用xconfig。
如果想在已有的.config上做配置,可以执行
make oldconfig;
按照提示和需要对新增特性进行配置。如果还需要进一步修改和配置,则可以再次运行
make menuconfig,配置后保存。
4. $ make clean,当然这一步不是必须的。如果之前做过make mrproper,那么这一步可以不做make clean
5. 编译:
通常执行
$ make bzImage && make modules 就可以了
6. 安装模块
# make modules_install (此命令需要root权限)
7. 把当前目录下的.config、System.map文件,以及子目录中的文件 ./arch/i386/boot/bzImage 复制到/boot下,并重命名,命名规则可以参考/boot下已有的文件
具体为:

# cp .config /boot/config-version.number
# cp ./arch/i386/boot/bzImage /boot/vmlinuz-version.number
# cp System.map /boot/System.map-version.number

8. 生成initramfs.img文件
目前fedora下使用dracut命令
# dracut /boot/initramfs-version.number.img version.number
注:以上命令中的version.number需要替换为当前编译内核的版本号
9. 修改引导器,# vi /boot/grub/grub.conf
以grub为例:
修改grub.conf,按照已有启动参数格式添加新参数。
10. $reboot
最后重新启动,选择新内核进行测试

以上是Linux内核配置、编译和安装的基本步骤,写的比较简单。欢迎各位指教。

Tags: , , , , , ,

Test CSS3

测试一下添加到buzz没有

上午备份了blog的数据库,然后再进blog,就error establishing database connection了,我也没有改用户名密码呀,难道……挂了?
数据库这东西我是一点都不懂的:(
折腾了半个上午,给bluehost发邮件,导入数据库,新建数据库……后来把wp-content.php的用户名密码重设了一遍,居然又正常了。
到底怎么回事?我记得没有修改wp-content文件呀。
很奇怪。

I’ve been using mplayer for nearly 5 years since my first experience on Fedora Linux.
This time I found that mplayer in Fedora 12 cannot display Chinese subtitle correctly even I am using a correct mplayer config file when it plays videos.

After trying for several times and searching on Google, I found out that it was due to my locale setting.

According to wikipedia: locale is a set of parameters that defines the user’s language, country and any special variant preferences that the user wants to see in their user interface.

I’ve set my locale to en_US.utf-8 globally.But the mplayer in Fedora 12 needs LC_CTYPE to be set to my language code (zh_CN.utf-8) to display the Chinese subtitle.  So this becomes easy to solve.

First I think you should make sure that you have a mplayer config file which contains a line subcp=cp936.
Then choose one of the following ways to do:

1. add a line LC_CTYPE=zh_CN.utf-8 (substitute this for yours) to /etc/sysconfig/i18n, this will affect your LC_CTYPE globally.

2. modify .bashrc in the user’s  home directory, and add a line LC_CTYPE=zh_CN.utf-8 (substitute this for yours)  to the end of it. This will just affect the user itsself.

3. add LC_CTYPE=zh_CN.utf-8 before mplayer, like this:
$LC_CTYPE=zh_CN.utf-8 mplayer  my_file_to_play

I don’t think this will  affect any locale settings except mplayer, but you need to type such a long command every time. So the better way is add a alias to .bashrc.

alias mplayer='LC_CTYPE=zh_CN.utf-8 mplayer'
Now you can simply type mplayer like before to play your favourite videos with Chinese subtitles displayed correctly.

P.S. This is my first English Blog entry.

mplayer中文字幕显示问题解决方法:

1.如果locale设置为zh_CN,那么请检查mplayer的配置文件 ~/.mplayer/config,看是否存在subcp=cp936一行,没有请添加。添加后即可解决。

1.1 如果仍然不显示,请查看mplayer提示信息,可能原因是字幕字体设置问

题,这时可以在.mplayer目录中做字体的软链接。

ln -s  /font_dir/font.ttf ~/.mplayer/subfont.ttf

然后在config文件中添加subfont=~/.mplayer/subfont.ttf

2.如果mplayer配置文件没有问题,请检查locale中的LC_CTYPE设置,将其更改为LC_CTYPE=zh_CN.utf-8
方法:
2.1 在/etc/sysconfig/i18n添加 LC_CTYPE=zh_CN.utf-8
2.2 修改用户主目录.bashrc,添加 LC_CTYPE=zh_CN.utf-8
2.3 临时在shell里修改当前shell的LC_CTYPE,执行 $LC_CTYPE=zh_CN.utf-8
2.4 或者在mplayer之前加上LC_CTYPE=zh_CN.utf-8,然后执行 LC_CTYPE=zh_CN.utf-8 mplayer videofile_to_play

先写这么多吧,欢迎指正。

Tags: , , , , , ,

NtEd是一款轻量级但功能丰富的五线谱编辑软件。
目前在各大GNU/Linux发行版软件库中均有提供。
支持MIDI导入和导出。可将五线谱导出为PDF、PNG、SVG、PostScript等格式。
支持添加鼓音符,吉他和弦图等。
同时拥有歌词编辑和插入功能。
另外还支持从MIDI键盘直接创建乐谱。

更多特性介绍请见:http://vsr.informatik.tu-chemnitz.de/staff/jan/nted/nted.xhtml#properties

最新版(增加中文GUI)下载地址:http://vsr.informatik.tu-chemnitz.de/staff/jan/nted/nted.xhtml

相信对一个喜欢Linux的音乐爱好者来说,NtEd是你的好助手!

Tags: , , ,

« Older entries