ulovko 发表于 2012-06-09 15:51

Basic FreeBSD Setup as Desktop (FreeBSD占有率99.8% ^_^)

本帖最后由 ulovko 于 2013-04-06 11:14 编辑

官方简体中文安装手册:http://www.freebsd.org/doc/zh_CN/books/handbook/
官方en_US安装手册:http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html
官方简体中文安装手册 下载: ftp://ftp.freebsd.org/pub/FreeBSD/doc/zh_CN/books/handbook/

FROM: http://blog.chinaunix.net/uid-25256412-id-2939430.html
1: 使用 USB 安装 FreeBSD(设备编号自行修改)# dd if=9.1-RELEASE-amd64-memstick.img of=/dev/da1 bs=10240 conv=syncTips: Windows环境下如何将 *.img 写入USB ?
Image Writer for Windows:https://launchpad.net/win32-image-writer/+download


安装过程中会询问关于网络配置,会许有的人配置不正确导致无法连接internet!
给出兄弟我的配置:
> more /etc/rc.conf
hostname="ko.kotzu.org"
defaultrouter="192.168.1.1"

ifconfig_alc0="inet 192.168.1.5 netmask 255.255.255.0"
ifconfig_alc0_ipv6="inet6 accept_rtadv"

# Wireless
#wlans_ath0="wlan0"
#ifconfig_wlan0="WPA DHCP"
#ifconfig_wlan0="WPA inet 192.168.1.5 netmask 255.255.255.0"
#ifconfig_wlan0_ipv6="inet6 accept_rtadv"

还有一点关于WIFI !
着个其实不用写什么了!
官方文档有简体中文,写的非常详细!
下载页面:ftp://ftp.freebsd.org/pub/FreeBSD/doc/zh_CN.GB2312/books/handbook/
在线观看:http://docs.freebsd.org/doc/9.0-RELEASE/usr/share/doc/freebsd/zh_CN.GB2312/books/handbook/network-wireless.html


安装source 和 ports
等待重启完成 ...# vi /boot/loader.conf
loader_logo="beastie"                (boot menu logo)
autoboot_delay="3"                (boot delay)
:wq

# vi /etc/rc.conf
blanktime="600"
saver="daemon"
hald_enable="YES"
dbus_enable="YES"
powerd_enable="YES"
powerd_flags="-a adaptive -b adaptive -n adaptive"   # 保持温度不会过高就是了
:wq

# kldload coretemp
# sysctl -a | grep temper
hw.acpi.thermal.tz0.temperature: 60.0C
dev.cpu.0.temperature: 59.0C
dev.cpu.1.temperature: 59.0C
dev.cpu.2.temperature: 59.0C
dev.cpu.3.temperature: 59.0C
dev.cpu.4.temperature: 61.0C
dev.cpu.5.temperature: 62.0C
dev.cpu.6.temperature: 59.0C
dev.cpu.7.temperature: 59.0C
检查一下硬件信息# dmesg | grep attached        (列出没有被驱动的硬件)
# pciconf -lv                (更加详细)        /var/run/dmesg.boot        (see also)
                        (找到声卡 和 显卡加载相应驱动)
# dmidecode               (DMI table decoder)声卡 驱动# kldload snd_driver        (加载所有声卡驱动自动匹配)
# cat /dev/sndstat        (查看声卡驱动信息)
# dmesg | grep hdac
# cat filename > /dev/dsp        (测试声卡,filename为任意文件产生噪音说明正常工作)

# vi /boot/device.hints
hint.pcm.0.vol="50"        (pcm Module加载时,音量默认为50)
:wq

# Microphone   (话筒)
# mixer

# sysctl dev.pcm.0.play.vchans=4
# sysctl dev.pcm.0.rec.vchans=4                ( 虚拟声道(Virtual Sound Channels)4个音源能够同时播放)
# sysctl hw.snd.maxautovchans=4

# less /boot/defaults/loader.conf
/snd                        (找到所有声卡驱动支持项)
# pciconf -lv | egrep -i -A3 -B5 'audio|multimedia'        (查看device 类型)
# vi /boot/loader.conf
snd_hda_load="YES"        (启动时加载 声卡驱动/添加自己的声卡驱动)
:wq2: 时间校准 (很重要)# tzsetup                      (时区设置 CST)
# ntpdate cn.pool.ntp.org        (校准)

# vi /etc/rc.conf
ntpd_enable="YES"                (配置开机启动 ntpd)
ntpd_sync_on_start="YES"
:wq
# /etc/rc.d/ntpd start

# vi /etc/ntp.conf
server 1.cn.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org        (配置time server)
:wq
# /etc/rc.d/ntpd restart3:更新 source 和 doc# cp /usr/share/examples/cvsup/standard-supfile /etc
# cd /etc/; vi standard-supfile
*default host=cvsup.tw.freebsd.org (修改此项)
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_9_0
*default delete use-rel-suffix
*default compress
src-all
doc-all tag=.   (添加此项)
:wq
# csup /etc/standard-supfile4:ports 和 package 文件下载地址设置
# vi /etc/make.conf                (详情:man make.conf)
MASTER_SITE_BACKUP?=        \
        ftp://ftp.hk.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
        ftp://ftp.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
        ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/        (注意这里没换行了)
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
CPUTYPE?=core2                (根据情况调整,起到优化作用:me -> i7)
# sysctl hw.model        (more /usr/share/example/etc/make.conf)
INSTALL=install -C        (比对已安装文件与最新文件 版本号,低于新版本才安装)
:wq

查看CPU支持指令集合:
# grep -i features /var/run/dmesg.boot
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=0x98e3fd<SSE3,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT>
AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
AMD Features2=0x1<LAHF>

查看当前操作系统开启的指令集合:
# cd /usr/share/mk
# make -V CPUTYPE
core2
# make -V MACHINE_CPU
ssse3 sse3 amd64 sse2 sse mmx

tcsh/csh:
# vi ~/.cshrc
setenv        PACKAGEROOT        ftp://ftp.tw.freebsd.org
setenv        PKG_TMPDIR        /var/garbage        (package安装后来这里看看:/var/db/pkg)
:wq
# exit            (注销生效)


sh/bash:
$ vi ~/.profile
export PACKAGEROOT=ftp://ftp.tw.freebsd.org
export PKG_TMPDIR=/var/garbage
:wq
# exit            (注销生效)

#
# pkg_add -r vim                (使用远程服务器安装)
# pkg_version -v(list outdated ports that have a newer version available in the Ports)

# pkg_version -v |grep vim        (首先查出版本号)
# pkg_delete vim-7.3.81
或者:
# pkg_delete /var/db/pkg/vim-7.3.81
# pkg_delete xchat\*                (使用通配符)

# pkg_info |grep -i vim        (首先查出版本号)
# pkg_info -L vim-7.3.81 |less        (显示这个软件包安装的所有文件)
# pkg_info vim-7.3.81

5: 更新 ports ( portmaster)# portsnap fetch extract        (首次更新port使用此命令)
# portsnap fetch update                (日后更新port使用此命令)
vi /etc/crontab
0 5 * * * root /usr/sbin/portsnap cron update(自动更新port)
:wq
安装 portmaster 用于更新 软件包:
# cd /usr/ports/ports-mgmt/portmaster && make install clean
----------------------------------------------------------------------
# ls /usr/local/etc/portmaster.rc.sample
# vim /usr/local/etc/portmaster.rc
# Do not create temporary backup packages before pkg_delete (-B)
NO_BACKUP=Bopt

# Always delete stale distfiles without prompting (-d)
ALWAYS_SCRUB_DISTFILES=dopt

# Do not run 'make config' for ports that need updating (-G)
PM_NO_MAKE_CONFIG=Gopt

# Be verbose (-v)
PM_VERBOSE=vopt

# Save copies of old shared libraries (recommended) (-w)
SAVE_SHARED=wopt

:wq
----------------------------------------------------------------------
# /usr/local/sbin/portmaster -L > portmaster.out        (列出可更新的软件)
===>>> linux_base-fc-4_8
===>>> New version available: linux_base-fc-4_9

# /usr/local/sbin/portmaster linux_base-fc-4_8                (更新 某软件)
# /usr/local/sbin/portmaster -e openoffice.org-2.2.0        (卸载某软件与其依赖)
#
# portmaster -a                        (升级所有已安装的 ports)
# portmaster -af                (always rebuild ports overrides -i)
# portmaster -r

[-R] -r name/glob of port directory in /var/db/pkg
         rebuild the specified port, and all ports that depend on it.The
         list of dependent ports is built according to origin (i.e.,
         category/portname) not by the version number of the installed port.
         So if you do portmaster -r fooport-1.23 and it is necessary to
         restart using -R but the newly installed port is now fooport-1.24 you
         can do portmaster -R -r fooport-1.24 and it should pick up where you
         left off.The -r option can be specified more than once.

# cd /usr/ports/sysutils/bsdadminscripts/ && make install clean
> pkg_libchk                   (检查缺失的动态库,找出有问题的 ports)
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-sbr.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-sbr.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6
Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6
...
...
另一种更新 软件包 的方法:
# make deinstall && make install clean        (前提是你的ports 已经更新!)

下面方法多用于 测试不同版本软件:
# make install                                        (注意没有:clean ,保留下载的源码!)
# make deinstall && make reinstall                (前提是下载的源码没有被清理!)

# make PREFIX=/usr/pkg install clean                (Changing the Install Path)

Cleaning Up Ports:
# make install clean        (clean a port immediately upon install)

You might also want to remove the original distfiles, stored in /usr/ports/distfiles.
# make distclean         (removes the distfiles for the current port and all dependencies)
OR:
# portmaster --clean-distfiles
To clean the entire ports tree:
# make clean -DNOCLEANDEPENDS         (run directly under /usr/ports)

Building Packages:

# make package
This installs the program on the local machine and creates a package in the port’s directory.
Simply copy this package to other systems and run pkg_add(1) to install it.
If you create the directory /usr/ports/packages, the Ports Collection will
create a packages tree in that location. Instead of placing the new package
in the port’s directory, the port will place the package in the appropriate
category under /usr/ports/packages.
--------------------------------------------------------------------------------
LOCAL PACKAGE REPOSITORIES
Remember the PACKAGESITE environment variable? Set that to a path on your local
anonymous FTP server (Chapter 17) or an NFS share (Chapter 8) and put your custom
packages there. You can then use pkg_add -r on your other machines, and they will
automatically grab packages from your local repository.
6:Binary Updates ( only provides patches to the GENERIC kernel)
# freebsd-update fetch                (download the latest updates to your errata branch)
                                ( files stored in /var/db/freebsd-update)
# freebsd-update install        (install the downloaded files)
#
# vi /etc/crontab
0 5 * * * root /usr/sbin/freebsd-update cron (自动更新至 errata-branch)
:wq
Reboot your system ..7:安装 Vim# cd /usr/ports/editors/vim/
# make WITHOUT_X11=yes install clean
# exit        (注销)

# vim ~/.vimrc
set nomodeline                (这个一定要写,目前有这个安装漏洞)
set nocp
set hls is
set ic
set cindent
set autoindent
set backspace=2
set nobackup
set noswapfile
set shiftwidth=2    ( 缩进为2个空格)
set tabstop=2       (TAB 为2个空格)
set softtabstop=2(软制表符 为2个空格)
set expandtab      (缩进 和 制表符用空格代替)
set ruler
set mouse=v
syntax on
"set bg=dark                (更改背景色调/默认为light, " 为注释!)
:wq                        (详情:vimtutor)

# vim ~/.cshrc
setenv        EDITOR        vim
:wq8:使用本地化语言方法一:Class Definitions
# vim /etc/login.conf
chinese:Chinese Users Account:\
        :charset=UTF-8:\
        :lang=zh_CN.UTF-8:\
        :tc=default:
:wq
# cap_mkdb /etc/login.conf        (rebuilds the database file /etc/login.conf.db)
pw usermod jacky -L chinese        (修改 jacky 的 语言环境)
pw useradd jacky -L chinese        (添加 jacky 并使用中文)

# pw usershow jacky
jacky:*:1001:1001:chinese:0:0:jacky:/home/jacky:/bin/tcsh
# su - jacky
> locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_ALL=

方法二:User Definitions
# vim ~/.login_conf
me:\
        :lang=zh_CN.UTF-8:\
        :setenv=LC_CTYPE=zh_CN.UTF-8:\                (字符类型)
        :setenv=LC_COLLATE=zh_CN.UTF-8:\        (字符对比规则)
        :setenv=LC_TIME=zh_CN.UTF-8:\                (时间类型)
        :setenv=LC_NUMERIC=zh_CN.UTF-8:\        (数字类型)
        :setenv=LC_MONETARY=zh_CN.UTF-8:\        (货币类型)
        :setenv=LC_MESSAGES=zh_CN.UTF-8:\        (消息/提示类型)
        :setenv=LC_ALL=zh_CN.UTF-8:\
        :charset=UTF-8:
:wq

PS: 自定义 prompt 和 alias

方法一:全局设置

vim /etc/csh.cshrc
set prompt = "%B%n@%m [%/] $ "        (详情:man csh /%m)
set autolist                        (TAB命令补全功能)
方法二:自定义设置
vim ~/.cshrc
set prompt = "%B%n@%m [%/] # "        (注意空格)
set autolist                (TAB 命令补全功能)
alias cl        clear
alias vi        vim       
alias df        df -h


History:                (默认记录文件:~/.history)
# history -c                (清理当前历史记录)
# history -S                (保存当前历史记录)9: Axel / Aria2下载大文件利器 (MP3、影片、软件等)   wget# cd /usr/ports/ftp/axel && make install clean
# axel -a -n 3 ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2        (详情:man axel)

# axel -S4 ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2                (自动寻找 4 个最快mirror进行下载)

通常我用 wget 下网站        (找到资料就下吧!说不准那天站点没了,还是弄下来方便!)
# wget -r -np -p -k --level=2 http://tldp.org/HOWTO/Linux+IPv6-HOWTO/                (wget默认安装)

Aria2 :多链接下载,轻量,平均4-9MB内存使用量,BitTorrent下载速度2.8MiB/s时CPU占用约6%
# cd /usr/ports/www/aria2 && make install clean

(详情:man aria2c)
# aria2c "http://example.org/mylinux.iso"                (直接下载)

# aria2c "http://host/file.zip" "ftp://host2/file.zip"        (同时从 2 个不同源下载 某文件)

# aria2c -x2 -k1M "http://host/file.zip"                        (-x2:一个server只建立 2 个连接 -k1M:man很详细)

# aria2c -s4 http://host/file.zip                                        (-s:总共启用多少个连接)

# aria2c http://example.org/mylinux.torrent                (BT 下载)

# aria2c 'magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C'         (BT Magent URI)

# aria2c http://example.org/mylinux.metalink                (Metalink)

# aria2c -i files.txt -j2                                                        (Download URIs found in text file -j:同时进行任务数)

Resuming Download:
Usually, you can resume transfer by just issuing same command        (aria2c URI)
if the previous transfer is made by aria2.
If the previous transfer is made by a browser or wget like sequential download manager,
then use -c option to continue the transfer        (aria2c -c URI)

BitTorrent Download:

# aria2c --follow-torrent=mem "http://host/file.torrent"        (download files from remote BT file)
# aria2c --max-upload-limit=40k file.torrent         (download using a local torrent file)

Using Proxy:
For HTTP
aria2c --http-proxy="http://proxy:8080" "http://host/file"
aria2c --http-proxy="http://proxy:8080" \
--no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file"
For FTP
aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file"
Proxy with Authorization
aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
aria2c --http-proxy="http://proxy:8080" \
--http-proxy-user="username" --http-proxy-passwd="password" "http://host/file"

-------------------------------------------------------------------------------------------------------
也可以应用到ports下载中!(非必需,一般来说FreeBSD的 fetch够用了)
# vim /etc/make.conf
FETCH_CMD=/usr/local/bin/axel -a -S4                (-a:显示每个线程状态信息-n:连接数)
DISABLE_SIZE=yes                (开启 此功能!)
:wq

穿越模式:
FETCH_ENV=http_proxy=ur address
FETCH_ENV=ftp_proxy=ur address

或者 使用其他工具:        (proxychains / runsocks)
FETCH_CMD=proxychains axel
FETCH_CMD=runsocks axel

PS:wgetaxel aria2 配置均一样!

FETCH_CMD=/usr/local/bin/wget -c -t 3                (-c:继续以前的下载-t:默认tries =20)
DISABLE_SIZE=yes                (开启 此功能!)

FETCH_CMD=/usr/local/bin/aria2c -s 4                                (-s:开启4 个连接)
DISABLE_SIZE=yes                (开启 此功能!)

(在Aria2速度不行的时候,我发现Axel速度确实可以!正常情况匹敌!)10:Scim-pinyin (fcitx-sunpinyin) (ibus-pinyin)输入法# cd /usr/ports/chinese/scim-pinyin && make install clean
> vim ~/.cshrc
# set scim as the XIMinput server
setenv        XMODIFIERS        @im=SCIM
:wq

# xfce环境下,支持中文默认用英文情况下(Terminal内右键 Input Methods -SCIM)

# cd /usr/ports/chinese/fcitx-sunpinyin && make install clean
> vim ~/.cshrc
setenv        XMODIFIERS        @im=fcitx
setenv        GTK_IM_MODULE        xim
setenv        QT_IM_MODULE        xim
:wq
> vim ~/.xinitrc
#!/bin/sh
/usr/local/bin/fcitx &    # 确保比xfce提前运行!
/usr/local/bin/startxfce4
/usr/home/ko/start-compiz
:wq

# cd /usr/ports/chinese/ibus-pinyin && make install clean
# more /usr/ports/textproc/ibus/pkg-message
-------------------------------------------------------------------
ibus installation finished. To use ibus, please do the following:

If you are using bash, please add following lines to your $HOME/.bashrc:

export XIM=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export XIM_PROGRAM="ibus-daemon"
export XIM_ARGS="--daemonize --xim"

If you are using tcsh, please add following lines to your $HOME/.cshrc:

setenv XIM ibus
setenv GTK_IM_MODULE ibus
setenv QT_IM_MODULE xim
setenv XMODIFIERS @im=ibus
setenv XIM_PROGRAM ibus-daemon
setenv XIM_ARGS "--daemonize --xim"

If you are using KDE4, you may create a shell script in $HOME/.kde4/env,
and add following lines:

#!/bin/sh
export XIM=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export XIM_PROGRAM="ibus-daemon"
export XIM_ARGS="--daemonize --xim"

Following input methods/engines are available in ports:

chinese/ibus-chewing            Chewing engine for IBus
chinese/ibus-pinyin             The PinYin input method
japanese/ibus-anthy             Anthy engine for IBus
japanese/ibus-mozc            Mozc engine for IBus
japanese/ibus-skk               SKK engine for IBus
korean/ibus-hangul            Hangul engine for IBus
textproc/ibus-kmfl            KMFL IMEngine for IBus framework
textproc/ibus-m17n            The m17n IMEngine for IBus framework
textproc/ibus-table             Table based IM framework for IBus

and QT4 input method module, textproc/ibus-qt.

If ibus cannot start or the panel does not appear, please ensure
that you are using up-to-date python.
There's a bug in python 2.5, which may prevent the panel from appearing.
-------------------------------------------------------------------
# vim ~/.xinitrc
#!/bin/sh
/usr/local/bin/ibus-daemon --xim -d    # 确保比xfce提前运行!
/usr/local/bin/startxfce4
:wq

# vim ~/.cshrc
setenv XIM ibus
setenv GTK_IM_MODULE ibus
setenv QT_IM_MODULE xim
setenv XMODIFIERS @im=ibus
setenv XIM_PROGRAM ibus-daemon
setenv XIM_ARGS "--daemonize --xim"
:wqPS:
目前运行fcitx总是时不时的无法使用,切换到scim或者ibus没有任何问题!
这里所说不能使用是,无法进行输入操作! 悲剧。。O_o

ulovko 发表于 2012-06-09 15:52

本帖最后由 ulovko 于 2012-06-09 16:07 编辑

11:Xorg 和 WQY 字库# cd /usr/ports/x11/xorg && make BATCH=YES install clean       

(BATCH=YES: 启用默认配置选项, 不会出现对话框来烦你!)

# Xorg -configure
# mv xorg.conf.new /etc/X11/xorg.conf        (生成 xorg 配置文件)

# vim /etc/rc.conf        (使用 HAL 自动检测键盘和鼠标)
hald_enable="YES"       
dbus_enable="YES"
:wq

# cd /usr/ports/x11-fonts/wqy && make install clean
# vim /etc/X11/xorg.conf
Section "Files"
        FontPath        "/usr/local/lib/X11/fonts/wqy"        (添加 wqy 路径支持)
EndSection

Section "Monitor"
        Identifier        "Monitor0"
        VendorName        "Monitor Vendor"
        ModelName        "Monitor Modle"
        HorizSync        30-107                (水平刷新频率)
        VertRefresh        48-120                (垂直刷新频率)
        Option                "DPMS"                (能源之星/EnergyStar)
EndSection
Section "Screen"
        Identifier        "Screen0"
        Device                "Card0"
        Monitor                "Monitor0"
        DefaultDepth        24
        SubSection        "Display"
                Viewport        0 0
                Depth        24
            Modes        "1024x768"
            Virtual   1366 768
        EndSubsection
EndSection
:wq

PS: 使用 GTF 命令输出刷新频率 如下! 一定要安装 nvidia-settings 否则分辨率永远是 50Hz!
# gtf 1366 768 60

# 1366x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 85.86 MHz
Modeline "1366x768_60.00"85.861366 1440 1584 1800768 769 772 795-HSync +Vsync

# vim /etc/X11/xorg.conf
Section "Monitor"
        Identifier        "Monitor0"
        VendorName        "Monitor Vendor"
        ModelName        "Monitor Modle"
#        HorizSync        30-107                (水平刷新频率)
#       VertRefresh        48-120                (垂直刷新频率)
#       1368x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 85.86 MHz
      Modeline "1368x768_60.00"85.861368 1440 1584 1800768 769 772 795-HSync +Vsync
        Option                "DPMS"                (能源之星/EnergyStar)
EndSection
Section "Screen"
        Identifier        "Screen0"
        Device                "Card0"
        Monitor                "Monitor0"
        DefaultDepth        24
        SubSection        "Display"
                Viewport        0 0
                Depth        24
            Modes        "1366x768"
            Virtual   1366 768
        EndSubsection
EndSection
:wq

PS:启用 ctrl+alt+backspace 退出 Xorg        (默认已关闭该功能)
方法一:
# setxkbmap -option terminate:ctrl_alt_bksp

方法二:
# vim /usr/local/etc/hal/fdi/policy/x11-input.fdi        (hald 会读取该文件)
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
    <match key="info.capabilities" contains="input.keyboard">
      <merge key="input.x11_options.XkbOptions" type="string">terminate:ctrl_alt_bksp</merge>
    </match>
</device>
</deviceinfo>

#vim /etc/X11/xorg.conf
        Section        "ServerLayout"
                        Option        "DontZap"        "off"
        EndSection
:wq

方法三:使用 Xfce4-session-logout
# vim ~/.cshrc
alias        logout        xfce4-session-logout --logout
alias   lock    xflock4
:wq
# source ~/.cshrc
12:Nvidia 驱动
# cd /usr/ports/x11/nvidia-driver && make BATCH=YES install clean
# vim /boot/loader.conf
nvidia_load="YES"                (启动时加载 driver)
linux_enable="YES"
:wq

# cd /usr/ports/x11/nvidia-xconfig/ && make install clean
# rehash

方法一:不开启 compiz-fusion
# nvidia-xconfig        (自动替换/etc/X11/xorg.conf 并备份原文件为:org.conf.backup)

方法二:开启 compiz-fusion
# nvidia-xconfig --add-argb-glx-visuals        (Enable OpenGL)
# nvidia-xconfig --composite                (Enable Composite X extension)
# nvidia-xconfig --depth=24

显卡信息查看 和 分辨率 刷新频率 查看与修改!
(Xorg 内 配置无法起作用,只能通过nvidia-settings来调整!)

# cd /usr/ports/x11/nvidia-settings && make install clean
# rehash
# nvidia-settings13:xfce4# cd /usr/ports/x11-wm/xfce4 && make BATCH=YES install clean
# vim /usr/local/etc/PolicyKit/PolicyLit.conf                (允许用户在 xfce4模式下 reboot 和 shutdown)
<config version="0.1">

        <match action="org.freedesktop.hal.power-management.reboot">
                  <return result="yes"/>
        </match>
        <match action="org.freedesktop.hal.power-management.shutdown">
               <return result="yes"/>
        </match>
</config>


还需要进行如下操作:
# vim /usr/local/etc/polkit-1/localauthority/50-local.d/.pkla


Identity=unix-group:wheel
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
ResultInactive=yes
ResultActive=yes


Identity=unix-group:wheel
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
ResultInactive=yes
ResultActive=yes


% vim ~/.xinitrc                (告诉X 下次启动时执行 Xfce4)
#!/bin/sh
/usr/local/bin/startxfce4
#exec startxfce4        (也可这样写)
:wq


PS: 如果使用了 XDM
% vim ~/.xsession
#!/bin/sh
/usr/local/bin/startxfce4
:wq
% chmod +x ~/.xsession
---------------------------------------------------
Xfce4 回收站地址: ~/.local/share/Trash/files

Xfce4 注销命令:
# vim ~/.cshrc
alias        logout        xfce4-session-logout --logout
alias   lock    xflock4
:wq
# source ~/.cshrc
---------------------------------------------------
Xfce 4 Setting Manager
Themes/Shortcuts/:Window Manager
Background/Icons/display: Desktop Display
File Manager:Display-date
Style: Appearance -xfce dust
Desktop Panel Setup

Terminal Preferences
Appearance - Font - Background(Transparent)
滚动 滑轮 - 收起(打开)终端窗口----------------------------------------------------------------
How to install new themes:
http://wiki.xfce.org/howto/install_new_themes
----------------------------------------------------------------
Xfce4 Plugins:
http://goodies.xfce.org/projects/panel-plugins/start
#安装 Ristretto        (微型图片查看工具)
# cd /usr/ports/graphics/ristretto && make install clean

安装 Task        (图形任务管理器)
# cd /usr/ports/x11/xfce4-taskmanager && make install clean

安装 Power        (电源管理)
# cd /usr/ports/sysutils/xfce4-power-manager && make install clean
# cd /usr/ports/sysutils/xfce4-battery-plugin && make install clean

安装 Notes        (便签)
# cd /usr/ports/deskutils/xfce4-notes-plugin && make install clean

安装 Netload         (网络负载)
# cd /usr/ports/sysutils/xfce4-netload-plugin && make install clean

安装 Weather        (天气预报)
# cd /usr/ports/misc/xfce4-weather-plugin && make install clean

安装 Wavelan        (无线上网)
# cd /usr/ports/sysutils/xfce4-wavelan-plugin && make install clean

PS: 将以上项目在 panel上右键 添加 new item 才可以显示出来!!

我的桌面这样漂亮, 我想做个截屏!在Xfce里怎么做呢?

# cd /usr/ports/
# make quicksearch name=xfce4-screenshooter-plugin
# cd /usr/ports/x11/xfce4-screenshooter-plugin && make install clean
# touch ~/.config/xfce4/xfce4-screenshooter                (没有他工作不了!)
# 进入 keyboard 设置 shotcut        (PrtScr) 或 从菜单栏点击程序


安装 Xfburn        (CD/DVD 刻录工具)
# cd /usr/ports/sysutils/xfburn && make install clean

强大的 命令行刻录工具:                                        (建议使用)
# cd /usr/ports/sysutils/dvd+rw-tools && make install clean
# growisofs -dvd-compat -Z /dev/cd0 -J -R /path/to/data        (刻录 数据DVD)
# growisofs -dvd-compat -Z /dev/cd0=imagefile.iso        (刻录 映像文件)

详情:18.7 创建和使用光学介质(DVD) ==> 官方简体中文教程!

ulovko 发表于 2012-06-09 15:53

本帖最后由 ulovko 于 2012-09-03 09:36 编辑

14:Mplayer/Office/Reader/Gimp/Ristretto/Galculator/Thunderbird/Pidgin/VirtualBox/unix2dos# cd /usr/ports/editors/libreoffice        (安装libreoffice)
# make LOCALIZED_LANG=zh-CN install clean                (添加中文支持)

# cd /usr/ports && make search key=adobe|less                (安装AdobeReader)
# cd /usr/ports/chinese/acroread8-zh_CN && make install clean
# cd /usr/ports/graphics/mupdf && make install clean    (安装mupdf)
# cd /usr/ports/graphics/epdfview && make install clean    (安装epdfview)

# cd /usr/ports/graphics/gimp-help && make config        (保留:EN 和 ZH_CN)
# cd /usr/ports/graphics/gimp && make BATCH=YES install clean         (安装图像处理)
# cd /usr/ports/graphics/gimp-manual-pdf && make install clean

# cd /usr/ports/graphics/ristretto && make install clean        (安装微型图片查看工具)
# cd /usr/ports/math/galculator && make install clean        (安装图形计算器)

# cd /usr/ports/mail/thunderbird && make BATCH=YES install clean (安装雷鸟)
# cd /usr/ports/mail/thunderbird-i18n && make install clean

# cd /usr/ports/net-im/pidgin/ && make install clean        (IM Client 注意端口用8001)
# 成功登陆IRC(irc.freenode.net)之后:
/cs register #ChannelName PasswordChannelDescription(注册自己的Channel)

# cd /usr/ports/converters/unix2dos && make install clean   (unix2dos and dos2unix)

unix2dos and dos2unix are utilities that convert
ASCII files from the DOS cr/lf format to the UNIX
lf format..VirtualBox:# cd /usr/ports/emulators/virtualbox-ose && make install clean

# kldload vboxdrv
or
# echo 'vboxdrv_load="YES"'>>/boot/loader.conf
# pw groupmod vboxusers -m yourusername
% VirtualBox &

=============================================================================

VirtualBox was installed.

You need to load the vboxdrv kernel module via /boot/loader.conf:

vboxdrv_load="YES"

You also have to add all users to your vboxusers group in order to use vbox.

% pw groupmod vboxusers -m jerry

Reboot the machine to load the needed kernel modules.


Bridging Support:
=================

For bridged networking please add the following line to your /etc/rc.conf:

vboxnet_enable="YES"


USB Support:
============

For USB support your user needs to be in the operator group and needs read
and write permissions to the USB device.

% pw groupmod operator -m jerry

Add the following to /etc/devfs.rules (create if it doesn't exist):


add path 'usb/*' mode 0660 group operator

To load these new rule add the following to /etc/rc.conf:

devfs_system_ruleset="system"

Then restart devfs to load the new rules:

% /etc/rc.d/devfs restart
=============================================================================

Qemu:# cd /usr/ports/emulators/qemu && make install clean (add kqemu option)
# kldload {kqemu,if_bridge,if_tap,aio}(必备module)
# kldstat

Create a 10GB qcow2 image to install Windows XP
# qemu-img create -f qcow2 winxp.img 20G

Installing Windows XP ...
# qemu -m 1024 -hda winxp.img -cdrom xp_sp3_vol_x86.iso -boot d -localtime

Boot Windows XP ...
# qemu-system-x86_64-m 1500 -hda winxp.img -cdrom xp_sp3_vol_x86.iso \
-localtime -M pc -smp 2 -soundhw es1370 -usb -enable-kqemu -kernel-kqemu-name winxp

PS: Windows XP 占用CPU 100% 很无奈,所以还是模拟 Windows2000吧(这个速度是最快的!)
或者 用 VirtualBox 安装 Windows XP ...

Qemu 模拟 Win2000
# qemu-img create -f qcow2 win2000.img 10G
# qemu -m 1024 -hda win2000.img -cdrom win2000.iso -boot d -win2k-hack
# qemu-system-x86_64-m 1500 -hda win2000.img -cdrom win2000.iso \
-localtime -M pc -smp 2 -soundhw es1370 -usb -enable-kqemu -kernel-kqemu-name win2000
Qemu : http://forums.freebsd.org/showthread.php?t=175

Mplayer 具体使用:

1. xdpyinfo        (获得使用您的显卡的X服务器所支持的扩展列表) 常见图像接口列表:
X11: 一般性的使用共享内存的X11输出。
XVideo: 一种X11接口扩展,支持任何X11图像的可拖拉。
SDL: 简单直接媒体层。
DGA: 直接图片存取。
SVGAlib: 低层次掌控图片层。

XVideo        (X11扩展接口,用于提高 画面质量)
# xvinfo
X-Video Extension version 2.2
screen #0
no adapters presnet                (表示显卡不支持 XVideo)2. 安装# cd /usr/ports/multimedia/mplayer                (安装mplayer)
# make WITH_LANG=zh_CN install clean        (选中vdpau显卡加速等需要的选项!)3. 第一次启动前% cd /usr/ports/multimedia/mplayer
% make install-user                (自动建立: ~/.mplayer)


要播放一个文件,如 testfile.avi, 可以通过各种视频接口当中的某一个去设置 -vo 选项:

% mplayer -vo xv testfile.avi
% mplayer -vo sdl testfile.avi
% mplayer -vo x11 testfile.avi
# mplayer -vo dga testfile.avi
# mplayer -vo 'sdl:dga' testfile.avi
                                        (详情:man mplayer /-vo)
# mplayer -gui -vo x11 testfile.avi        (图形界面, 我保证你不会用)
常用命令:# mplayer -fs -zoom -vo xv,x11 testfile.avi        (全屏模式,不支持xv 则使用x11,你会不支持xv?)
# mplayer -ontop -vo xv testfile.avi                (置顶播放)
# mplayer -vf screenshot -vo xv testfile.avi        (屏幕截图,截图保存到当前目录,按键:s)
# mplayer -ss 01:33:00 -vo xv testfile.avi        (选择播放起始位置)

# mplayer -osdlevel 3        testfile.avi                (音量 + 搜索 + 计时器 + 百分比 + 总时间)
# mplayer -cache 4096 testfile.avi                (设定缓冲区:KBytes)

# cd ~/audio/;ls |cut -d' ' -f1 > music.lst        (制作文件列表,文件名不要留空格)
# mplayer -loop 0 -playlist ~/audio/music.lst        (无限循环播放列表)

# mplayer \
http://file2.top100.cn/201110042113/A3C42BFC4C75FAC143DC3DDBEF3D821D/\
Special_40202/M0040202001.mp3                        (Stream From HTTP)

# mplayer 不支持 SWF,建议拖到 浏览器里播放!

KeyBoard Control:
up and down        (Seek forward/backward 1 minute)
pgup and pgdown        (Seek forward/backward 10 minutes)
[ and ]                (Decrease/Increase current playback speed by 10%)
{ and }                (Halve/Double current playback speed)
BACKSPACE        (Reset playback speed to normal)

Playlist:
< and >                (Go backward/forward in the playlist)
ENTER                (Go forward in the playlist, even over the end)
p / SPACE        (Pause, pressing agin unpauses)
q / ESC                (Stop playing and quit)

Sound:
9 and 0                (Decrease/Increase volume)
( and )         (Adjust audio balance in favor of left/right channel)
m                (Mute sound)

OSD States:
o                (Toggle OSD states: none/ seek/ seek+ timer/seek+ timer+ total time)
# mplayer -osdlevel 3        testfile.avi
-------------------------------------------------------------
设定开始的OSD模式.

0      只有字幕
1      音量 + 搜索(默认)
2      音量 + 搜索 + 计时器 + 百分比
3      音量 + 搜索 + 计时器 + 百分比 + 总时间

Subtitle:
v                (Toggle subtitle visibility)
j                (Cycle through the available subtitles)
y and g                (Step forward/backward in the subtile list)
F                (Toggle displaying "forced subtitles")
a                (Toggle subtitle alignment: top/ middle/ bottom)
r and t                (Move subtitles up/ down)

ScreenShot:
s                (-vf screenshot only)
S                (-vf screentshot only, Start/ Stop taking screenshots)
I                (Show filename on the OSD)
P                (show progression bar, elapsed time and total duration on the OSD)

FullScreen & Stay-On-Top :
f                (Toggle fullscreen, also see -fs -zoom)
T                (Toggle stay-on-top, also see -ontop)-------------------------------------------------------------
为了让 mplayer 的命令行不是太长,使用者可以通过建立一个文件
来设定如下默认选项:# vim ~/.mplayer/config
vo=vdpau        # 使用 vdpau 输出设备播放
fs=yes                # 全屏
ontop=yes        # 置顶
zoom=yes        # 允许改变窗口大小
noaspect=yes        # 缩放时保持高宽比
osdlevel=3        # 显示 当前播放时间 和 总时间
:wq-------------------------------------------------------------要播放 DVD, 需要把 testfile.avi 改为 dvd://N -dvd-device DEVICE。
这里 N 是要播放的节目编号, 而 DEVICE 则是 DVD-ROM 的设备节点。例如,要播放 /dev/dvd 的第三个节目

# mplayer -vo xv dvd://3 -dvd-device /dev/dvd

注意: 可以在编译 MPlayer 时, 通过 WITH_DVD_DEVICE 来指定默认的 DVD 设备。
系统内定的默认设备是 /dev/acd0。 更多细节, 请参考 port 的 Makefile。
最后,mplayer 可以把DVD题目(title)抓取成为 .vob 文件。
为了从DVD中导出第二个题目,请输入:

# mplayer -dumpstream -dumpfile out.vob dvd://2 -dvd-device /dev/dvd
  输出文件 out.vob 将是 MPEG 并且可以被这部份描述的其它 “包” 利用。
--------------------------------------------------------------------
文件:

/etc/mplayer/mplayer.conf

                系统范围的设置

~/.mplayer/config

                用户设置

~/.mplayer/input.conf

        输入绑定(完整按键列表参见’mplayer −input keylist’的输出)

~/.mplayer/gui.conf

        GUI配置文件

~/.mplayer/gui.pl
               
        GUI播放列表

~/.mplayer/font/

        字体目录(里面必须有一个font.desc文件和.RAW后缀的文件)

~/.mplayer/DVDkeys/

        破解的CSS密钥

字幕文件按以下顺序搜索(比如播放/mnt/movie/movie.avi文件):

/mnt/cdrom/movie.sub
~/.mplayer/sub/movie.sub
~/.mplayer/default.sub

ulovko 发表于 2012-06-09 15:53

本帖最后由 ulovko 于 2012-07-20 11:09 编辑

15:Using Linux Mode        (MacromediaFlash插件没有FBSD版,用Linux wrapper运行其flash版本)# kldload linux                (加载进来一会用)
# cd /usr/ports/emulators/linux_base-f10 && make BATCH=YES install distclean
# vim /etc/rc.conf
linux_enable="YES"
:wqPS: 说良心话,着个FLASH 在firefox里面跑 倒是比较稳定的,在chromium里面跑 特容易崩溃 O_o ..

16:Firefox 和 MacromediaFlash 和 Add-onsand Chromium# cd /usr/ports/www/firefox/ && make BATCH=YES install clean
vim /boot/loader.conf
sem_load="YES"                        (加载module)
:wq

# cd /usr/ports/www/firefox-i18n/ && make install clean        (中文支持)
# cd /usr/ports/www/nspluginwrapper && make install clean        (提供flash支持)
# cd /usr/ports/www/linux-f10-flashplugin10 && make install clean        (安装flash插件)

# 安装版本11的话不需要 挂载 linproc , 我安装的11 ..
# cd /usr/ports/www/linux-f10-flashplugin11 && make install clean        (安装flash插件)

#ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so \
/usr/local/lib/browser_plugins/        (做个symbolic Link,官方文档:browser_plugins是个目录,没有的话要创建)
                                                                (目录不行:请直接连接,我就是 直接链接的!)
# rehash                                                (Updates FreeBSD's path environment variables)
<For instance when you have installed software you may not be able
to run the executables without specifying the path.
rehash solves your problem most of the times>

% nspluginwrapper -v -a -i                        (插件必须由每个用户运行 nspluginwrapper 安装)
<上面的命令会复制 browser_plugins目录下生成的文件 到:~/.mozilla/plugins/npwrapper.libflashplayer.so>

# 安装版本11(linux-f10-flashplugin11)的话不需要 进行下面的操作 挂载 linproc , 我安装的11 ..

实现播放flash 动画效果:
# mount       -t linprocfs linproc /usr/compat/linux/proc        (挂载 linproc ,事实上 procfs存在安全问题FBSD早就废弃了)

# vim /etc/fstab
linproc                /usr/compat/linux/proc        linprocfs                rw        0        0        (开机自动挂载)
:wq

Add-ons:
firefox - Edit - Preferences - Manage Add-ons - Search
Ease Link:                                        (转换迅雷、QQ旋风、快车专用链接)
Adblock Plus:                                (屏蔽广告)
Adblock Plus Preferences - Filters -Add filter subscription - Update all subscriptions

NetVideoHunter Video Downloader:                (视频地址检测)
NetVideoHunter Options - Show in statusbar - Enable the capturing of SWF files
epubreader for firefox

PS: npviewer.bin 该进程为flash进程,当关闭flash后不会自动结束,

# sockstat |grep npviewer.bin

会看到N多 占用内存超多 我的办法是:

# echo 'alias killflash killall npviewer.bin'>>~/.cshrc

Chromium
# cd /usr/ports/www/chromium/ && make install clean
echo 'alias        chrome        chrome --incognito'>>~/.cshrc

17:compiz-fusion (3D效果)# cd /usr/ports/x11-wm/compiz-fusion && make BATCH=YES install clean

% vim start-compiz
#!/bin/sh
compiz --replace --sm-disable --ignore-desktop-hints ccp &
emerald --replace &
:wq
% chmod +x start-compiz
% echo "start-compiz" >> ~/.xinitrc

PS: 如果使用了 XDM
% echo "start-compiz" >> ~/.xsession
% startx
简单设置:
在CompizConfig设置管理器>首选项>在后端选择GConf Configuration Backed (开启即时生效)
接着> 启用 最小化效果、窗口装饰、震颤窗口、移动窗口、调整窗口大小、应用程序切换条,基本的3D桌面竣工!
官方教程(Installing and using Compiz Fusion):http://www.freebsd.org/doc/en/articles/compiz-fusion/index.html
18:Security
监视ports所有软件包安全:# cd /usr/ports/ports-mgmt/portaudit && make all install clean        (portaudit)
# portaudit -Fda                (更新数据库, periodic每天自动更新!)
# portaudit -a                (开始检查)
输出如下:

Affected package: cups-base-1.1.22.0_1
Type of problem: cups-base -- HPGL buffer overflow vulnerability.
Reference: <http://www.FreeBSD.org/ports/portaudit/40a3bca2-6809-11d9-a9e7-0001020eed82.html>
1 problem(s) in your installed packages found.
You are advised to update or deinstall the affected package(s) immediately.
<如果你执意要安装不安全的软件请:make install DISABLE_VULNERABILITIES=YES clean>
----------------------------------------------------------------------------------------------------------
# cd /usr/ports/ports-mgmt/pkg_cleanup && make install clean       (关于删除冗余ports )FROM: http://wiki.freebsdchina.org/software/p/pkg_cutleaves
RootKit:
# cd /usr/ports/security/rkhunter && make install clean                (rkhunter )

Sudo:
# cd /usr/ports/security/sudo && make install clean
# visudo
ko ALL=(root) !/usr/bin/passwd, /usr/bin/passwd *, !/usr/bin/passwd root, /usr/bin/su -

Integrity:
# cd /usr/ports/security/aide && make install clean                        (aide )
# cd /usr/ports/security/tripwire && make install clean                (tripwire )

可用 mtree检查完整性:
# mtree -x -ic -K cksum -K md5digest -K sha256digest -p / \
-X /home/mwlucas/mtree-exclude > /tmp/mtree.savedspec
(Use -Xto specify a file containing a list of paths not to match)

# mtree -f savedspec -f newspec > mtree.differences

AntiVirus:
# cd /usr/ports/security/clamav && make install clean                        (clamav )
# cd /usr/ports/security/squidclamav && make install clean        (squidclamav )

Monitor:
# cd /usr/ports/net-mgmt/cacti && make install clean                        (cacti)
# cd /usr/ports/net-mgmt/nagios && make install clean                (nagios)
# cd /usr/ports/security/nessus && make install clean                (nessus)
# cd /usr/ports/sysutils/lsof && make install clean                        (lsof)
# cd /usr/ports/sysutils/pidof && make install clean                        (pidof)
# cd /usr/ports/security/nmap && make install clean                        (nmap)
# cd /usr/ports/net/wireshark && make install clean                        (wireshark)
# cd /usr/ports/net/tcpdump && make install clean                        (tcpdump: 系统自带)

Unix Password Cracker:
# cd /usr/ports/security/crack && make install clean                        (/usr/local/crack/Crack)

Rar Zip 7Z Password Cracker:
# cd /usr/ports/security/rarcrack && make install clean                (rarcrack )

Ciphertext Cracker:
# cd /usr/ports/security/rainbowcrack && make install clean        (rainbowcrack )

----------------------------------------------------------------------------------------------------------
Tweaking User Security
# vim /etc/login.access                                (Rules are checked on a first-fit basis)
-:ALL EXCEPT wheel:console               
-:ALL EXCEPT wheel dns webmasters:ALL

# vim /etc/login.conf                                        (Restricting System Usage)
:maxproc-cur: 30:\                                        (Current Resource Limits)
:maxproc-max: 60:\                                        (Maximum Resource Limits)

:passwd_format=md5:\                                (md5 orblf)
:minpasswordlen=28:\                                (Password length Limits)
:mixpasswordcase=true:\                                (Password case Limits)
:wq
If present, FreeBSD complains if the user changes his password to an all lowercase word.
# cap_mkdb /etc/login.conf        (rebuilds the database file /etc/login.conf.db)

PS:
in fact, /etc/hosts.equiv and its related services have bitten even
top-notch security experts who thought they could use it safely. I suggest
leaving this file empty and perhaps even making it immutable !
19:SSHClient:
ssh user@host                                (需要密码 ,远程主机信息保存在:~/.ssh/known_hosts)
scp filename user@host:~/
sftp user@host

# ssh-keygen -lf /etc/ssh/ssh_host_dsa_key.pub        (检查SSH 主机 PubKey 的 fingerprint,Client端会自动下载并比对)

用户密码被强制到28位怎么记得住啊?                (用PubKey实现无密码登录 !)

Client:
ssh-keygen -t rsa -b 2048                                                (为本机 生成 一对密匙)
scp .ssh/id_rsa.pub user@host:~/                                (把PubKey 发到Server 用户家目录)

Server:
cd ~user; mkdir .ssh                                                       
cat id_rsa.pub >> .ssh/authorized_keys                        (Server 把Client端 PubKey添加到 授权文件内)

Client:
ssh user@host                                                                        (现在可以无密码登录喽!)20:Insecure Console (Single-user mode)

When you boot FreeBSD in single-user mode, you get a root command
prompt. This is fine for your laptop and works nicely for servers in your
corporate datacenter, but what about machines in untrusted facilities?
# vim /etc/ttys
console none                 unknown off secure
To make the console require a root login when booted into single-usermode,
change the secure to insecure.# vim /etc/ttys
console none                 unknown off insecure
:wq# 平衡球 Neverball (http://neverball.org/download.php) 支持Windows/Linux/BSD/Mac
# cd /usr/ports/games/neverball && make install clean
#配置文件一览:
> cat ~/.cshrc
alias h                history 25
alias j                jobs -l
alias la        ls -a
alias lf        ls -FA
alias ll        ls -lA -G -D "%D\ %T"
#> man strftime
# %T    is equivalent to “%H:%M:%S”.
# %F    is equivalent to “%Y-%m-%d”.
# %D    is equivalent to “%m/%d/%y”.

setenv        EDITOR        vim

# added by ko BEGIN
setenv        PACKAGEROOT        ftp://ftp.freebsd.org
setenv        PKG_TMPDIR        /var/garbage
setenv        XMODIFIERS        @im=fcitx
setenv        GTK_IM_MODULE        xim
setenv        QT_IM_MODULE        xim
set        autolist
alias        cl        clear
alias        df        df -h
alias        lock        xflock4
alias        chrome        chrome --incognito
alias        adobe        acroread8
alias        killflash        killall npviewer.bin
# ps axo pid,comm,pcpu,pmem
# history -c        (clear history)
# wget -r -np -p -k --level=2 http://freebsd.org/handbook/
# added by ko END

ulovko 发表于 2012-06-09 16:08

本帖最后由 ulovko 于 2012-09-08 19:57 编辑

21: PF Basic Setup
详见 CU Blog: http://blog.chinaunix.net/uid-25256412-id-3223143.html
http://cupic.img168.net/bbsfile/forum/201206/09/11004733b99d9jm4nm9a4c.png

还有一点关于WIFI !
着个其实不用写什么了!
官方文档有简体中文,写的非常详细!
下载页面:ftp://ftp.freebsd.org/pub/FreeBSD/doc/zh_CN.GB2312/books/handbook/
在线观看:http://docs.freebsd.org/doc/9.0-RELEASE/usr/share/doc/freebsd/zh_CN.GB2312/books/handbook/network-wireless.html

10> Reserved for future use....


Basic FreeBSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751834-1-1.html
Basic NetBSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751787-1-1.html
Basic OpenBSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751016-1-1.html
Basic Debian Setup as Desktop: http://bbs.chinaunix.net/thread-3751791-1-1.html
Basic Ubuntu Setup as Desktop: http://bbs.chinaunix.net/thread-3746337-1-1.html
Basic Fedora Setup as Desktop: http://bbs.chinaunix.net/thread-3761672-1-1.html
Basic PC-BSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751857-1-1.html

一个有意思的命令,或许您用的到! ^_^

kisswen 发表于 2012-06-09 17:38

楼主不错哦~发了好多安装文档

ulovko 发表于 2012-06-09 17:58

回复 6# kisswen


    互联网的实质就是 信息共享麽,顺便推广BSD让后来的人 好入门!:emn31:

obsd178 发表于 2012-06-09 19:54

很好很强大严重支持!{:2_172:}

action08 发表于 2012-06-12 16:42

ulovko 发表于 2012-06-09 15:51 static/image/common/back.gif
FROM: http://blog.chinaunix.net/uid-25256412-id-2939430.html
1: 使用 USB 安装 FreeBSD(设备编号自行 ...


lz,其他可以先放一放,麻烦设置一个快速好用的url源放到较前的章节

ulovko 发表于 2012-06-12 16:45

回复 11# action08


    谢谢提议,不过还是要从头开始,上来就写这个不合适!^_^:emn31:
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: Basic FreeBSD Setup as Desktop (FreeBSD占有率99.8% ^_^)