官方en_US安装手册:
官方简体中文安装手册 下载:
- # dd if=9.1-RELEASE-amd64-memstick.img of=/dev/da1 bs=10240 conv=sync
Image Writer for Windows: https://launchpad.net/win32-image-writer/+download
- 等待重启完成 ...
- # 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)
- (找到声卡 和 显卡加载相应驱动)
- # 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
- # 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 restart
- # 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
- # 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)
- # dmidecode (DMI table decoder)
- INSTALL=install -C (比对已安装文件与最新文件 版本号,低于新版本才安装)
- :wq
- 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 (注销生效)
查看CPU支持指令集合:
- # grep -i features /var/run/dmesg.boot
- Features=0xbfebfbff
- Features2=0x98e3fd
- AMD Features=0x28100800
- AMD Features2=0x1
查看当前操作系统开启的指令集合:
- # cd /usr/share/mk
- # make -V CPUTYPE
- core2
- # make -V MACHINE_CPU
- ssse3 sse3 amd64 sse2 sse mmx
- # 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 -aG -x ? --no-confirm
- # portmaster -r[-R] -r name/glob of port directory in /var/db/pkgrebuild the specified port, and all ports that depend on it. Thelist 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 torestart using -R but the newly installed port is now fooport-1.24 youcan do portmaster -R -r fooport-1.24 and it should pick up where youleft 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.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-sbr.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-uca.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/thunarx-2/thunar-wallpaper-plugin.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6Thunar-1.3.0: /usr/local/lib/xfce4/panel/plugins/libthunar-tpa.so misses libpng.so.6......
- ports替换升级法(以perl为例):
- > more /usr/ports/UPDATING
- AFFECTS: users of lang/perl*
- AUTHOR: skv@FreeBSD.org
- lang/perl5.16 is out. If you want to switch to it from, for example
- lang/perl5.12, that is:
- Portupgrade users:
- 0) Fix pkgdb.db (for safety):
- pkgdb -Ff
- 1) Reinstall new version of Perl (5.16):
- env DISABLE_CONFLICTS=1 portupgrade -o lang/perl5.16 -f perl-5.12.\*
- 2) Reinstall everything that depends on Perl:
- portupgrade -fr perl
- Portmaster users:
- portmaster -o lang/perl5.16 lang/perl5.12
- Conservative:
- portmaster p5-
- Comprehensive (but perhaps overkill):
- portmaster -r perl-
- Note: If the "perl-" glob matches more than one port you will need to
- specify the name of the Perl directory in /var/db/pkg explicitly.
- The default version for Perl has also been changed from 5.12 to 5.14.
- > more /usr/ports/UPDATING
- 另一种更新 软件包 的方法:
- # 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.
- --------------------------------------------------------------------------------
- # 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 ..
- # cd /usr/ports/editors/vim/
- # make WITHOUT_X11=yes install clean
- # exit (注销)
- # vim ~/.vimrc
- set nomodeline (这个一定要写,目前有这个安装漏洞)
- set nocp
- set hls is
- set ic
- set autoindent
- set backspace=2
- syntax on
- "set bg=dark (更改背景色调/默认为light, " 为注释!)
- :wq (详情:vimtutor)
- # vim ~/.cshrc
- setenv EDITOR vim
- :wq
- 方法一: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=
- vim /etc/csh.cshrc
- set prompt = "%B%n@%m [%/] $ " (详情:man csh /%m)
- set autolist (TAB命令补全功能)
- # 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 (wget默认安装)
- Aria2 :多链接下载,轻量,平均4-9MB内存使用量,BitTorrent下载速度2.8MiB/s时CPU占用约6%
- # cd /usr/ports/www/aria2 && make install clean
- (详情:man aria2c)
- # aria2c "" (直接下载)
- # aria2c "http://host/file.zip" "ftp://host2/file.zip" (同时从 2 个不同源下载 某文件)
- # aria2c -x2 -k1M "" (-x2:一个server只建立 2 个连接 -k1M:man很详细)
- # aria2c -s4 (-s:总共启用多少个连接)
- # aria2c mylinux.torrent (BT 下载)
- # aria2c 'magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C' (BT Magent URI)
- # aria2c 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 "" (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="" ""
- aria2c --http-proxy="" \
- --no-proxy="localhost,127.0.0.1,192.168.0.0/16" ""
For FTP - aria2c --ftp-proxy="" "ftp://host/file"
Proxy with Authorization - aria2c --http-proxy="" ""
- aria2c --http-proxy="" \
- --http-proxy-user="username" --http-proxy-passwd="password" ""
- -------------------------------------------------------------------------------------------------------
- 也可以应用到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:wget axel 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速度确实可以!正常情况匹敌!)
- # cd /usr/ports/chinese/scim-pinyin && make install clean
- > vim ~/.cshrc
- # set scim as the XIM input server
- setenv XMODIFIERS @im=SCIM
- :wq
- # xfce环境下,支持中文默认用英文情况下(Terminal内右键 Input Methods -SCIM)
- # cd /usr/ports/chinese/fcitx-sunpinyin && make install clean
- # cd /usr/ports/chinese/fcitx-configtool && 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
- :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
- # 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.86 1366 1440 1584 1800 768 769 772 795 -HSync +Vsync
- ection "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.86 1368 1440 1584 1800 768 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
alias lock xflock4
- # 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-settings
- # cd /usr/ports/x11-wm/xfce4 && make BATCH=YES install clean
- # vim /usr/local/etc/PolicyKit/PolicyLit.conf (允许用户在 xfce4模式下 reboot 和 shutdown)
-
-
reboot"> -
-
shutdown"> -
还需要进行如下操作:- # vim /usr/local/etc/polkit-1/localauthority/50-local.d/.pkla
- [Restart]
- Identity=unix-group:wheel
- Action=org.freedesktop.consolekit.system.restart
- ResultAny=yes
- ResultInactive=yes
- ResultActive=yes
- [Shutdown]
- 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
alias lock xflock4
- ----------------------------------------------------------------
- How to install new themes:
- ----------------------------------------------------------------
- Xfce4 Plugins:
- #安装 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 才可以显示出来!!
- # 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 (刻录 映像文件)
- # 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 Password ChannelDescription (注册自己的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):
- [system=10]
- 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
- 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 \
- \
- 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
- # kldload linux (加载进来一会用)
- # cd /usr/ports/emulators/linux_base-f10 && make BATCH=YES install distclean
- # vim /etc/rc.conf
- linux_enable="YES"
- :wq
- # 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
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
- # 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
- 监视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: <
- 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 [A-Za-z]*, !/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 -X to 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 or blf)
: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 !
Client:
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 (现在可以无密码登录喽!)
- 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
Heroes of Newerth 是一款类似于“魔兽争霸3”中 DotA 场景的游戏,支持 Windows,Linux,Mac 操作系统。
HON 提供了比 Warcraft III DotA 场景更好的图形效果,并且支持 VoIP。
Heroes of Newerth 游戏特点:
- 自动选择水平相近的队友和对手
- 个人战绩统计
- 包括来自 DotA 和 Savage 2 世界的各种英雄
- 内嵌地图编辑器
- 掉线的玩家可以再度加入游戏
- 可以创建不允许早退玩家的房间
- 服务器-客户端联网模式,不再“一人卡众人杯具”
- 快捷键自定义
- 内嵌语音聊天
- # cd /usr/ports/games/neverball && make install clean
- # ~/.cshrc
- # added by ko BEGIN
- setenv PACKAGEROOT ftp://ftp.freebsd.org
- setenv PKG_TMPDIR /var/garbage
- 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
- # added by ko END
- # cd /usr/ports/net-p2p/mldonkey
- # make WITHOUT_GUI=yes WITHOUT_X11="YES" WITHOUT_TK="YES" install clean
- %ln -s ~/.mldonkey/incoming ~
- 在/etc/rc.conf加入mlnet_enable=“YES” 和 mlnet_user=“用户名非root“
-
- %/usr/local/etc/rc.d/mlnet start (注意是%)
- 1.%telnet 127.0.0.1 4000
- 2.>auth admin ""
- 3.>passwd 键入你想设置的密码
- 4.>set allowed_ips "127.0.0.1 192.168.0.0/24" (根据你自己的情况设置)
- 5.>save
- 6.>exit
- (mldonkey需要一个非root用户来运行。我习惯在装系统的时候就建立一个wheel组的用户,所以这里我就不用在建立用户了。)
-
- 现在就可以在浏览器里输入:localhost:4080来设置和下载文件了。
-
- 默认mldonkey的文件夹是隐藏的,在用户目录下。找下载好的电影有点不方便,把incoming连接到你的用户目录下就好了。当然你也可以自己修改默认下载路径。
-
- mldonkey简单设置:
-
- enable_kademlia的选项为true――打开kad减少对服务器的依赖。
- max_hard_upload_rate默认是10 (全局最大上传,根据自己情况设置)
- max_hard_download_rate默认是50 (全局最大下载,根据自己情况设置)
- mldonkey有两组两组带宽控制模式,通过点击Bandwidth toggle来更改带宽控制模式。
- =添加服务器列表:=
-
- 先删除原先的服务器列表下载地址。点击Options>Web infos找到server.met行然后点击前面的Remove
- 然后点击Add Url输入“server.met ”(不包括引号,放心都是安全服务器列表。)再点击前面的DL也就是DownLoad。
- =添加kad节点信息=
-
- 点击Options>Web infos>Add Url输入nodes.gzip
- =添加firefox for mldonkey插件=
-
- 下载地址:~dyna/mldonkey/