這裏顯示兩個版本的差異處。
| Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
|
freebsd:basic [2007/08/07 21:30] wenpei sshd |
freebsd:basic [2011/04/28 01:17] (目前版本) wenpei |
||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== SSHD ====== | ====== SSHD ====== | ||
| + | 啟動系統內建的 SSH Server | ||
| # vim /etc/rc.conf | # vim /etc/rc.conf | ||
| + | 增加一行: | ||
| sshd_enable="YES" | sshd_enable="YES" | ||
| 行 7: | 行 9: | ||
| ====== .cshrc ====== | ====== .cshrc ====== | ||
| + | 安裝 gnuls | ||
| + | # cd /usr/ports/misc/gnuls ; make install clean | ||
| + | |||
| <code> | <code> | ||
| + | alias ls gnuls --color=auto | ||
| + | |||
| setenv EDITOR vim | setenv EDITOR vim | ||
| setenv PAGER less | setenv PAGER less | ||
| 行 45: | 行 52: | ||
| WITH_CHARSET=utf8 | WITH_CHARSET=utf8 | ||
| WITH_XCHARSET=complex | WITH_XCHARSET=complex | ||
| + | </code> | ||
| + | |||
| + | ====== pkg_add ====== | ||
| + | 如果執行 pkg_add -r xxxxxx 時出現: | ||
| + | <code> | ||
| + | Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-release/Latest/xxxxxx.tbz: File unavailable (e.g., file not found, no access) | ||
| + | pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-release/Latest/xxxxxx.tbz' by URL | ||
| + | </code> | ||
| + | |||
| + | 代表套件庫裡面找不到檔案,可先到 ftp://ftp.tw.freebsd.org/pub/FreeBSD/ports/i386/ 網址確認有哪些版本可用,然後執行 | ||
| + | # setenv PACKAGESITE ftp://ftp.tw.freebsd.org/pub/FreeBSD/ports/i386/packages-X-release/Latest/ | ||
| + | 將 X 替換成適合的值 | ||
| + | |||
| + | 來更換預設的套件下載站。 | ||
| + | |||
| + | ====== portupgrade ====== | ||
| + | ===== 換版本分之 ===== | ||
| + | 原本一直使用的主要版本,有可能會因為版本大更新,而做出一個分支,但是不想要換太大,可以透過 portupgrade 來切換到分支版本。例如:postfix 分支從 2.6 升級到 2.8,並且另外獨立了一個 postfix26 分支出來,此時可透過 | ||
| + | |||
| + | portupgrade -o mail/postfix26 postfix | ||
| + | |||
| + | 指令,將 postfix 的版本維持在 2.6 版。 | ||
| + | |||
| + | 另外,由 php5 要保持在 php52,要升級的套件非常龐大,可以利用別人寫好的 bash 語法來完成: | ||
| + | |||
| + | for d in `portversion -vL= | grep php5 | awk '{print $1}'`; do OLD=`echo $d | cut -d - -f 1,2`; NEW=`echo $d | sed s/php5/php52/ | cut -d - -f 1,2`; THEPATH=`whereis $NEW | awk '{print $2}' | cut -d / -f 4,5`; echo "portupgrade -o $THEPATH $OLD && \\"; done | ||
| + | |||
| + | 會產生所有需要升級的指令,將結果複製貼上去執行就可以了! | ||
| + | |||
| + | ====== Port 安裝時 MD5/SHA256 錯誤 ====== | ||
| + | 如果在 Ports 編譯時,出現類似訊息: | ||
| + | <code> | ||
| + | # make | ||
| + | ===> Extracting for py26-sqlite3-2.6.2_1 | ||
| + | => No MD5 checksum recorded for python/Python-2.6.2.tgz. | ||
| + | => No SHA256 checksum recorded for python/Python-2.6.2.tgz. | ||
| + | => No suitable checksum found for python/Python-2.6.2.tgz. | ||
| + | *** Error code 1 | ||
| + | |||
| + | Stop in /usr/ports/databases/py-sqlite3. | ||
| + | </code> | ||
| + | |||
| + | 代表 /usr/ports/distfiles/python/Python-2.6.2.tgz 檔案下載時錯誤,刪除後重編就可以了。 | ||
| + | |||
| + | 根據出現錯誤的套件,刪除相對的檔案。 | ||
| + | |||
| + | ====== vimrc ====== | ||
| + | <code> | ||
| + | set nocompatible | ||
| + | |||
| + | " Vim5 and later versions support syntax highlighting. Uncommenting the next | ||
| + | " line enables syntax highlighting by default. | ||
| + | syntax on | ||
| + | set nu | ||
| + | |||
| + | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | ||
| + | " Text options | ||
| + | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | ||
| + | set noexpandtab | ||
| + | set shiftwidth=4 | ||
| + | set softtabstop=4 | ||
| + | set tabstop=4 | ||
| + | set backspace=2 | ||
| + | set formatoptions+=mM " so that vim can reformat multibyte text(eg. Chinese) | ||
| + | |||
| + | set enc=utf-8 | ||
| + | set fileencoding=utf-8 | ||
| + | set termencoding=big5 | ||
| + | |||
| + | " Favorite file types | ||
| + | set ffs=unix,dos | ||
| + | nmap <leader>fd :set ff=dos<cr> | ||
| + | nmap <leader>fu :set ff=unix<cr> | ||
| + | |||
| + | " If using a dark background within the editing area and syntax highlighting | ||
| + | " turn on this option as well | ||
| + | set background=dark | ||
| + | |||
| + | " Uncomment the following to have Vim jump to the last position when | ||
| + | " reopening a file | ||
| + | if has("autocmd") | ||
| + | au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | ||
| + | \| exe "normal g'\"" | endif | ||
| + | endif | ||
| + | |||
| + | " Uncomment the following to have Vim load indentation rules according to the | ||
| + | " detected filetype. Per default Debian Vim only load filetype specific | ||
| + | " plugins. | ||
| + | if has("autocmd") | ||
| + | filetype indent on | ||
| + | endif | ||
| + | |||
| + | " The following are commented out as they cause vim to behave a lot | ||
| + | " differently from regular Vi. They are highly recommended though. | ||
| + | set showcmd " Show (partial) command in status line. | ||
| + | "set showmatch " Show matching brackets. | ||
| + | "set ignorecase " Do case insensitive matching | ||
| + | "set smartcase " Do smart case matching | ||
| + | "set incsearch " Incremental search | ||
| + | "set autowrite " Automatically save before commands like :next and :make | ||
| + | "set hidden " Hide buffers when they are abandoned | ||
| + | "set mouse=a " Enable mouse usage (all modes) in terminals | ||
| + | set ruler | ||
| + | |||
| + | |||
| + | """""""""""""""""""""""""""""" | ||
| + | " Status line | ||
| + | """""""""""""""""""""""""""""" | ||
| + | set laststatus=2 " Always hide the status line | ||
| + | |||
| + | "func! CurDir() | ||
| + | " return substitute(getcwd(), "/home/tacolin", "~/", "g") | ||
| + | "endfunc | ||
| + | |||
| + | " Format the status line | ||
| + | "set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L | ||
| + | set statusline=\ %F%m%r%h\ %w\ [%{&ff}]\ [ASCI:\%3.3b]\ [POS:%3l,%3v:%3p%%]\ [LN:%L] | ||
| </code> | </code> | ||