免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 49524 | 回复: 114
打印 上一主题 下一主题

[FreeBSD] Basic FreeBSD Setup as Desktop (FreeBSD占有率99.8% ^_^) [复制链接]

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-06-09 15:51 |只看该作者 |倒序浏览
本帖最后由 ulovko 于 2013-04-06 11:14 编辑

官方简体中文安装手册:http://www.freebsd.org/doc/zh_CN/books/handbook/
官方en_US安装手册:http://www.freebsd.org/doc/en_US ... 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(设备编号自行修改)
  1. # dd if=9.1-RELEASE-amd64-memstick.img of=/dev/da1 bs=10240 conv=sync
复制代码
Tips: Windows环境下如何将 *.img 写入USB ?
Image Writer for Windows:  https://launchpad.net/win32-image-writer/+download
win32diskimager-binary.zip (5.4 MB, 下载次数: 6987)


安装过程中会询问关于网络配置,会许有的人配置不正确导致无法连接internet!
给出兄弟我的配置:

  1. > more /etc/rc.conf
  2. hostname="ko.kotzu.org"
  3. defaultrouter="192.168.1.1"

  4. ifconfig_alc0="inet 192.168.1.5 netmask 255.255.255.0"
  5. ifconfig_alc0_ipv6="inet6 accept_rtadv"

  6. # Wireless
  7. #wlans_ath0="wlan0"
  8. #ifconfig_wlan0="WPA DHCP"
  9. #ifconfig_wlan0="WPA inet 192.168.1.5 netmask 255.255.255.0"
  10. #ifconfig_wlan0_ipv6="inet6 accept_rtadv"

复制代码
还有一点关于WIFI !
着个其实不用写什么了!
官方文档有简体中文,写的非常详细!

下载页面:ftp://ftp.freebsd.org/pub/FreeBS ... 312/books/handbook/
在线观看:http://docs.freebsd.org/doc/9.0- ... twork-wireless.html


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

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

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

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

  8. # Microphone     (话筒)
  9. # mixer

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

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

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

  8. # vi /etc/ntp.conf
  9. server 1.cn.pool.ntp.org
  10. server 1.asia.pool.ntp.org
  11. server 2.asia.pool.ntp.org        (配置time server)
  12. :wq
  13. # /etc/rc.d/ntpd restart
复制代码
3:更新 source 和 doc
  1. # cp /usr/share/examples/cvsup/standard-supfile /etc
  2. # cd /etc/; vi standard-supfile
  3. *default host=cvsup.tw.freebsd.org (修改此项)
  4. *default base=/var/db
  5. *default prefix=/usr
  6. *default release=cvs tag=RELENG_9_0
  7. *default delete use-rel-suffix
  8. *default compress
  9. src-all
  10. doc-all tag=.   (添加此项)
  11. :wq
  12. # csup /etc/standard-supfile
复制代码
4:ports 和 package 文件下载地址设置

  1. # vi /etc/make.conf                (详情:man make.conf)
  2. MASTER_SITE_BACKUP?=        \
  3.         ftp://ftp.hk.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
  4.         ftp://ftp.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
  5.         ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/        (注意这里没换行了)
  6. MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
  7. CPUTYPE?=core2                (根据情况调整,起到优化作用:me -> i7)
  8. # sysctl hw.model        (more /usr/share/example/etc/make.conf)
  9. INSTALL=install -C        (比对已安装文件与最新文件 版本号,低于新版本才安装)
  10. :wq

  11. 查看CPU支持指令集合:
  12. # grep -i features /var/run/dmesg.boot
  13. 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>
  14.   Features2=0x98e3fd<SSE3,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT>
  15.   AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
  16.   AMD Features2=0x1<LAHF>

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

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


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

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

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

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

复制代码
5: 更新 ports ( portmaster)
  1. # portsnap fetch extract          (首次更新port使用此命令)
  2. # portsnap fetch update                (日后更新port使用此命令)
  3. vi /etc/crontab
  4. 0 5 * * * root /usr/sbin/portsnap cron update  (自动更新port)
  5. :wq
复制代码
安装 portmaster 用于更新 软件包:

  1. # cd /usr/ports/ports-mgmt/portmaster && make install clean
  2. ----------------------------------------------------------------------
  3. # ls /usr/local/etc/portmaster.rc.sample
  4. # vim /usr/local/etc/portmaster.rc
  5. # Do not create temporary backup packages before pkg_delete (-B)
  6. NO_BACKUP=Bopt

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

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

  11. # Be verbose (-v)
  12. PM_VERBOSE=vopt

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

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

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

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

  34. # cd /usr/ports/sysutils/bsdadminscripts/ && make install clean
  35. > pkg_libchk                   (检查缺失的动态库,找出有问题的 ports)
  36. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-sbr.so misses libpng.so.6
  37. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-sbr.so misses libpng.so.6
  38. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
  39. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
  40. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
  41. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6
  42. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6
  43. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6
  44. Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6
  45. Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6
  46. Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6
  47. Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6
  48. ...
  49. ...
  50. 另一种更新 软件包 的方法:
  51. # make deinstall && make install clean        (前提是你的ports 已经更新!)

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

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

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

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

  64. Building Packages:

  65. # make package
  66. This installs the program on the local machine and creates a package in the port’s directory.
  67. Simply copy this package to other systems and run pkg_add(1) to install it.
  68. If you create the directory /usr/ports/packages, the Ports Collection will
  69. create a packages tree in that location. Instead of placing the new package
  70. in the port’s directory, the port will place the package in the appropriate
  71. category under /usr/ports/packages.
  72. --------------------------------------------------------------------------------
  73. LOCAL PACKAGE REPOSITORIES
  74. Remember the PACKAGESITE environment variable? Set that to a path on your local
  75. anonymous FTP server (Chapter 17) or an NFS share (Chapter 8) and put your custom
  76. packages there. You can then use pkg_add -r on your other machines, and they will
  77. automatically grab packages from your local repository.
复制代码
6:Binary Updates ( only provides patches to the GENERIC kernel)

  1. # freebsd-update fetch                (download the latest updates to your errata branch)
  2.                                 ( files stored in /var/db/freebsd-update)
  3. # freebsd-update install        (install the downloaded files)
  4. #
  5. # vi /etc/crontab
  6. 0 5 * * * root /usr/sbin/freebsd-update cron (自动更新至 errata-branch)
  7. :wq
  8. Reboot your system ..
复制代码
7:安装 Vim
  1. # cd /usr/ports/editors/vim/
  2. # make WITHOUT_X11=yes install clean
  3. # exit        (注销)

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

  23. # vim ~/.cshrc
  24. setenv        EDITOR        vim
  25. :wq
复制代码
8:使用本地化语言
  1. 方法一:Class Definitions
  2. # vim /etc/login.conf
  3. chinese:Chinese Users Account:\
  4.         :charset=UTF-8:\
  5.         :lang=zh_CN.UTF-8:\
  6.         :tc=default:
  7. :wq
  8. # cap_mkdb /etc/login.conf        (rebuilds the database file /etc/login.conf.db)
  9. pw usermod jacky -L chinese        (修改 jacky 的 语言环境)
  10. pw useradd jacky -L chinese        (添加 jacky 并使用中文)

  11. # pw usershow jacky
  12. jacky:*:1001:1001:chinese:0:0:jacky:/home/jacky:/bin/tcsh
  13. # su - jacky
  14. > locale
  15. LANG=zh_CN.UTF-8
  16. LC_CTYPE="zh_CN.UTF-8"
  17. LC_COLLATE="zh_CN.UTF-8"
  18. LC_TIME="zh_CN.UTF-8"
  19. LC_NUMERIC="zh_CN.UTF-8"
  20. LC_MONETARY="zh_CN.UTF-8"
  21. LC_MESSAGES="zh_CN.UTF-8"
  22. LC_ALL=

  23. 方法二:User Definitions
  24. # vim ~/.login_conf
  25. me:\
  26.         :lang=zh_CN.UTF-8:\
  27.         :setenv=LC_CTYPE=zh_CN.UTF-8:\                (字符类型)
  28.         :setenv=LC_COLLATE=zh_CN.UTF-8:\        (字符对比规则)
  29.         :setenv=LC_TIME=zh_CN.UTF-8:\                (时间类型)
  30.         :setenv=LC_NUMERIC=zh_CN.UTF-8:\        (数字类型)
  31.         :setenv=LC_MONETARY=zh_CN.UTF-8:\        (货币类型)
  32.         :setenv=LC_MESSAGES=zh_CN.UTF-8:\        (消息/提示类型)
  33.         :setenv=LC_ALL=zh_CN.UTF-8:\
  34.         :charset=UTF-8:
  35. :wq

  36. PS: 自定义 prompt 和 alias

  37. 方法一:全局设置

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


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

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

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

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

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

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

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

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

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

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

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

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

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

  22. BitTorrent Download:

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

  25. Using Proxy:
  26. For HTTP
  27. aria2c --http-proxy="http://proxy:8080" "http://host/file"
  28. aria2c --http-proxy="http://proxy:8080" \
  29. --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file"
  30. For FTP
  31. aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file"
  32. Proxy with Authorization
  33. aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
  34. aria2c --http-proxy="http://proxy:8080" \
  35. --http-proxy-user="username" --http-proxy-passwd="password" "http://host/file"

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

  42. 穿越模式:
  43. FETCH_ENV=http_proxy=ur address
  44. FETCH_ENV=ftp_proxy=ur address

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

  48. PS:wget  axel aria2 配置均一样!

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

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

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

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

  7. # cd /usr/ports/chinese/fcitx-sunpinyin && make install clean
  8. > vim ~/.cshrc
  9. setenv        XMODIFIERS        @im=fcitx
  10. setenv        GTK_IM_MODULE        xim
  11. setenv        QT_IM_MODULE        xim
  12. :wq
  13. > vim ~/.xinitrc
  14. #!/bin/sh
  15. /usr/local/bin/fcitx &    # 确保比xfce提前运行!
  16. /usr/local/bin/startxfce4
  17. /usr/home/ko/start-compiz
  18. :wq

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

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

  24. export XIM=ibus
  25. export GTK_IM_MODULE=ibus
  26. export QT_IM_MODULE=xim
  27. export XMODIFIERS=@im=ibus
  28. export XIM_PROGRAM="ibus-daemon"
  29. export XIM_ARGS="--daemonize --xim"

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

  31. setenv XIM ibus
  32. setenv GTK_IM_MODULE ibus
  33. setenv QT_IM_MODULE xim
  34. setenv XMODIFIERS @im=ibus
  35. setenv XIM_PROGRAM ibus-daemon
  36. setenv XIM_ARGS "--daemonize --xim"

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

  39. #!/bin/sh
  40. export XIM=ibus
  41. export GTK_IM_MODULE=ibus
  42. export QT_IM_MODULE=xim
  43. export XMODIFIERS=@im=ibus
  44. export XIM_PROGRAM="ibus-daemon"
  45. export XIM_ARGS="--daemonize --xim"

  46. Following input methods/engines are available in ports:

  47. chinese/ibus-chewing            Chewing engine for IBus
  48. chinese/ibus-pinyin             The PinYin input method
  49. japanese/ibus-anthy             Anthy engine for IBus
  50. japanese/ibus-mozc              Mozc engine for IBus
  51. japanese/ibus-skk               SKK engine for IBus
  52. korean/ibus-hangul              Hangul engine for IBus
  53. textproc/ibus-kmfl              KMFL IMEngine for IBus framework
  54. textproc/ibus-m17n              The m17n IMEngine for IBus framework
  55. textproc/ibus-table             Table based IM framework for IBus

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

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

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

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
2 [报告]
发表于 2012-06-09 15:52 |只看该作者
本帖最后由 ulovko 于 2012-06-09 16:07 编辑

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

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

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

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

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

  14. Section "Monitor"
  15.         Identifier        "Monitor0"
  16.         VendorName        "Monitor Vendor"
  17.         ModelName        "Monitor Modle"
  18.         HorizSync        30-107                (水平刷新频率)
  19.         VertRefresh        48-120                (垂直刷新频率)
  20.         Option                "DPMS"                (能源之星/EnergyStar)
  21. EndSection
  22. Section "Screen"
  23.         Identifier        "Screen0"
  24.         Device                "Card0"
  25.         Monitor                "Monitor0"
  26.         DefaultDepth        24
  27.         SubSection        "Display"
  28.                 Viewport        0 0
  29.                 Depth        24
  30.               Modes        "1024x768"
  31.               Virtual   1366 768
  32.         EndSubsection
  33. EndSection
  34. :wq

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

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

  39. # vim /etc/X11/xorg.conf
  40. Section "Monitor"
  41.         Identifier        "Monitor0"
  42.         VendorName        "Monitor Vendor"
  43.         ModelName        "Monitor Modle"
  44. #        HorizSync        30-107                (水平刷新频率)
  45. #       VertRefresh        48-120                (垂直刷新频率)
  46. #       1368x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 85.86 MHz
  47.         Modeline "1368x768_60.00"  85.86  1368 1440 1584 1800  768 769 772 795  -HSync +Vsync
  48.         Option                "DPMS"                (能源之星/EnergyStar)
  49. EndSection
  50. Section "Screen"
  51.         Identifier        "Screen0"
  52.         Device                "Card0"
  53.         Monitor                "Monitor0"
  54.         DefaultDepth        24
  55.         SubSection        "Display"
  56.                 Viewport        0 0
  57.                 Depth        24
  58.               Modes        "1366x768"
  59.               Virtual   1366 768
  60.         EndSubsection
  61. EndSection
  62. :wq

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

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

  76. #  vim /etc/X11/xorg.conf
  77.         Section        "ServerLayout"
  78.                         Option        "DontZap"        "off"
  79.         EndSection
  80. :wq

  81. 方法三:使用 Xfce4-session-logout
  82. # vim ~/.cshrc
  83. alias        logout        xfce4-session-logout --logout
  84. alias   lock    xflock4
  85. :wq
  86. # source ~/.cshrc
复制代码
12:Nvidia 驱动

  1. # cd /usr/ports/x11/nvidia-driver && make BATCH=YES install clean
  2. # vim /boot/loader.conf
  3. nvidia_load="YES"                (启动时加载 driver)
  4. linux_enable="YES"
  5. :wq

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

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

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

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

  16. # cd /usr/ports/x11/nvidia-settings && make install clean
  17. # rehash
  18. # nvidia-settings
复制代码
13:xfce4
  1. # cd /usr/ports/x11-wm/xfce4 && make BATCH=YES install clean
  2. # vim /usr/local/etc/PolicyKit/PolicyLit.conf                (允许用户在 xfce4模式下 reboot 和 shutdown)
  3. <config version="0.1">

  4.         <match action="org.freedesktop.hal.power-management.reboot">
  5.                     <return result="yes"/>
  6.         </match>
  7.         <match action="org.freedesktop.hal.power-management.shutdown">
  8.                  <return result="yes"/>
  9.         </match>
  10. </config>


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

  13. [Restart]
  14. Identity=unix-group:wheel
  15. Action=org.freedesktop.consolekit.system.restart
  16. ResultAny=yes
  17. ResultInactive=yes
  18. ResultActive=yes

  19. [Shutdown]
  20. Identity=unix-group:wheel
  21. Action=org.freedesktop.consolekit.system.stop
  22. ResultAny=yes
  23. ResultInactive=yes
  24. ResultActive=yes


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


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

  38. Xfce4 注销命令:
  39. # vim ~/.cshrc
  40. alias        logout        xfce4-session-logout --logout
  41. alias   lock    xflock4
  42. :wq
  43. # source ~/.cshrc
  44. ---------------------------------------------------
  45. Xfce 4 Setting Manager
  46. Themes/Shortcuts/:  Window Manager
  47. Background/Icons/display: Desktop Display
  48. File Manager:Display-date
  49. Style: Appearance -xfce dust
  50. Desktop Panel Setup

  51. Terminal Preferences
  52. Appearance - Font - Background(Transparent)
  53. 滚动 滑轮 - 收起(打开)终端窗口
复制代码
----------------------------------------------------------------
How to install new themes:
  http://wiki.xfce.org/howto/install_new_themes
----------------------------------------------------------------
Xfce4 Plugins:
http://goodies.xfce.org/projects/panel-plugins/start

  1. #安装 Ristretto        (微型图片查看工具)
  2. # cd /usr/ports/graphics/ristretto && make install clean

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

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

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

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

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

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

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

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

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


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

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

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

复制代码

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
3 [报告]
发表于 2012-06-09 15:53 |只看该作者
本帖最后由 ulovko 于 2012-09-03 09:36 编辑

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

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

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

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

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

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

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

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

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

  7. =============================================================================

  8. VirtualBox was installed.

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

  10. vboxdrv_load="YES"

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

  12. % pw groupmod vboxusers -m jerry

  13. Reboot the machine to load the needed kernel modules.


  14. Bridging Support:
  15. =================

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

  17. vboxnet_enable="YES"


  18. USB Support:
  19. ============

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

  22. % pw groupmod operator -m jerry

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

  24. [system=10]
  25. add path 'usb/*' mode 0660 group operator

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

  27. devfs_system_ruleset="system"

  28. Then restart devfs to load the new rules:

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

复制代码
Qemu:
  1. # cd /usr/ports/emulators/qemu && make install clean (add kqemu option)
  2. # kldload {kqemu,if_bridge,if_tap,aio}  (必备module)
  3. # kldstat

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

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

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

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

  13. Qemu 模拟 Win2000
  14. # qemu-img create -f qcow2 win2000.img 10G
  15. # qemu -m 1024 -hda win2000.img -cdrom win2000.iso -boot d -win2k-hack
  16. # qemu-system-x86_64  -m 1500 -hda win2000.img -cdrom win2000.iso \
  17. -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服务器所支持的扩展列表)
  1. 常见图像接口列表:
  2. X11: 一般性的使用共享内存的X11输出。
  3. XVideo: 一种X11接口扩展,支持任何X11图像的可拖拉。
  4. SDL: 简单直接媒体层。
  5. DGA: 直接图片存取。
  6. SVGAlib: 低层次掌控图片层。

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


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

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

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

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

  9. # mplayer \
  10. [url]http://file2.top100.cn/201110042113/A3C42BFC4C75FAC143DC3DDBEF3D821D/[/url]\
  11. Special_40202/M0040202001.mp3                        (Stream From HTTP)

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

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

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

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

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

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

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

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

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

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

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

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

  12. /etc/mplayer/mplayer.conf

  13.                 系统范围的设置

  14. ~/.mplayer/config

  15.                 用户设置

  16. ~/.mplayer/input.conf

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

  18. ~/.mplayer/gui.conf

  19.         GUI配置文件

  20. ~/.mplayer/gui.pl
  21.                
  22.         GUI播放列表

  23. ~/.mplayer/font/

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

  25. ~/.mplayer/DVDkeys/

  26.         破解的CSS密钥

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

  28. /mnt/cdrom/movie.sub
  29. ~/.mplayer/sub/movie.sub
  30. ~/.mplayer/default.sub
复制代码

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
4 [报告]
发表于 2012-06-09 15:53 |只看该作者
本帖最后由 ulovko 于 2012-07-20 11:09 编辑

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

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

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

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

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

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

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

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

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

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

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

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

  34. # sockstat |grep npviewer.bin

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

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

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

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

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

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

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

  1. RootKit:
  2. # cd /usr/ports/security/rkhunter && make install clean                (rkhunter )

  3. Sudo:
  4. # cd /usr/ports/security/sudo && make install clean
  5. # visudo
  6. ko ALL=(root) !/usr/bin/passwd, /usr/bin/passwd [A-Za-z]*, !/usr/bin/passwd root, /usr/bin/su -

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

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

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

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

  18. Monitor:
  19. # cd /usr/ports/net-mgmt/cacti && make install clean                        (cacti)
  20. # cd /usr/ports/net-mgmt/nagios && make install clean                (nagios)
  21. # cd /usr/ports/security/nessus && make install clean                (nessus)
  22. # cd /usr/ports/sysutils/lsof && make install clean                        (lsof)
  23. # cd /usr/ports/sysutils/pidof && make install clean                        (pidof)
  24. # cd /usr/ports/security/nmap && make install clean                        (nmap)
  25. # cd /usr/ports/net/wireshark && make install clean                        (wireshark)
  26. # cd /usr/ports/net/tcpdump && make install clean                        (tcpdump: 系统自带)

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

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

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

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

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

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

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

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

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

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

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

  13. Client:
  14. 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?
  1. # vim /etc/ttys
  2. console none                 unknown off secure
复制代码
To make the console require a root login when booted into single-usermode,
change the secure to insecure.
  1. # vim /etc/ttys
  2. console none                 unknown off insecure
  3. :wq
复制代码
  1. # 平衡球 Neverball (http://neverball.org/download.php) 支持Windows/Linux/BSD/Mac
  2. # cd /usr/ports/games/neverball && make install clean
  3. #
复制代码
配置文件一览:

  1. > cat ~/.cshrc
  2. alias h                history 25
  3. alias j                jobs -l
  4. alias la        ls -a
  5. alias lf        ls -FA
  6. alias ll        ls -lA -G -D "%D\ %T"
  7. #> man strftime
  8. # %T    is equivalent to “%H:%M:%S”.
  9. # %F    is equivalent to “%Y-%m-%d”.
  10. # %D    is equivalent to “%m/%d/%y”.

  11. setenv        EDITOR        vim

  12. # added by ko BEGIN
  13. setenv        PACKAGEROOT        ftp://ftp.freebsd.org
  14. setenv        PKG_TMPDIR        /var/garbage
  15. setenv        XMODIFIERS        @im=fcitx
  16. setenv        GTK_IM_MODULE        xim
  17. setenv        QT_IM_MODULE        xim
  18. set        autolist
  19. alias        cl        clear
  20. alias        df        df -h
  21. alias        lock        xflock4
  22. alias        chrome        chrome --incognito
  23. alias        adobe        acroread8
  24. alias        killflash        killall npviewer.bin
  25. # ps axo pid,comm,pcpu,pmem
  26. # history -c        (clear history)
  27. # wget -r -np -p -k --level=2 http://freebsd.org/handbook/
  28. # added by ko END
复制代码

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
5 [报告]
发表于 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


还有一点关于WIFI !
着个其实不用写什么了!
官方文档有简体中文,写的非常详细!

下载页面:ftp://ftp.freebsd.org/pub/FreeBS ... 312/books/handbook/
在线观看:http://docs.freebsd.org/doc/9.0- ... twork-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

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

论坛徽章:
2
狮子座
日期:2013-08-26 15:25:32金牛座
日期:2013-09-05 15:45:36
6 [报告]
发表于 2012-06-09 17:38 |只看该作者
楼主不错哦~发了好多安装文档

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
7 [报告]
发表于 2012-06-09 17:58 |只看该作者
回复 6# kisswen


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

论坛徽章:
0
8 [报告]
发表于 2012-06-09 19:54 |只看该作者
很好很强大严重支持!{:2_172:}

论坛徽章:
223
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-05-10 19:22:58操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:10操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
9 [报告]
发表于 2012-06-12 16:42 |只看该作者
ulovko 发表于 2012-06-09 15:51
FROM: http://blog.chinaunix.net/uid-25256412-id-2939430.html
1: 使用 USB 安装 FreeBSD(设备编号自行 ...



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

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
10 [报告]
发表于 2012-06-12 16:45 |只看该作者
回复 11# action08


    谢谢提议,不过还是要从头开始,上来就写这个不合适!^_^
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP