BT5之配置笔记
BT5本來就是用Ubuntu 10.04做得藍本,所以,我在配置BT5的時候,基本上都是按照Ubuntu 10.04的配置方法,在配置BT5
1??? 系統基本設置
1.1? 安裝Ubuntu10.04
分區時首先為根目錄分配最多的硬盤空間,然后為boot目錄分配200M,最后為swp目錄分配內存的2倍空間。
?
1.2? 利用軟碟通UltraISO制作U盤啟動的Ubuntu 10.04
安裝軟碟通
插入U盤
以管理員運行軟碟通
啟動光盤-> 寫入硬盤映像
選擇U盤,寫入方式usb-hdd+
完成
?
1.3? 更新源
(1)備份源??????? sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
(2)編輯源??????? sudo gedit /etc/apt/sources.list
編輯你的源列表,將原來的內容全部刪除,添加一個最適合你的源,復制到你的列表中,然后保存列表。我用的是163的源:
(3)更新源????????? sudo? apt-get? update
(4)升級?????????? sudo? apt-get? upgrade
(5)升級系統??? sudo? apt-get? dist-upgrade
?
1.4? 更改左邊關閉按鈕的位置
ubuntu10.04最大的變化可能就是最小化最大化和關閉按鈕移到左邊去了
按alt+F2進入應用程序運行器,輸入gconf-editor進入配置編輯器,依次進入/apps/metacity/general /button_layout
將鍵值close,minimize,maximize:修改為menu:minimize,maximize,close
再用sudo gconf-editor再把上面的內容修改一次
?
1.5? 中文亂碼問題
1.5.1? gedit
在Windows下編輯好txt文件后在Ubuntu中使用Gedit打開出現亂碼;這是編碼方式不同造成的。Windows下txt文件的編碼格式為GBK,Ubuntu Gedit默認沒有對GBK的支持,需要手動配置。
(1)打開終端,輸入”gconf-editor”,回車后打開配置編輯器;
(2)在左邊的樹節點找到/apps/gedit-2/preferences/encodings并單擊它;
(3)雙擊右邊的auto_detected 鍵,打開“編輯鍵”對話框;
(4)單擊列表右邊的“添加”按鈕,輸入“GB18030”,單擊確定按鈕,這樣列表的最底部新增加了一個“GB18030”。如果你不放心,可以再增加GBK、GB2312編碼。
(5)選中“GB18030”將其移動到列表的頂部。如果你在第四步后發現沒有亂碼了,這一步也就可以省略了。
(6)但是通過這種方法解決后,又會引來新的問題,那就是,當打開一個空文檔 時,gedit會崩潰,那么我總結出來到辦法就是,把UTF-8放到最上面去就可以了。
(7)再用sudo gconf-editor再把上面的內容修改一次,就可以解決用sudo gedit編輯文檔中文亂碼的問題了
?
1.5.2? Flash中文顯示為方塊
編輯/etc/fonts/conf.d/49-sansserif.conf 文件
修改第18行,將
<edit name=”family” mode=”append_last”>
<string>sans-serif</string>
</edit>
修改為
<edit name=”family” mode=”append_last”>
<string>sans</string>
</edit>
?
1.5.3? pdf中文亂碼
sudo apt-get install poppler-data
sudo mv /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.backup
?
1.5.4? 更多中文字體
(1)去windows系統里復制所需字體,通常是在C/WINDOWS/FONTS下
(2)在home/你的用戶名,下創建一個名為“.fonts”的文件夾(前面的小點意為隱藏的文件夾),將剛才所復制的放入“.fonts”
?
1.6? 雙系統怎樣讓系統默認為從windows啟動
在/etc/grub.d目錄中的腳本文件的文件名都是以數字開頭,這確定了在執行update-grub時各文件內容被執行的順序
我們只要把30_os-prober這個文件名的數字30改為05到10之間的數字即可(沒多少可選06、07、08、09),比如改為08_os-prober
這樣創建出來的grub.cfg內的菜單項,windows的排序就會自動在ubuntu之前。
cd /etc/grub.d
sudo mv 30_os-prober 08_os-prober
此外,還有一種方法,手動修改grub2啟動配置文件
sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg_backup
sudo gedit /boot/grub/grub.cfg
?
1.7? 把終端放在右鍵菜單
sudo apt-get install nautilus-open-terminal
?
1.8? 以root權限打開文件夾
sudo apt-get install nautilus-gksu
?
1.9? 火狐設置
在Firefox 地址欄里輸入“about:config”,然后將修改下面給出的選項到相應的值。
network.http.pipelining > 設為True
network.http.pipelining.maxrequests > 設為8或10
network.http.proxy.pipelining > 設為True
?
1.10??? 開啟3d桌面
sudo apt-get install compizconfig-settings-manager
?
http://forum.ubuntu.org.cn/viewtopic.php?t=140531
?
1.11??? 快捷鍵
Ubuntu操作基本快捷鍵
* 打開主菜單= Alt + F1
* 運行= Alt + F2
* 顯示桌面= Ctrl + Alt + d
* 最小化當前窗口= Alt + F9
* 最大化當前窗口= Alt + F10
* 關閉當前窗口= Alt + F4* 截取全屏= Print Screen
* 截取窗口= Alt + Print Screen
* 展示所有窗口程序= F10
* 展示當前窗口最上層程序= F11
* 展示當前窗口所有程序= F12
* 切換窗口= Alt + Tab
* 旋轉3D桌面= Ctrl + Alt + 左/右箭頭
* 旋轉3D桌面(活動窗口跟隨)= Ctrl + Shift + Alt + 左/右箭頭
* 手動旋轉3D桌面= Ctrl + Alt + 左鍵單擊并拖拽桌面空白處
* 窗口透明/不透明= possible with the “transset”utility or Alt + 滾輪
* 放大一次= 超級鍵+ 右擊
* 手動放大= 超級鍵+ 滾輪向上
* 手動縮小= 超級鍵+ 滾輪向下
* 移動窗口= Alt + 左鍵單擊
* 移動窗口時貼住邊框= 左鍵開始拖動后再Ctrl + Alt
* 調整窗口大小= Alt + 中擊
* Bring up the window below the top window = Alt + middle-click
* 動態效果減速= Shift + F10
* 水紋= 按住Ctrl+超級鍵
* 雨點= Shift-F9
* 桌面展開=Ctrl + Alt + 下箭頭,然后按住Ctrl + Alt 和左/右箭頭選擇桌面
Nautilus
Shift+Ctrl+N – 新建文件夾, 很有用
Alt + Enter – 查看選擇文件/文件夾的屬性,代替單擊右鍵選擇屬性
Ctrl + 1/2 – 改變文件夾視圖查看方式,圖標視圖/列表視圖
Ctrl + W – 關閉當前Nautilus窗口
Ctrl + Shift + W – 關閉所有Nautilus窗口
Ctrl+T – 在Nautilus中新建一個標簽
Alt + Up/Down Arrow – 移動到父文件夾/選擇的文件夾
Alt + Left/Right Arrow – 后退/前進
Alt + Home -直接移動到主文件夾
F9 – 開關顯示Nautilus側邊欄
Ctrl + H -開關顯示隱藏文件夾
其他
Ctrl + Alt + L -鎖屏
Alt + F1 – 打開應用程序菜單
Alt + F2 – 打開運行應用程序對話框
Win + 鼠標滾輪 – 放大/縮小屏幕
?
2??? 軟件安裝
2.1? 安裝Ubuntu額外的版權受限的程序
sudo apt-get install ubuntu-restricted-extras
?
2.2? 安裝RAR壓縮/解壓縮程序
sudo apt-get install rar unrar
建立軟鏈接
sudo ln -fs /usr/bin/rar /usr/bin/unrar
這樣,以后只要在命令行輸入unrar,就可以解壓或者壓縮文件了,安裝完成后,歸檔管理器也同時集成了rar組件
安裝7zip解壓縮軟件
sudo apt-get install unrar p7zip-full cabextract
?
2.3? 安裝ibus輸入法
2.3.1? 輸入法自啟動
Ubuntu系統安裝后已經自帶了ibus輸入法,在英語環境下 默認不啟動。
配置ibus自動啟動可以在Ubuntu系 統菜單上選擇System ―Preferences ―Startup Applications,在該窗口中增加一 個程序:
Name: ibus-daemon
Command: ibus-daemon -d -x Cr
?
2.3.2? 安裝智能拼音
ibus 默認提供的中文輸入法比較弱智,需要額外安裝ibus-pinyin,命令如下:
sudo apt-get install ibus-pinyin
這時,還需要將ibus-pinyin輸入法啟動。在Ubuntu系 統菜單上選擇System ―Preferences ―IBus Preferences,
在Input Method頁中的“Select an input method”下拉框中選擇增加Chinese C Pinyin,就是圖標中有個一個大大的“拼”字的那一個,然后點擊Add按鈕,最后通過Up按鈕將該輸入法移動到最上面。
系統重啟后,通過Ctrl + 空格即可調出ibus輸入法。
?
2.3.3? 安裝sougou詞庫
下載http://code.google.com/p/hslinuxextra/downloads/list的sougou-phrases-full.7z
解壓后的Andriod.db移動到/usr/share/pinyin-database
將原來的main.db改 名,然后將Andriod.db改名為main.db,注銷重進系統就行了,成功標志,能打出:弗雷德霍姆行列式
?
2.4? 安裝編譯環境
安裝gcc g++ make等等
sudo apt-get install build-essential
?
2.5? 安裝gvim
2.5.1? 安裝vimgdb進行調試
若要安裝vimgdb需重新編譯安裝vim,請參考以下網址
?
http://wiki.ubuntu.org.cn/%E8%80%81%E6%97%A7%E6%96%87%E7%AB%A0/Gvim%E7%9A%84%E5%AE%89%E8%A3%85%E5%8F%8A%E9%85%8D%E7%BD%AE
?
編譯安裝vim一定記得要先安裝編譯vim-gtk的依賴包
sudo apt-get build-dep vim-gtk
?
2.5.2? 安裝ctags
tar -xzvf?? ctags.xxxxxx
./configure??? –prefix= 安裝的目錄
make
sudo make install
ctags?? –version 測試是否安裝成功
或者執行下面的命令:
sudo apt-get install exuberant-ctags
?
2.5.3? 添加gvim 啟動項
sudo cat > /usr/share/applications/gvim.desktop << “EOF”
[Desktop Entry]
Name=Gvim
Comment[zh_CN]=Gvim編輯器
Exec=gvim
Icon=/usr/share/pixmaps/gnome-word.png
Terminal=false
X-MultipleArgs=false
Type=Application
Categories=Application;Development;
Encoding=UTF-8
StartupNotify=true
?
2.5.4? 編譯gvim 后忽略錯誤警報
alias gvim=”gvim -reverse 2>/dev/null”
alias tvim=’gvim –remote-tab-silent’2.5.5? 把gvim打造成IDE2.5.6? .vimrc配置文件
cp /usr/share/vim/vim72/vimrc_example.vim ~/.vimrc
vim ~/.vimrc
在文件末尾增加以下內容:
”by djk 2010.9.22 for Ubuntu 10.04
” 編輯設置
set number
set cursorline
set tabstop=4
set sw=4
set expandtab
set autoindent
set cindent
set nobackup
set nowritebackup
set showmatch
set statusline=%<%F%h%m%r%h%w%y\ %=\ line:%l\/%L\ %=\ col:%c%V\ %=\ %p%%
set laststatus=2
syntax enable
syntax on
:match DiffAdd ‘\%>80v.*’
colorscheme desert
” 括號自動補全
inoremap [ []<esc>:let leavechar=”]”<cr>i
inoremap { {<esc>o}<esc>:let leavechar=”}”<cr>O
” 設置代碼折疊
set foldcolumn=0
set foldmethod=indent
set foldlevel=3
” 設置字體
“set guifont=Bitstream_Vera_Sans_Mono:h12:cANSI
“set gfw=Yahei_Mono:h10.5:cGB2312
” 解決中文編碼問題
let &termencoding=&encoding
set fileencodings=utf-8,gbk,ucs-bom,cp936
” 進行版權聲名 按F4進行添加和更新
map <F4> ms:call TitleDet()<cr>’s
function AddTitle()
call append(0,”/*====================================================”)
call append(1,”#”)
call append(2,”# Author: JK David – “)
call append(3,”#”)
call append(4,”# Last modified: “.strftime(“%Y-%m-%d %H:%M”))
call append(5,”#”)
call append(6,”# Filename: “.expand(“%:t”))
call append(7,”#”)
call append(8,”# Description: “)
call append(9,”#”)
call append(10,”====================================================*/”)
echohl WarningMsg | echo “Successful in adding the copyright.” | echohl None
endf
function UpdateTitle()
normal m’
execute ‘/# *Last modified:/s@:.*$@\=strftime(“: %Y-%m-%d %H:%M”)@’
normal ”
normal mk
execute ‘/# *Filename:/s@:.*$@\=”: “.expand(“%:t”)@’
execute “noh”
normal ‘k
echohl WarningMsg | echo “Successful in updating the copy right.” | echohl None
endfunction
function TitleDet()
let n=1
while n < 8
let line = getline(n)
if line =~ ‘^\#\s*\S*Last\smodified:\S*.*$’
call UpdateTitle()
return
endif
let n=n+1
endwhile
call AddTitle()
endfunction
” 編譯運行程序
if(has(“win32″) || has(“win95″) || has(“win64″) || has(“win16″))
let g:iswindows=1
else
let g:iswindows=0
endif
”F5單個文件編譯
map <F5> :call Do_OneFileMake()<CR>
function Do_OneFileMake()
exec “w”
if expand(“%:p:h”)!=getcwd()
echohl WarningMsg | echo “Fail to make! This file is not in the current dir! Press <F7> to redirect to the dir of this file.” | echohl None
return
endif
let sourcefileename=expand(“%:t”)
if (sourcefileename==”" || (&filetype!=”cpp” && &filetype!=”c”))
echohl WarningMsg | echo “Fail to make! Please select the right file!” | echohl None
return
endif
let deletedspacefilename=substitute(sourcefileename,’ ‘,”,’g')
if strlen(deletedspacefilename)!=strlen(sourcefileename)
echohl WarningMsg | echo “Fail to make! Please delete the spaces in the filename!” | echohl None
return
endif
if &filetype==”c”
if g:iswindows==1
set makeprg=gcc\ -o\ %<.exe\ %
else
set makeprg=gcc\ -o\ %<\ %
endif
elseif &filetype==”cpp”
if g:iswindows==1
set makeprg=g++\ -o\ %<.exe\ %
else
set makeprg=g++\ -o\ %<\ %
endif
“elseif? &filetype==”cs”
“set makeprg=csc\ \/nologo\ \/out:%<.exe\ %
endif
if(g:iswindows==1)
let outfilename=substitute(sourcefileename,’\(\.[^.]*\)$’,’.exe’,'g’)
let toexename=outfilename
else
let outfilename=substitute(sourcefileename,’\(\.[^.]*\)$’,”,’g')let toexename=outfilename
endif
if filereadable(outfilename)
if(g:iswindows==1)
let outdeletedsuccess=delete(getcwd().”\\”.outfilename)
else
let outdeletedsuccess=delete(“./”.outfilename)
endif
if(outdeletedsuccess!=0)
set makeprg=make
echohl WarningMsg | echo “Fail to make! I cannot delete the “.outfilename | echohl None
return
endif
endif
execute “silent make”
set makeprg=make
execute “normal :”
if filereadable(outfilename)
if(g:iswindows==1)
execute “!”.toexename
else
execute “!./”.toexename
endif
endif
execute “copen”
endfunction
“進行make的設置
map <F6> :call Do_make()<CR>
map <c-F6> :silent make clean<CR>
function Do_make()
set makeprg=make
execute “silent make”
execute “copen”
endfunction
”F2顯示或隱藏菜單欄和工具欄
set guioptions-=m
set guioptions-=T
map <silent> <F2> :if &guioptions =~# ‘T’ <Bar>
\set guioptions-=T <Bar>
\set guioptions-=m <bar>
\else <Bar>
\set guioptions+=T <Bar>
\set guioptions+=m <Bar>
\endif<CR>
”ctrl+F12 更新tags文件
set tags=tags
au FileType cpp,c set tags+=~/.vim/stl_tags
set autochdir
map <c-F12> :!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q .<cr>
”————–
” 插件管理
”————–
”taglist.vim
”:Tlist open taglist window
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_Right_Window=1
let Tlist_Sort_Type=”name”
let Tlist_File_Fold_Auto_Close=1
let Tlist_Auto_Open = 0
let Tlist_Auto_Update = 1
let Tlist_Hightlight_Tag_On_BufEnter = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Process_File_Always = 1
let Tlist_Display_Prototype = 0
let Tlist_Compact_Format = 1
”command wm show fileexplorer window and taglist window
let g:winManagerWindowLayout=’FileExplorer|TagList’
nmap wm :WMToggle<cr>
”a.vim
”exchange head file and source file
”:A 打開源文件和頭文件
”:AV 打開源文件和頭文件并分屏
”grep.vim
”press F3 to search
nnoremap <silent> <F3> :Grep<CR>
”auto completion
filetype plugin indent on
set completeopt=longest,menu
”omnicppcomplete
let OmniCpp_DefaultNamespaces = ["std"]
let OmniCpp_GlobalScopeSearch = 0
let OmniCpp_NamespaceSearch = 1
let OmniCpp_DisplayMode = 1
let OmniCpp_ShowScopeInAbbr = 0
let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
”NERD_commenter.vim
” 按下一次ctrl+h是注釋,再按下一次是取消注釋
”[count],cc 光標以下count行逐行添加注釋(7,cc)
”[count],cu 光標以下count行逐行取消注釋(7,cu)
”[count],cm 光標以下count行嘗試添加塊注釋(7,cm)
”,cA 在行尾插入/* */,并且進入插入模式
let NERDShutUp=1
map <c-h> ,c<space>
”shell.vim www.2cto.com
”press F11 to fullscreen
”press F6 to open files directories urls and email under the cursor”
”snipmate
let snippets_dir=’/home/djk/.vim/snippets’
”crefvim
”press \cr to invoke C-reference
”stlrefvim
”place the cursor over the function
”press \tr to go to the documentation for it
”press \te to go to an example that uses this function
?
2.5.7? gvim以tab方式打開新文件
gvim?? –remote-tab-silent? filename
為了方便可以在.bashrc中加入
alias vim=’gvim –remote-tab-silent’
alias gvim=’gvim –remote-tab-silent’
?
2.6? 安裝翻譯軟件stardict
sudo apt-get install stardict
詞典選擇
詞典下載地址
將下載的詞典放在一個目錄下,進入該目錄,輸入以下命令可以一次性安裝所有詞典:
for i in stardict*.tar.bz2; do sudo tar xjvf “$i”-C /usr/share/stardict/dic/; done2.7? 安裝openfetion
使用飛信免費發短信,現在也可以使用webfetion了
安裝庫
apt-get install libxml2-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libssl-dev
sudo apt-get install libnotify-dev
sudo apt-get install libgstreamer0.10-dev
sudo apt-get install intltool
下載openfetion源碼,進入src目錄,執行以下命令
./configure
make
sudo make install
在/etc/ld.so.conf 中另起一行添加/usr/local/lib
之后運行以下命令即可
sudo ldconfig
?
2.8? 安裝smplayer
media播放器
sudo apt-get install smplayer
?
2.9? 安裝chmsee
查看chm文件
sudo apt-get install chmsee
?
2.10??? 安裝scilab
類似MATLAB的科學計算軟件
?
2.11??? 安裝農歷日歷
sudo aptitude install lunar-applet
不過有個小問題,由于我使用的locale是en_US.utf8,所以陰歷顯示的都是拼音,解決方案如下:
sudo ln -s /usr/share/locale/zh_CN/LC_MESSAGES/liblunar.mo /usr/share/locale/en/LC_MESSAGES/
?
2.12??? 安裝Eclipse
sudo apt-get install eclipse
?
2.13??? 安裝openssh-server
這樣就可以遠程登陸ubuntu了
sudo apt-get install openssh-server
?
2.14??? 安裝ftp圖形界面工具filezilla
sudo apt-get install filezilla
?
2.15??? 安裝時間管理軟件gtg
sudo apt-get install gtg
?
2.16??? 安裝docky
sudo apt-get install docky
?
2.17??? 安裝latex
sudo apt-get install texlive-full
?
http://forum.ubuntu.org.cn/viewtopic.php?t=150168
?
3??? FAQ
3.1? 怎么刪除編譯安裝的軟件
cd 源代碼src目錄
make clean
./configure
make
make uninstall
?
3.2? 怎么安裝tar.gz文件
先解包,tar -zxvf xxx.tar.gz,這樣會生成一個以文件名命名的文件夾。里面會有一些README、INSTALL、DOC等等一些文檔,仔細讀讀,可以知道這個軟件安裝需要什么特殊的設置什么的。
* 一般軟件包里會有一個叫configure的腳本文件,完成配置的任務。可以加很多參數,具體的可以運行./configure –help得到幫助的,比如./configure –prefix=xxx是設定軟件安裝到哪里。設置好參數,運行./configure,會生成makefile文件,這是你后面編譯的基礎。
* 接下來就要編譯了,很簡單,因為有makefile文件的存在,只要運行make就可以完成編譯的。make是將讀入所有由configure腳本程序建 立的制作文件。這些制作文件會告訴make哪些文件需要被編譯以及按照怎樣的順序對它們進行編譯,因為可能會有上百個源程序文件。當make工作的時候, 會在屏幕上顯示出正在執行的每一個命令,以及與這個命令相關的全部參數。這些輸出通常都是編譯器的調用聲明和所有傳遞給編譯器的參數。如果編譯器順利地完 成了工作,就不會出現什么錯誤信息。大多數編譯器的錯誤信息十分清楚和明確,因此不用擔心可能會漏掉一個錯誤。如果確實看到有一錯誤,也不用慌張。大多數 錯誤信息并不反映出程序本身出現了一個問題,通常都是系統這里或者那里的問題。典型情況下,這些信息大多是因為文件訪問權限不正確而產生的或者是因為文件 沒有找到。
* 完成編譯,之后就是安裝軟件了。這就更簡單了,make install就好了,這個命令將啟動安裝腳本程序。因為make命令會在執行每一個命令的時候把它顯示出來,所以將會看到許許多多的文字掠過眼前。如果沒有看到什么錯誤信息,就說明這個軟件包安裝好了。
* 反安裝就是make uninstall了
總結
- 上一篇: py爬取英文文档学习单词
- 下一篇: 给select设置默认值,在option