顯示具有 Linux 標籤的文章。 顯示所有文章

vsftpd 安裝與設定  

2009年11月16日 星期一 , Posted by 曾easy in

vsftpd 安裝與設定



tar zxvf vsftpd-2.2.1.tar.gz
cd vsftpd-2.2.1
make
make install
(以下可參考INSTALL檔案)
useradd nobody
mkdir /usr/share/empty/
cp vsftpd.conf /etc
cp RedHat/vsftpd.pam /etc/pam.d/ftp


修改/etc/vsftpd.conf 如下

anonymous_enable=NO

local_enable=YES

userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.user_list

chroot_local_user=YES


將允許登入FTP的系統帳號寫入/etc/vsftpd.user_list
vi /etc/vsftpd.user_list

test1

★ 修改使用者家目錄,要不要讓使用者用shell登入
vi /etc/passwd
test1:x:501:501::/ftproot:/sbin/nologin

★ 如有需要加入開機就執行服務
vi /etc/rc.local

/usr/local/sbin/vsftpd &


大功告成!

有cscope設置的 .vimrc  

2009年10月5日 星期一 , Posted by 曾easy in

有cscope設置的 .vimrc


let g:miniBufExplSplitToEdge = 0

set hls " hlsearch
set nolbr " linebreak
set ar " autoread
set ruler " show the cursor position all the time
set rulerformat=%63(%f\ %m%=%l,%c%V\ %P%)
set showcmd " display incomplete commands

set bs=2 " bacespace, allow backspacing over everything in insert mode
set enc=big5 " encoding
set mps+=<:> " matchpairs
set pt=<F10> " pastetoggle, switch between paste mode and not
set tags=tags; " search tags files recursively upward to root directory

" Auto-indent
set sts=4 " softtabstop
set sw=4 " shiftwidth
set cin " autoindent

" linux kernel code style
set shiftwidth=4
set cmdheight=2

set cino=:0t0
set fo=tcroq " formatoptions

if glob("`find $HOME/.vim/doc/ -name \*.txt -print`") != ""
helptags ~/.vim/doc
en

" color setting
syntax enable
set background=light
hi Comment ctermfg=Green
hi Search term=reverse ctermbg=4 ctermfg=7
hi Normal ctermbg=black ctermfg=white

" This tests to see if vim was configured with the '--enable-cscope' option
" when it was compiled. If it wasn't, time to recompile vim...
if has("cscope")

""""""""""""" Standard cscope/vim boilerplate

" use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
set cscopetag

" check cscope for definition of a symbol before checking ctags: set to 1
" if you want the reverse search order.
set csto=0

" add any cscope database in current directory
"if filereadable("cscope.out") "errors in VIM 7.0
if exists("cscope.out") "OK in VIM 7.0
cs add cscope.out
" else add the database pointed to by environment variable
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif

" show msg when any other cscope db added
set cscopeverbose


""""""""""""" My cscope/vim key mappings
"
" The following maps all invoke one of the following cscope search types:
"
" 's' symbol: find all references to the token under cursor
" 'g' global: find global definition(s) of the token under cursor
" 'c' calls: find all calls to the function name under cursor
" 't' text: find all instances of the text under cursor
" 'e' egrep: egrep search for the word under cursor
" 'f' file: open the filename under cursor
" 'i' includes: find files that include the filename under cursor
" 'd' called: find functions that function under cursor calls
"
" Below are three sets of the maps: one set that just jumps to your
" search result, one that splits the existing vim window horizontally and
" diplays your search result in the new window, and one that does the same
" thing, but does a vertical split instead (vim 6 only).
"
" I've used CTRL-\ and CTRL-@ as the starting keys for these maps, as it's
" unlikely that you need their default mappings (CTRL-\'s default use is
" as part of CTRL-\ CTRL-N typemap, which basically just does the same
" thing as hitting 'escape': CTRL-@ doesn't seem to have any default use).
" If you don't like using 'CTRL-@' or CTRL-\, , you can change some or all
" of these maps to use other keys. One likely candidate is 'CTRL-_'
" (which also maps to CTRL-/, which is easier to type). By default it is
" used to switch between Hebrew and English keyboard mode.
"
" All of the maps involving the <cfile> macro use '^<cfile>$': this is so
" that searches over '#include <time.h>" return only references to
" 'time.h', and not 'sys/time.h', etc. (by default cscope will return all
" files that contain 'time.h' as part of their name).


" To do the first type of search, hit 'CTRL-\', followed by one of the
" cscope search types above (s,g,c,t,e,f,i,d). The result of your cscope
" search will be displayed in the current window. You can use CTRL-T to
" go back to where you were before the search.
"

nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>


" Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type
" makes the vim window split horizontally, with search result displayed in
" the new window.
"
" (Note: earlier versions of vim may not have the :scs command, but it
" can be simulated roughly via:
" nmap <C-@>s <C-W><C-S> :cs find s <C-R>=expand("<cword>")<CR><CR>

nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR>


" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one (vim 6 and up only)
"
" (Note: you may wish to put a 'set splitright' in your .vimrc
" if you prefer the new window on the right instead of the left

nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@><C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>


""""""""""""" key map timeouts
"
" By default Vim will only wait 1 second for each keystroke in a mapping.
" You may find that too short with the above typemaps. If so, you should
" either turn off mapping timeouts via 'notimeout'.
"
"set notimeout
"
" Or, you can keep timeouts, by uncommenting the timeoutlen line below,
" with your own personal favorite value (in milliseconds):
"
"set timeoutlen=4000
"
" Either way, since mapping timeout settings by default also set the
" timeouts for multicharacter 'keys codes' (like <F1>), you should also
" set ttimeout and ttimeoutlen: otherwise, you will experience strange
" delays as vim waits for a keystroke after you hit ESC (it will be
" waiting to see if the ESC is actually part of a key code like <F1>).
"
"set ttimeout
"
" personally, I find a tenth of a second to work well for key code
" timeouts. If you experience problems and have a slow terminal or network
" connection, set it higher. If you don't set ttimeoutlen, the value for
" timeoutlent (default: 1000 = 1 second, which is sluggish) is used.
"
"set ttimeoutlen=100

endif

freeradius 安裝  

2009年7月10日 星期五 , Posted by 曾easy in


■ freeradius + MySQL認證 (OS: RHEL5)

tar zxvf freeradius-server-2.1.6.tar.gz
cd freeradius-server-2.1.6
./configure
make
make install

接著用phpMyAdmin建立一個radius的資料庫 (使用前, mysql service要開啟,沒登入過密碼要設定)


mysqladmin -u root password YOURPASSWORD
cd /usr/lcdocal/etc/raddb/sql/mysql
mysql -uroot -pYOURPASSWORD radius < schema.sql
vi /usr/local/etc/raddb/sql.conf
vi /usr/local/etc/raddb/clients.conf
vi /usr/local/etc/raddb/sites-enabled/default

編緝sites-enabled/default 可以將unix, files mark掉, 將sql unmark
在radius.conf, 記得uncomment 下面這行
#$INCLUDE sql.conf



■ 自訂attribute
新增一檔案
vi /usr/local/share/freeradius/dictionary.vmax
檔案內容如下:

VENDOR          VMAX                    7777

BEGIN-VENDOR    VMAX
#
#       Standard attribute
#

ATTRIBUTE       VMAX-group                      1       string


END-VENDOR      VMAX


vi /usr/local/share/freeradius/dictionary
在適當位置加入
$INCLUDE dictionary.vmax

這樣freeradius就會認得VMAX-group了
便可在radreply, radgroupreply 使用此attribute.



使用 rsync 備份  

2009年5月5日 星期二 , Posted by 曾easy in

需求: local 拷貝備份, local 檔案藉由 rsh/ssh 傳送至遠方主機


一.安裝

tar zxvf rsync-3.0.5.tar.gz
cd rsync-3.0.5
./configure
make
make install

二.設定rsync server
1. 規劃建立備份目錄區
2. 設定: /etc/xinetd.d/rsync
3. 設定: /etc/rsyncd.conf
4. 設定: 密碼檔
----------------------------
1. 規劃建立備份目錄區:
建議準備一個容量較大且獨立的分割區, 並在其中開好備份目錄, 例如 /viewvc

2. 設定: /etc/xinetd.d/rsync

vi /etc/xinetd.d/rsync
#--- 檔案內容如下 ---
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/bin/rsync
server_args = --daemon
log_on_failure += USERID
}

3. 設定: /etc/rsyncd.conf

vi /etc/rsyncd.conf
#--- 檔案內容如下 ---
[k100cvs]
#只開放本機,因為我只是想作本機異質性備份
hosts allow = 127.0.0.1
hosts deny = *
path = /viewvc
auth users = k100
uid = root
gid = root
secrets file = /etc/rsyncd.secrets
read only = no

4. 設定密碼檔:
rsyncd.secrets 的內容很簡單, 格式為 帳號:密碼

如以下例子:
k100:k100password

接下來, 要將 rsyncd.secrets 這個密碼檔的檔案屬性設為 root 擁有, 且權限要設為 600, 否則無法備份成功!

因此, 請下:

chown root.root /etc/rsyncd.secrets
chmod 600 /etc/rsyncd.secrets

三. 設定 rsync client

步驟:

1. 設定密碼檔
2. 測試 rsync 執行指令
3. 將 rsync 指令放入工作排程 (crontab or cron.daily)
----------------------------
1. 假設把密碼檔放在 /root/rsyncd.secrets, 內容只要含有密碼一行即可:
k100password

注意: rsyncd.secrets 的權限屬性必須設為 600

chmod 600 /root/rsyncd.secrets

2. 測試指令是否可以成功?

/usr/local/bin/rsync -rvlHpogDtS --password-file=/root/rsyncd.secrets /usr/local/apache --exclude apache /logs k100@127.0.0.1::k100cvs

若出現傳輸目錄檔案的畫面, 即表示測試成功.
3.將 rsync 指令放入工作排程
我的系統有cron.daily
所以只要自己加個script放在 /etc/cron.daily目錄就好了

vi /etc/cron.daily/viewvc
#--- 檔案內容如下 ---
#!/bin/sh
/usr/local/bin/rsync -rvlHpogDtS --password-file=/root/rsyncd.secrets /cvsroot/K100 k100@127.0.0.1::k100cvs



改變 console prompt 的顏色  

2009年5月1日 星期五 , Posted by 曾easy in

在 Linux bash 中欲設定提示字元的顏色等參數,需修改環境變數 PS1



而色彩編碼即為 ASCII 所用的編碼:

ANSI 黑 紅 綠 黃 藍 紫 靛 白
前景 30 31 32 33 34 35 36 37
背景 40 41 42 43 44 45 46 47


將以下指令寫入~/.bash_profile

export PS1="\[\033[1;34m\]\u\[\033[0;37m\]@\h\[\033[0;33m\]:\w$\[\033[0m\] "


其中 [1;34m\] 中 1 代表要高亮度顯示,否則設為 0

\u :user name
\h :host name
\w:working directory

上面那個例子會設定 user name 為藍色、 host 為白色、當前目錄為黃色


參考--Bash Prompt HOWTO--


vi(vim) + trinity + tabbar  

, Posted by 曾easy in


安裝trinity plugin後, vim 可以很像 SourceInsight的環境


先至 http://www.vim.org/
下載vim-7.2.tar.bz2

tar jxvf vim-7.2.tar.bz2
cd vim72
./configure --enable-cscope --enable-multibyte
make
make install


接著至 http://www.vim.org/scripts/script.php?script_id=2347
下載 trinity.zip
將解開的所有東西, 複製到/usr/local/share/vim/vim72/plugin/
接著設定家目錄下的.vimrc加入以下

" Open and close all the three plugins on the same time
nmap <F8> :TrinityToggleAll<CR>

" Open and close the srcexpl.vim separately
nmap <F9> :TrinityToggleSourceExplorer<CR>

" Open and close the taglist.vim separately
nmap <F10> :TrinityToggleTagList<CR>

" Open and close the NERD_tree.vim separately
nmap <F11> :TrinityToggleNERDTree<CR>


至http://www.vim.org/scripts/script.php?script_id=1338
下載tabbar.vim,也是複製到/usr/local/share/vim/vim72/plugin/

安裝成功後畫面如最上面的圖片
通常按F8 所有視窗都出來後,我會再按F9關掉Source explorer的視窗。因為Source explorer 會導致我主視窗速度變慢 (因為它試著利用 ctags 資料庫去找跟游標所在位置有關的程式片段。)



將Big5字串轉換為 UTF-8字串 (C code example)  

2009年4月29日 星期三 , Posted by 曾easy in ,

環境: redhat 9, MySQL 5.1.32
需求: 使用 MySQL C API 挿入資料時中文有問題, 因為 mysql設置資料儲存為UTF-8
解決: 將big5字串轉成utf-8字串, 然後再將utf-8字串存成16進制再挿入MySQL




#include <iconv.h>
#include <string.h>

#include <errno.h>


#define USR_NAME_LEN 64

char
user[USR_NAME_LEN]; //從檔案讀來的Big5字串會存在user
char wuser[2*sizeof(user)+2];

const
char fromcode[] = "big5";
const
char tocode[] = "utf-8";

iconv_t cd;
size_t in_size = sizeof(user);
char
*inptr = user;

char
out[2*USR_NAME_LEN+1];
size_t out_size = sizeof(out);

char
*outptr = out;

if
((iconv_t)(-1) == (cd = iconv_open(tocode, fromcode))) {

printf("(%s)Failed to iconv_open %s to %s.\n",strerror(errno), fromcode, tocode);
exit(EXIT_FAILURE);
}


if
((size_t)(-1) == iconv(cd, &inptr, &in_size, &outptr, &out_size)) {

printf("Fail to convert characters to new code set.(%s)\n", strerror(errno));
exit(EXIT_FAILURE);
iconv_close(cd);
}




那麼使用MySQL C API便可insert中文資料了!

char sqlcmd[512];

mysql_hex_string(wuser, out, strlen(out) );
DataBase<mysql> dataBase("127.0.0.1", "root", "yourpassword", "dbname");

memset(sqlcmd, 0, sizeof sqlcmd);
sprintf(sqlcmd, "INSERT INTO tablename(username) VALUES(0x%s)"

,
wuser);
dataBase << sqlcmd ;

libiconv 只有三個functions
iconv_t iconv_open (const char* tocode, const char* fromcode):開啟 libiconv。
size_t iconv (iconv_t cd, const char* * inbuf, size_t * inbytesleft, char* * outbuf, size_t * outbytesleft):執行轉碼。
int iconv_close (iconv_t cd):做完轉碼後關閉 libiconv。


安裝apache2+PHP+PHPMYADMIN  

2009年4月23日 星期四 , Posted by 曾easy in

安裝環境: Redhat 9 + mysql-5.1.32-linux-i686-glibc23
MySQL必須先裝好.



★ 下載 httpd-2.0.63.tar.gz

tar zxvf httpd-2.0.63.tar.gz
cd httpd-2.0.63
./configure --enable-so
make
make install

Apache 2.0.63 已安裝在 /usr/local/apache2, configured with loadable module support and the standard MPM prefork.
------------------------------------------------------------------------------------------
下載php-5.2.9.tar.gz

tar zxvf php-5.2.9.tar.gz
cd php-5.2.9
./configure --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --with-openssl=/usr/local/ssl --with-curl=/usr/local/lib
make
make install
cp php.ini-dist /usr/local/lib/php.ini

------------------------------------------------------------------------------------------
★ 編輯 http.conf 加入
LoadModule php5_module modules/libphp5.so (裝php時可能幫我們加了, 再check一下)
編輯 http.conf 加入 (.php, .php2, .php3, .php4, .php5, .php6, and.phtml files to be executed as PHP)

SetHandler application/x-httpd-php

編輯 http.conf ,加入index.php為index
DirectoryIndex index.html index.html.var index.php
大功告成
執行 /usr/local/apache2/bin/apachectl start
------------------------------------------------------------------------------------------
下載phpMyAdmin-3.1.3.2-all-languages.tar.gz

tar zxvf phpMyAdmin-3.1.3.2-all-languages.tar.gz
cd phpMyAdmin-3.1.3.2-all-languages
cp config.sample.inc.php config.inc.php
vi config.inc.php

編輯 config.inc.php時,
$cfg['Servers'][$i]['auth_type'] = 'cookie';
改成 $cfg['Servers'][$i]['auth_type'] = 'http'; (我是透過browser輸入帳號密碼認證)

cd ..
mv phpMyAdmin-3.1.3.2-all-languages /usr/local/apache2/htdocs/phpMyAdmin


然後就可以連http://xx.xx.xx.xx/phpMyAdmin/ 試試我們裝好的 phpMyAdmin了。

sed 常用指令筆記  

2008年4月27日 星期日 , Posted by 曾easy in

▇ sed -n '32,122p' file1 > file2 (將file1的32行到122行複製到file2)

vi (vim) 常用指令筆記  

2008年3月17日 星期一 , Posted by 曾easy in


游標移動

0 是數目字 0 而不是英文字母 o。或是 Home 鍵,移至行首,(含空白字元)。
^ 移至行首第一個非空白字元,注意,要 Shift 鍵。
$ 移至行尾,或 End 鍵。要 Shift 鍵。
G 移至檔尾(全文最後一行的第一個非空白字元處)
gg 移至檔首(全文第一行之第一個非空白字元處)。

在規則表示式(regular expression)中,^ 是匹配行首,$ 是匹配行尾。

w 移至次一個字(word)字首。當然是指英文單字。
W 同上,但會忽略一些標點符號。
e 移至後一個字字尾。
E 同上,但會忽略一些標點符號。
b 移至前一個字字首。
B 同上,但會忽略一些標點符號。
H 移至螢幕頂第一個非空白字元。
M 移至螢幕中間第一個非空白字元。
L 移至螢幕底第一個非空白字元。這和 PageDownPageUp 不一樣,內文內容並未動,只是游標在動而已。


:n 移至第 n 行行首。或 nG。
) 移至下一個句子(sentence)首。
( 移至上一個句子(sentence)首。sentence(句子)是以 . ! ? 為區格。
} 移至下一個段落(paragraph)首。
{ 移至上一個段落(paragraph)首。paragraph(段落)是以空白行為區格。
% 這是匹配 {},[],() 用的,例如游標在 { 上只要按 %,就會跑到相匹配的 } 上。

▆ macro

(a可以用a~z任一英文字母)
qa
... recording ...
q
@a (執行macro)

▆ search

/search pttern
v(移動指標 選取完想要的字後,按y, 此時文字被複製到register 0)
/Ctrl+r +0

▆ replace

為每行行首加上 printf ("<td>,行尾加上</td>\n");
s/^.*$/printf ("<td>&<\/td>\\n");/g
^.*$為正規表示式,代表每一行。&代表前面找到的字串,此例即為每一行
.





Reference from: http://edt1023.sayya.org/vim/node1.html

Linux 指令筆記  

2008年3月6日 星期四 , Posted by 曾easy in

#為console提示符號, 粗體為指令部分

■ 刪除 ROOT 目錄下所有名稱為CVS目錄或檔案
# find ROOT/ -name CVS -exec rm -rf {} \;

■ 進到一個source 的最上層,例如$HOME/wi20ap裡面,然後用
# cvs import 95Mesh/wi20ap mesh_team r_0_0_1
因為我的cvs server上已有95Mesh project, 我想將新的wi20ap整個source目錄import 到95Mesh目錄下

架設 ViewVC  

2008年2月27日 星期三 , Posted by 曾easy in

可到
http://www.viewvc.org/
下載 viewvc-1.0.4,要看一下安裝需求。



tar zxvf viewvc-1.0.4.tar.gz
cd viewvc-1.0.4
./viewvc-install

照預設的安裝目錄按enter就好,然後會出現下面訊息
ViewVC file installation complete.

Consult the INSTALL document for detailed information on completing the
installation and configuration of ViewVC on your system. Here's a brief
overview of the remaining steps:

1) Edit the /usr/local/viewvc-1.0.4/viewvc.conf file.

2) Either configure an existing web server to run
/usr/local/viewvc-1.0.4/bin/cgi/viewvc.cgi.

Or, copy /usr/local/viewvc-1.0.4/bin/cgi/viewvc.cgi to an
already-configured cgi-bin directory.

Or, use the standalone server provided by this distribution at
/usr/local/viewvc-1.0.4/bin/standalone.py.

我自己是將 viewvc.cgi copy到 /var/www/cgi-bin/ (伺服器執行cgi的目錄)。
然後修改設定檔 vi /usr/local/viewvc-1.0.4/viewvc.conf
將這行 cvs_roots = cvs: /cvs 改成你自己的cvs root路徑 (/cvs -> your path )
,將use_enscript = 0 改成 use_enscript = 1
這樣簡單的 ViewVC 就架設完成了。

補充:"Error: Rlog output ended early." 如果出現這樣的error,要安裝RCS。

screen 常用教學筆記  

2008年2月22日 星期五 , Posted by 曾easy in

Ctrl + a, k kill 掉這個 screen
Ctrl + a , A 可以編寫這個 screen 的名稱
Ctrl + a , " 會進入一個頁面讓你切換視窗


Ctrl + [ 會進入複製模式. 跟用 vi 一樣. hjkl 去控制方向, ctrl + b, f, u 可以上下捲頁.

Ctrl + a S 會將螢幕暫停(通常是按錯了, 不曉得怎麼回復)
Ctrl + a q 就可以將上面的營幕暫停回復

screen -S easy
screen -r 就會出現 1234-easy
screen -r easy 就可以進去了

若遇到 Screen 中又開了 Screen 的狀況, 要如何偵測到 Screen 裡面的 Screen: Ctrl + a

a 就可以偵測到. Ctrl + a a d 可以讓 Screen 中的 Screen 安然離開.


Q: 要怎麼用screen轉encoding呢?, 我的terminal是UTF-8,想上Big5編碼的BBS
A: ^a :encoding big5 utf8 (Ctrl + a 再輸入 :encoding big5 utf8)
Q: 我的 screen 最底部想要秀出現在在哪個視窗, 該怎麼設定呢?
A: 在 .screenrc 加入 (在家目錄,沒有的話,自己建立)

hardstatus alwayslastline "%{=b}%{bw} %{ck} %-Lw%{gw}%n%f* %t%? (%u)%? %{-}%+Lw %{bw}"

就可以了.
Q: screen 按 tab 畫面都會閃一下, 該怎麼關掉?
A: C-a C-g 就可以切換 visual bell 或 audio bell 了,
或者 在 .screenrc 中, 可用 vbell on 或 vbell off 來設定切換

▇ Ctrl+a+[ 進入 copy mode
- 游標移動方式如vi
- copy mode 下按y (yank) 開始選取
- copy mode 下按Y 將選取內容複製到buffer
▇ Ctrl +a+] 貼上buffer的內容