一直想在我的小黑(thinkpad x61)上,装个FreeBSD桌面环境。由于没有内置光驱,尝试了用USB外接光驱启动安装,无法正常读取光盘镜像。但没有放弃,想起了以前用VmWare尝试安装MacOSX的方法,遂,决定一试,后成功,步骤如下:
1.新建虚拟主机,硬盘选择整个磁盘。
2.光驱加载ISO镜像,bios,光驱启动
3.进入安装界面,Custom自定义安装
4.FDISK,分了两个slice,(印象中ibm pc最多支持4个主分区,一个主分区被Windows占用,一个扩展分区,freebsd好像只能装在主分区上,这样一来,4个主分区,算是全了)5.LABEL,当时有点傻,错误的以为只能建一个bsd partition,现在想想,我可以建多个bsd分区,把 /,/usr,/var, /tmp分开,现在都装在了一个bsd分区里,不知道当时咋想的
6.选择包,安装完,重启,再虚拟机里一切正常。重启电脑关键的是这一步,由于当前系统还装了Ubuntu,使用Grub引导。查看了一下手册,进入启动菜单时,按C键,命令行方式。 root (hd0,a) 回车(设备名用的是linux的命名方式,我想这是Ubuntu下的grub) kernel /boot/loader boot见到了久违的FreeBSD启动菜单,但稍后的启动中又遇到点小麻烦,就是在虚拟机下找到的设备是ad0,但这里内核找到的是ad4,奇怪,ad能有4吗?无法mount跟分区,只好在提示符下手动加载ufs:至此安装结束,在ports里安装上了xfce,启动进入图形界面一切正常。编译了个Firefox3,汗啊,下回直接找安装包,就我电脑这配置,还编译了3个小时。无线目前还不好使,改天再接着研究,把FreeBSD进行到底。
shell 下,很讨厌speaker的滴滴声,终于找到了解决办法,命令如下:
kbdcontrol -b off
我们日常开发中总会用到tab键进行缩进,Vim默认的tab缩进是8个空格,个人习惯使用2个或者4个空格进行缩进,这样代码更紧凑一些。翻了翻vim的manual,找了些这方面的技巧: (more…)
在安装了Apache以后,确认httpd.conf的配置没有任何错误,但启动时却遇到:
“[warn] (2)No such file or directory:Failed to enable the ‘httpready’ Accept Filter”这个错误,百思不得其解。后来找遍资料终于明白,原因出在内核上(我的FreeBSD是6.2)。
解决办法:要在内核加载accf_http这个module,他的作用是直到接到完整的http请求前先缓冲下数据。
可以输入 kldload accf_http 加载到内核中,如果想永久的在内核里加载这个模块可以在/boot/loader.conf文件中输入:
accf_http_load=”YES”
How to run a shell script?
1. chmod 755 xxx.sh , then type ./xxx.sh
Notice:
1.If the first character is not begin with “#”,for default the script use Bourne Shell (/bin/sh)
2.if begin with “#” the script use C shell(/bin/csh)
3. if begin with “#!” ,you need use the full path of the shell .for example : /usr/local/bin/bash2
2. bash xxx.sh ,tell shell to use bash run the file,and you don’t need the file’s execution privilage. (more…)
Introduction
intltool is a set of tools to centralise translation of many different file formats using GNU gettext-compatible PO files.
The intltool collection can be used to do these things:
* Extract translatable strings from various source files (.xml.in,
o glade, .desktop.in, .server.in, .oaf.in).
* Collect the extracted strings together with messages from traditional
o source files (.c, .h) in po/$(PACKAGE).pot.
* Merge back the translations from .po files into .xml, .desktop and
o oaf files. This merge step will happen at build resp. installation time.
The intltool package has a script, intltoolize, which copies the various scripts and does the other magic to your module. So users building from tarballs don’t need intltool, only folks building from cvs. (This is modelled on gettextize.)
Getting intltool
Intltool can be fetched from http://ftp.gnome.org/pub/gnome/sources/intltool/.
today I compile a program under FreeBSD6.2 , and run into an error
” checking for XML::Parser… configure: error: XML::Parser perl module is required for intltool”, when fix the error ,let me know much about perl’s module.
the name “CPAN” means: Comprehensive Perl Archive Network,It is also a perl module-CPAN.pm ,The CPAN module is designed to automate the make and install of perl
modules and extensions.This module will eventually be replaced by CPANPLUS. CPANPLUS is kind
of a modern rewrite from ground up with greater extensibility and more
features but no full compatibility.
How do I install Perl modules?
Installing a new module can be as simple as typing perl -MCPAN -e ‘install Chocolate::Belgian’. The CPAN.pm documentation has more complete instructions on how to use this convenient tool. If you are uncomfortable with having something take that much control over your software installation, or it otherwise doesn’t work for you, the perlmodinstall documentation covers module installation for UNIX, Windows and Macintosh in more familiar terms.
Finally, if you’re using ActivePerl on Windows, the PPM (Perl Package Manager) has much of the same functionality as CPAN.pm.
finally ,to fix the error,only one command : sudo perl -MCPAN -e ‘install XML::Parser’