Ubuntu:Feisty
出自Ubuntu中文
[編輯] Unofficial Ubuntu 7.04 (Feisty Fawn) Starter Guide
Ubuntu 7.04 (Feisty Fawn) was released on April 19th, 2007. This guide is a constantly evolving work-in-progress. Your help in testing and perfecting this guide is needed.
This guide was started by Chua Wen Kiat (Kuala Lumpur, Malaysia). It is now being maintained by the Linux Center of University of Latvia, and everyone else who is willing to contribute.
This guide can be discussed at the official UbuntuGuide.org Forum at ubuntuforums.org. Stop by and join the discussion.
To edit pages you need to register
If you have any questions, send us an e-mail to ubuntuguide -at- ubuntuguide.org
| Contributors: | Orvils • Quash • Jiyuu0 • Cargo •Mikrobart • Byte • cope • krampo • Simos • Stubby • eljaco • shai • ThunderM • Hasile • adammichaelroach • Belisarivs • Cheator • Hank • Kaotiks • soniah • Kutan • Mehdi • richux • Shadyman • Havarill • Louis • Shadyman • shanlot751 • Etienne • Rabid9797 • Mantas Smelevičius • perspectoff • phlo • seadog • smalu • go2debug • Pakos •RedBass • CyberAngel •Cogeeldineroycorre • Ufic • Antidrugue • Vahid • Louis King • Rsingh • Borut-T • Cinglalls • Townray •and other friends of our community. | edit |
If you use an outdated version of ubuntu (Breezy, Dapper, Edgy), you should update it to Feisty. See this: [How to upgrade from Hoary Hedgehog -> Breezy Badger -> Dapper Drake]
Full list of all the subpages: Ubuntu:Feisty/TOC
[編輯] 概述
- 以下是非官方 Ubuntu 7.04 (Feisty Fawn) 新手指南,與Ubuntu或Canonical Ltd.都無關。
- 可以在官方的UbuntuGuide.org 論壇討論這個指南的內容。過來看看,加入討論吧。
- 如果你看見一個淡藍色的方框,這表示你要到終端模式下(應用程序 -> 附件 -> 終端)去執行那些命令,或者採用方框中的內容(這些內容可能是其他指南中提及的)。
- 為了減少打字錯誤,建議把命令代碼複製、粘貼到終端(在命令代碼上點右鍵->「複製」或「粘貼」。也可以用Ctrl+C複製,Shift+Insert粘貼)。
- "sudo" 的意思是用其他用戶身份執行命令。 "sudo" 後會提示你輸入密碼「Pssword: 」,這時輸入該用戶密碼。比如你可以這樣用系統中另外一個用戶的身份:sudo -u peter <command> 這樣就能以系統中用戶peter的身份來執行某個命令。
- 如果想多了解一下任一命令的詳細信息,只需用"man"命令看看手冊中的說明。例如 "man sudo"會顯示"sudo"這一命令的手冊頁。
- 如果實在不想總是輸入"aptitude"命令,讀一下 #怎樣使用 aptitude 的簡易方式 (新立得)
- "aptitude" 和 "wget" 需要你有Internet連接才能安裝/更新/下載程序。
- 關於"apt-get"的所有參考內容都已經被"aptitude"取代了。不過願意的話你仍然可以使用"apt-get",沒有問題。在Ubuntu 論壇可能有討論。
- 要下載文件,在鏈接上點右鍵然後選擇 "鏈接另存為...",請確認文件名和擴展名無誤。
- 如果希望幫忙將Ubuntu翻譯成你自己的母語,或者以其他方式幫助Ubuntu,請訪問 https://launchpad.net/
- 願 "humanity to others" 精神永遠與你同在...
- 如果你用的是64位版本,請用"amd64"代替所有的"i386"
[編輯] Requests
If you have requests that you would like to be part of this guide, put them here.
- How to add the (k)ubuntu CD or DVD as a repository for sources.list
Solution, please move to appropriate chapter:
Insert the CD or DVD and in the terminal write:
sudo apt-cdrom add
如果對這部分有要求的,請把他們寫在這個板塊
[編輯] 開始
[編輯] Where to view Ubuntu screenshots / screencast
- Ubuntu 7.04(Feisty Fawn) Screenshots Tour
- Ubuntuclips.org - video howto's for human beings
- Ubuntu Video - linux videos for human beings
[編輯] Where to view Kubuntu screenshots / screencast
[編輯] Where to view Xubuntu screenshots / screencast
[編輯] 哪裡可以找到新的程序
[編輯] 哪裡可以為你的計算機桌面找到新的元素
[編輯] Are there other *buntu guides?
- http://xubuntuguide.org
- Ubuntu Step By Step Guides For Ubuntu UsersUbuntu Users Community Website
[編輯] 從 Ubuntu Edgy 更新到 Ubuntu Feisty
[編輯] 如何添加額外的軟件源
- 閱讀 #概述
- 可以用"軟件源"應用程序添加額外的源,見系統 -> 系統管理 -> 軟件源。在你認為需要的源(main, universe, restricted, multiverse)前面打勾。你可能不需要'源代碼'這個源。推薦用這種方法添加額外的源。
- 添加源還有一種方法,用以下步驟 (風險自負):
- 創建一個你現在使用的源列表的備份
sudo cp -p /etc/apt/sources.list /etc/apt/sources.list_backup
- 用任一文本編輯器打開源的列表
- Ubuntu (GNOME) 用戶:
sudo gedit /etc/apt/sources.list
- Kubuntu (KDE) 用戶:
sudo kate /etc/apt/sources.list
- 其他用戶 (在上面這些都不行的情況下):
sudo nano /etc/apt/sources.list
- 以下面這些行作為模板,自己在sources.list中編輯源:
- 可試着用下面這幾行代替sources.list中的當前內容
- 要使用你所在地的鏡像,在archive.ubuntu.com前面加上"cc.", 其中 cc = 你所在國家的代碼
- 例如 deb http://lv.archive.ubuntu.com/ubuntu feisty main restricted universe multiverse
## See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to ## newer versions of the distribution. ## Add comments (##) in front of any line to remove it from being checked. ## Use the following sources.list at your own risk. ## Uncomment deb-src if you wish to download the source packages ## If you have a install CD you can add it to the reposity using 'apt-cdrom add' ## which will add a line similar to the following: #deb cdrom:[Ubuntu 7.04 _Feisty Fawn_ - Beta i386 (20070322.1)]/ feisty main restricted deb http://us.archive.ubuntu.com/ubuntu/ feisty main restricted #deb-src http://us.archive.ubuntu.com/ubuntu/ feisty main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://us.archive.ubuntu.com/ubuntu/ feisty-updates main restricted #deb-src http://us.archive.ubuntu.com/ubuntu/ feisty-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://us.archive.ubuntu.com/ubuntu/ feisty universe #deb-src http://us.archive.ubuntu.com/ubuntu/ feisty universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://us.archive.ubuntu.com/ubuntu/ feisty multiverse #deb-src http://us.archive.ubuntu.com/ubuntu/ feisty multiverse ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse #deb-src http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu feisty-security main restricted #deb-src http://security.ubuntu.com/ubuntu feisty-security main restricted deb http://security.ubuntu.com/ubuntu feisty-security universe #deb-src http://security.ubuntu.com/ubuntu feisty-security universe deb http://security.ubuntu.com/ubuntu feisty-security multiverse #deb-src http://security.ubuntu.com/ubuntu feisty-security multiverse ## PLF REPOSITORY (Unsupported. May contain illegal packages. Use at own risk.) ## Medibuntu - Ubuntu 7.04 "feisty fawn" ## Please report any bug on https://launchpad.net/products/medibuntu/+bugs deb http://medibuntu.sos-sts.com/repo/ feisty free non-free #deb-src http://medibuntu.sos-sts.com/repo/ feisty free non-free ## CANONICAL COMMERCIAL REPOSITORY (Hosted on Canonical servers, not Ubuntu ## servers. RealPlayer10, Opera, DesktopSecure and more to come.) deb http://archive.canonical.com/ubuntu feisty-commercial main ## enlightenment e17 beta, use at your own risk ## E17 is in Beta and may break or break your system #deb http://edevelop.org/pkg-e/ubuntu feisty e17 #deb http://e17.dunnewind.net/ubuntu feisty e17 #deb-src http://edevelop.org/pkg-e/ubuntu feisty e17
- 保存編輯過的文件
- 下載需要的 gpg keys; 比如可以下面的命令得到 PLF 源的 gpg key:
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -
- 要想試用 E17 beta, 還需要下載其 gpg key:
wget -q http://lut1n.ifrance.com/repo_key.asc -O- | sudo apt-key add -
- 刷新包列表:
sudo aptitude update
- 也可以生成你自己的sources.list,或到 http://www.ubuntulinux.nl/source-o-matic 尋找其他的源。
- 只有在知道自己在做什麼的前提下才可修改默認的Ubuntu sources.list! 把不同的源混雜在一起可能使你的系統 崩潰。
[編輯] 更新Ubuntu
[編輯] 關於 Apt、軟件和包的基本知識
- 閱讀 #概述
- 閱讀 #如何添加額外的軟件源
這裡說的是如何使用 Apt 包管理工具的一些基本信息。
- 安裝包
sudo aptitude install <packagename>
例:
sudo aptitude install mpd sbackup
- 刪除包:
sudo aptitude remove <packagename>
例:
sudo aptitude remove mpd sbackup
- 搜索包:
sudo aptitude search <keywords>
例:
sudo aptitude search Music MP3 sudo aptitude search "Text Editor"
- 更新 Apt 數據庫 (添加/刪除Apt源后再使用)
sudo aptitude update
- 更新包:
sudo aptitude upgrade
- 更新整個發布(distribution):
sudo aptitude dist-upgrade
- 安裝已下載的 Ubuntu (Debian) 包 (.deb)
sudo dpkg -i package.deb
- 刪除 (Debian) 包
sudo dpkg -r package
- 重新配置/修復已安裝的包
sudo dpkg-reconfigure package
例:
sudo dpkg-reconfigure mpd
- 處理 ".tar.gz" (Tar/GZip) 存檔/壓縮文件
提取:
tar xvzf package.tar.gz
創建:
tar cvfz package.tar.gz folder
- 處理 ".tar.bz" (Tar/BZip) 存檔/壓縮文件
提取:
tar xvjf package.tar.bz
創建:
tar cvjf package.tar.bz folder
- 提取 ".bz" 存檔/壓縮文件
bunzip2 file.bz
- 提取 ".gz" 存檔/壓縮文件
gunzip file.gz
- 由源創建 Building from Source
確認已經安裝了所有需要的開發工具 (如庫、編譯器和頭文件)
sudo aptitude install build-essential sudo aptitude install linux-headers-`uname -r`
提取包 (上面有詳細描述)
tar xvzf package.tar.gz
開始編譯過程
cd /path/to/extracted/package ./configure make make install
如果編譯成功,可以考慮創建一個deb包供將來使用:
安裝打包工具:
sudo aptitude install checkinstall
用"checkinstall"重新創建包:
cd /path/to/extracted/package ./configure make checkinstall
把創建好的 ".deb" 文件留作將來使用。安裝時可用以下命令:
sudo dpkg -i package.deb
注:這些只是一般性的指導,可能不會總是成功。有的包需要其他的依賴並指明一些可選參數值才能成功編譯。
[編輯] 手動更新 Ubuntu
- 閱讀 #概述
- 閱讀 #如何添加額外的軟件源
sudo aptitude update sudo aptitude upgrade sudo aptitude dist-upgrade
或者
用更新管理器: 系統 -> 系統管理 -> 更新管理器
[編輯] Automated Methods
[編輯] 添加/刪除程序
使用添加/刪除這一特性非常容易,不會對你安裝的Ubuntu造成破壞。
- 點"程序"'菜單,選擇"添加/刪除"。
- 尋找你想要添加的那一類程序。例如輸入"MP3"即可看到一個與mp3有關的軟件的列表。
- 在軟件名稱旁邊的複選框打勾。
- 點"應用"按鈕。
- 你會看到一個即將安裝的軟件包的列表。點「確定」。
[編輯] Automatix2
Automatix2 是一個受限的腳本,它試圖安裝某些軟件,但經常失敗並破壞系統。Ubuntu社區並不為其提供支持,我們強烈主張不使用它。由Automatix造成的問題往往很難查明原因和解決,有時還不如重新安裝Ubuntu更省事。
- 從下面這裡獲得這個包 (建議:這個包的版本可能發生變化,在這裡檢查最新版本):
- http://www.getautomatix.com/apt/dists/feisty/main/binary-i386/automatix2_1.1-4.5-7.04feisty_i386.deb
- 安裝使用下面的命令:
sudo dpkg -i automatix2_1.1-3.10-7.04feisty_i386.deb
- Automatix2 位於應用程序 > 系統工具 > Automatix
[編輯] 用apt安裝的方法
第1步:
echo "deb http://www.getautomatix.com/apt feisty main" | sudo tee -a /etc/apt/sources.list
第2步:
wget http://www.getautomatix.com/keys/automatix2.key
第3步:
gpg --import automatix2.key
第4步:
gpg --export --armor E23C5FC3 | sudo apt-key add -
第5步:
sudo apt-get update
第6步:
sudo apt-get install automatix2
[編輯] Add-On Applications
[編輯] Java & Non-Media Browser Plug-ins
[編輯] How to install J2SE Runtime Environment (JRE) v6.0 with Plug-in for Mozilla Firefox
- Read #General Notes
- Read #How to add extra repositories
sudo aptitude install sun-java6-jre sun-java6-plugin sun-java6-fonts
- When asked, agree with DLJ license terms.
This doesn't work for amd64, since there's no 64-bit firefox plugin. A 32-bit firefox is necessary. Ubuntuforums provides special scripts for configuring some 32-bit applications in amd64.k
An alternative for amd64 is to use blackdown Java. However it is buggy and not all Java applications work. It is also a closed source application so no benefit can be derived from using it. It is the default Java application for distributions like Gentoo however.
sudo aptitude install j2re1.4-mozilla-plugin
This installs blackdown Java.
[編輯] How to install Flash Player (Macromedia Flash) Plug-in for Mozilla Firefox
EDIT: Please note that there is a free open source way of using flash posted below. This is using GNASH - a gnu flash replacement. Its not perfect (yet) however for those interested in open source software please skip below. It works on both 32 and 64 bit Ubuntu. - Pete
Note: The best way to install the Macromedia Flash Player plug-in for Mozilla Firefox is to use Firefox and visit Adobe.com: Version test for Adobe Flash Player. Then you will see a note about firefox missing a plugin for flash. Click this note and follow any steps that firefox tells you to follow. Normally firefox installs this plugin automatically when you click "install now".
It could also be done using a package manager:
- Read #General Notes
- Read #How to add extra repositories
sudo aptitude install flashplugin-nonfree
- Restart Mozilla Firefox
Note: if sound doesn't work in Flash Player (for example on YouTube):
sudo aptitude install alsa-oss gksudo gedit /etc/firefox/firefoxrc
Change:
FIREFOX_DSP=""
To:
FIREFOX_DSP="aoss"
- Restart Mozilla Firefox. Now sound should work in Flash Player.
This doesn't work for amd64, since there's no 64-bit firefox plugin. A 32-bit firefox is necessary. Ubuntuforums provides special scripts for configuring some 32-bit applications in amd64.
If after trying the above you still don't have sound in Flash try this:
How to setup PulseAudio Sound Server
I actually found PulseAudio to be a better solution, firefox shares the sound with other apps.
GNASH open source alternative
64 bit users please note - this is a better workaround than installing 32 bit firefox. If you require only simple flash (ie not YouTube etc) the you can use the GPL version of flash within your browser.
For a workaround to playing YouTube and Google video please keep reading.
code:
sudo aptitude install mozilla-plugin-gnash
This works for most flash sites other than Youtube and Google video. However as this is a showstopper for a lot of People and I have been hearing NOTHING but complaints about this so I have located a workaround for all of you.
Goto the website
http://1024k.de/bookmarklets/video-bookmarklets.html
Where the site states "bookmark this link" right click and book mark it.
Then head over to youtube. Try to watch a video and note it does not play :(
Then go to your newly created bookmark. You can now download the file as a video file. I use VLC to play the files (so see installing VLC later in this guide).
All you have to do is download the file to your desktop and open with VLC. GNASH is soon going to be updated as a fully working version that can play youtube videos so this workaround will only be temporary anyway. So go on - support open source software so we can stop relying on Adobe for its flash player. - pete
[編輯] 怎樣安裝 P2P BitTorrent 客戶端 (Azureus)
- 閱讀 #概述
- 閱讀 #如何安裝額外的軟件源
- 閱讀 azureus Bittorrent 安裝指南,有截圖
sudo aptitude install azureus
- 到這裡打開該程序: 應用程序 -> Internet -> Azureus
[編輯] How to install P2P BitTorrent Client (Deluge)
- Read #General Notes
- Download deb installation file here if you run i386 or here if you run amd64 and then double-click on it when downloaded.
OR
- Download dependencies, get latest source, build the source, and install
sudo aptitude install subversion build-essential python-all-dev python-all \ python-support libboost-dev libboost-thread-dev libboost-date-time-dev \ libboost-filesystem-dev libboost-serialization-dev \ libboost-program-options-dev libboost-regex-dev zlib1g-dev && \ svn checkout http://deluge-torrent.org/svn/trunk deluge && \ cd deluge && python setup.py build && sudo python setup.py install
- Remove install files
cd .. && rm -Rf deluge/
- Download Deluge Plugins (Optional)
- Launch the program by going to: Applications -> Internet -> Deluge BitTorrent Client
[編輯] 如何安裝Wine
sudo aptitude install wine
[編輯] 如何在wine下使用utorrent
這裡假定你已經下載utorrent並已安裝wine.
sudo gedit /usr/bin/utorrent
將下面段落貼入該文件
#!/bin/sh
cd ~/YOURPATH/utorrent
if [ "$1" != "" ]; then
var="`echo $1 | sed 's/\//\\\/g'`"
var="Z:${var}"
wine utorrent.exe "$var"
else
wine utorrent.exe
fi
把 "YOURPATH" 改成你的uTorrent的位置. 保存,退出,並執行以下命令使該文件可執行:
sudo chmod a+x /usr/bin/utorrent
[編輯] How to install a Quran researching tool (zekr) and/or Gnomesword (bible program)
Quran install:
- Read #General Notes
- Read #How to add extra repositories
- Read #How to install J2SE Runtime Environment (JRE) v6.0 with Plug-in for Mozilla Firefox
Zekr is an open platform Quran study tool for simply browsing and researching on the Holy Quran. It is a Quran-based project, planned to be a universal, open source, and cross-platform application to perform most of the usual refers to Quran. The main idea is to build an as generic as possible platform to accept different Islamic resources.
Currently Zekr has English, Persian, French, German, Arabic, Indonesian, Russian, Dutch, Kurdish, Malay, Turkish and Urdu built-in language packs. In addition, it includes English, Persian, and Russian Quran translations.
- Make sure that Sun JRE is the default JRE (zekr also works with the new version of gij).
- Run the following command in the terminal:
sudo gedit /etc/apt/sources.list
- Add The following line at the end of the file:
deb http://siahe.com/zekr/apt feisty main
- Add the GPG key
wget -q http://siahe.com/zekr/apt/zekr.debian.gpg -O- | sudo apt-key add -
- Run the following commands in the terminal:
sudo apt-get update sudo apt-get install zekr sudo apt-get install ttf-farsiweb ttf-arabeyes ttf-me-quran ttf-scheherazade
- If you are upgrading from a previous installed version of zekr, to use the new font configuration of zekr run the following command in the terminal:
mv ~/.zekr ~/.zekr-backup
- For more info see http://siahe.com/zekr/apt/index.html
[編輯] 安裝聖經
步驟 1: 打開終端,輸入:
sudo aptitude install gnomesword sword-language-pack-en sword-text-web
這樣就安裝了英文聖經軟件。如果還需要其他語言,輸入:
sudo apt-cache search bible
看一下 sword-language-pack's 和 sword-text's 以尋找其他語言,按需要安裝。Gnomesword 在 應用程序-附件 中可以找到。
[編輯] Games
[編輯] Super Nintendo Emulator (ZSNES)
- Read #General Notes
wget -c http://www.dfreer.org/~dfreer/zsnes/zsnes_latest_i386.deb sudo dpkg -i zsnes_latest_i386.deb
- Applications > Games > zsnes
[編輯] For AMD64
- Read #General Notes
wget -c http://www.dfreer.org/~dfreer/zsnes/zsnes_latest_amd64.deb sudo dpkg -i zsnes_latest_amd64.deb
- Applications > Games > zsnes
[編輯] Playstation 1 Emulator (pSX)
- Read #General Notes
For support or questions see http://ubuntuforums.org/showthread.php?t=394097
wget -c http://www.dfreer.org/~dfreer/pSX/pSX_latest_i386.deb sudo dpkg -i pSX_latest_i386.deb
- Applications > Games > pSX
[編輯] For AMD64
- Read #General Notes
For support or questions see http://ubuntuforums.org/showthread.php?t=394097
sudo aptitude install ia32-libs ia32-libs-sdl ia32-libs-gtk wget -c http://www.dfreer.org/~dfreer/pSX/ia32-libs-gtkglext1_latest_amd64.deb wget -c http://www.dfreer.org/~dfreer/pSX/pSX_latest_amd64.deb sudo dpkg -i ia32-libs-gtkglext1_latest_amd64.deb sudo dpkg -i pSX_latest_amd64.deb
- Applications > Games > pSX
[編輯] 防火牆
[編輯] 如何安裝防火牆 (Firestarter)
sudo aptitude install firestarter
- 系統 -> 系統管理 -> Firestarter
要了解更多信息請訪問: http://www.fs-security.com/
[編輯] 怎樣使 Firestarter關閉時最小化為面板的圖標
- 首先關閉 Firestarter
- 首選項 -> 勾選 "Enable tray icon" -> 接受
[編輯] 怎樣使 Firestarter 啟動后自動運行
- 系統 -> 首選項 -> 會話 -> 啟動程序 -> 新建:
- 名稱:
Firestarter
- 命令:
sudo firestarter --start-hidden
- 點「確定」
[編輯] 怎樣不用根用戶密碼啟動 Firestarter
警告:這樣做很不安全!!!
- 閱讀 安全須知
export EDITOR=gedit sudo visudo
- 找到 # Defaults 部分
- 在這一行前面加上#: Defaults !lecture,tty_tickets,!fqdn
- 現在這一行看起來應該是這樣:
#Defaults !lecture,tty_tickets,!fqdn
- 然後把下面這一行加到後面:
Defaults !lecture,tty_tickets,!fqdn,env_reset,env_keep+="DISPLAY HOME XAUTHORIZATION"
- 在該文件最後加上這一行:
your_user_name ALL= NOPASSWD: /usr/sbin/firestarter
記得用你的真實用戶名代替 'you_user_name'
- 保存這個文件,重啟電腦。
[編輯] Multimedia Players & Browser Plug-ins
[編輯] 在Firefox中播放流媒體
這會使你在Firefox中播放流媒體更加暢快。安裝Firefox 的 MultiMediaConnectivity 插件,這樣就可以為不同類型的媒體更改默認媒體播放器,而且可以脫離Firefox單獨播放。
[編輯] 怎樣安裝多媒體編碼/解碼器
- 閱讀 #概述
- 閱讀 #怎樣添加額外的軟件源
sudo apt-get install ubuntu-restricted-extras libxine-extracodecs gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ gstreamer0.10-plugins-bad gstreamer0.10-pitfdll
"ubuntu-restricted-extras" 是一個超級包,安裝的內容有:flashplugin-nonfree, gstreamer0.10-plugins-ugly, gstreamer0.10-plugins-ugly-multiverse, msttcorefonts, sun-java6-jre 和 sun-java6-plugin 重要提示:w32codecs 是侵犯版權的,因為這些編碼/解碼器基本上是各種Windows軟件附帶的那些動態鏈接庫(DLLs)的完全複製品。
sudo apt-get install w32codecs
Kubuntu 用戶注意:從技術上講,Kaffeine所需要的包只有libxine-extracodecs 和 w32codecs。不過以上所有這些包的安裝並不會破壞任何東西,因為這些包也可能是其他程序所需要的。(例如Open Office Impress要用到一個gstreamer插件在演示文稿中顯示視頻。)
[編輯] 怎樣安裝DVD播放功能
ironss: gstreamer dvd plugin is available as part of plugins-bad (or ugly?) and does not work reliably. However, Totem works with the xine backend to play back DVDs. This will keep you going until gstreamer gets dvd playback. Note that you do not have to install xine-ui or mplayer as suggested in
- 閱讀 #概述
- 閱讀 #如何添加額外的軟件源
sudo aptitude install libdvdread3 sudo /usr/share/doc/libdvdread3/install-css.sh sudo aptitude install totem-xine
sudo aptitude install libdvdcss2
[編輯] How to install MIDI sound server (Timidity++)
- Read #General Notes
- Read #How to add extra repositories
- Timidity allows for the playback of MIDI by those who do not have MIDI hardware or MIDI processing built into their sound card (most users) via a software synthesizer.
- First install Timidity
sudo aptitude install timidity
- Set up Timidity to start on boot
sudo gedit /etc/default/timidity
- Uncomment the following line (remove the "#" sign)
#TIM_ALSASEQ=true
- Set the required modules to load as well
sudo gedit /etc/modules
- Add the following modules to the end of the file
snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event snd-seq
- Restart your computer
[編輯] How to install Multimedia Playing Server (MPD)
- Read #General Notes
- Read #How to add extra repositories
Note: MPD is a audio playing server. It acts as a digital jukebox allowing playlist management over the network. The computer with MPD running on needs to be connected to an Amplifier (or similar) as it does not stream audio by default, it simply plays it. However, it can be configured to stream using Icecast and JACK.
- Install MPD
sudo aptitude install mpd
- Create link to your audio (MP3 etc) collection
sudo ln -s /path/to/your/music /var/lib/mpd/music/collection
- Restart MPD
sudo /etc/init.d/mpd restart
- Advanced Configuration
gksudo gedit /etc/mpd.conf
- Install standard Gnome client
Alternative clients, including web-based versions are detailed on the MPD Wiki.
sudo aptitude install gmpc
- Configure GMPC
Click Applications > Sound & Video > Gnome Music Player Client
Click on Options icon, set Host, Port and connection options. The default settings will connect to MPD running on "localhost". Set the "Autoconnect" option if required. The default MPD port is 6600, make sure you unblock this port on your firewall.
- Using GMPC
Click on Playlist icon. Expand the "Browse Filesystem" tree, right-click on your audio collection and click "Update". This will cause the MPD server to reindex your audio files. No files are changed during this process.
When completed, navigate through your audio via the "Browse Filesystem" tree. Right-click on folders and tracks to add them to playlist, or manage existing playlist.
[編輯] 如何安裝多媒體播放器 (xine-ui)
- 閱讀 概述
- 閱讀 如何添加額外的軟件源
- 閱讀 如何安裝多媒體編碼/解碼器Codecs
- 閱讀 如何添加DVD播放功能
sudo aptitude install xine-ui libxine-extracodecs
- 應用程序 -> 影音 -> xine
[編輯] 如何安裝多媒體播放器 (MPlayer)
- 閱讀 概述
- 閱讀 如何添加額外的軟件源
- 閱讀 如何安裝多媒體編碼/解碼器Codecs
- 閱讀 如何添加DVD播放功能
sudo aptitude install mplayer libxine-extracodecs
- 注:Kubuntu用戶也可以安裝MPlayer的KDE用戶界面。
sudo aptitude install kmplayer
- 也可以安裝Firefox的一個MPlayer擴展:
sudo aptitude install mozilla-mplayer
- 應用程序 -> 影音 -> MPlayer
[編輯] 怎樣安裝多媒體播放器 (VLC)
sudo aptitude install vlc vlc-plugin-*
- 要用vlc播放視頻媒體流,還需要安裝以下這些包
sudo aptitude install avahi-daemon sudo aptitude install avahi-utils
- 也可以安裝Firefox的 VLC 擴展
sudo aptitude install mozilla-plugin-vlc
- 應用程序 -> 影音 -> VLC Media Player
[編輯] 怎樣安裝多媒體播放器 (XMMS)
sudo aptitude install xmms xmms-skins xmms-wma
- 應用程序 -> 影音 -> XMMS
[編輯] 怎樣安裝多媒體播放器(Songbird)
- 閱讀 #概述
- 閱讀 #怎樣安裝多媒體編碼/解碼器
首先下載 shell script from Psychocats.net Open up the terminal and type these commands in one at a time
cd Desktop chmod +x installsongbird.sh ./installsongbird.sh
- 應用程序 -> 影音 -> Songbird
卸載 Multimedia Player shell script and use the same instructions that you used to install songbird but substitute install with remove.
[編輯] 怎樣安裝多媒體播放器 (amaroK)
- 閱讀 #概述
- 閱讀 #怎樣添加額外的源
- 閱讀 #怎樣安裝多媒體編碼/解碼器
- Kubuntu 用戶注意: Amarok 已經安裝在 Kubuntu 中了。
sudo aptitude install amarok
- 應用程序 -> 影音 -> AmaroK
注意: 如果 amarok 報錯說"dcopserver"程序沒在運行, 則按照 http://www.ubuntuforums.org/showthread.php?t=107269&highlight=dcopserver的提示
sudo chown -R `whoami`:`whoami` ~/.*
[編輯] 怎樣卸載 amaroK
sudo aptitude remove amarok
[編輯] 怎樣安裝音樂管理和播放軟件 (Banshee)
- 閱讀 #概述
- 閱讀 #怎樣添加額外的源
- 閱讀 #怎樣安裝多媒體編碼/解碼器
sudo aptitude install banshee
[編輯] 怎樣 Banshee
sudo aptitude remove banshee
[編輯] 怎樣安裝多媒體播放器 (RealPlayer 10)
- 閱讀 #概述
- 閱讀 #如何添加額外的軟件源
sudo aptitude install realplay
- 注:'realplay"是從PDF源安裝RealPlayer 10,如果你想用這裡的指南請添加PDF源。'realplayer'則是從multiverse源安裝RealPlayer 8。
- 應用程序 -> 影音 -> RealPlayer 10
同時也會自動安裝它用於顯示Firefox中嵌入式real視頻所需要的所有插件。
- 要避免在切換窗口時屏幕閃爍或者變成空白,請到
- RealPlayer 10 -> Tools -> Preferences -> Hardware -> Uncheck XVideo
- 要避免聲音方面的問題
- 確認你安裝了ALSA OSS驅動。
sudo aptitude install alsa-oss
然後編輯啟動腳本 (/usr/lib/realplay-10.0.8/realplay),把第73行從
$REALPLAYBIN “$@”
改為
aoss $REALPLAYBIN “$@”
其他的替代源
給installer添加執行權限,然後再執行。
chmod +x RealPlayer10GOLD.bin sudo ./RealPlayer10GOLD.bin
[編輯] 怎樣安裝Stream Directory Browser (streamtuner)
sudo aptitude install streamtuner streamripper
- 應用程序 -> 影音 -> streamtuner
[編輯] 如何卸載Stream Directory Browser (streamtuner)
sudo aptitude remove streamtuner streamripper
[編輯] 怎樣安裝Internet TV (DemocracyTV beta)
- Version 0.9.2.1 is in the feisty repositories. Works fine for me.
安裝Democracy Player, 安裝dependencies, 然後添加額外的源.
sudo aptitude install democracy player sudo aptitude -f install sudo aptitude install libxine-extracodecs
應用程序->影音->Democracy TV
[編輯] 怎樣安裝Firefox的多媒體插件
- 閱讀 #概述
- 閱讀 #怎樣添加額外的軟件源
- 用戶只需安裝以下插件中的一種。從中選擇與你最喜愛的媒體播放器相配的插件。如果安裝了多種插件,Firefox只使用最近安裝的那個。
- 注意:下面這些都可以,但建議Kubuntu用戶選擇Kaffeine,Ubuntu用戶建議選擇Totem,因為這些程序分別是這兩個發行版的默認媒體播放器。
[編輯] Totem 插件 (Ubuntu 用戶)
- 閱讀 #概述
- 閱讀 #怎樣添加額外的軟件源
- 閱讀 #怎樣安裝多媒體編碼/解碼器
- 閱讀 #怎樣安裝DVD播放功能
sudo aptitude install totem-gstreamer-firefox-plugin
- 重啟 Mozilla Firefox
[編輯] Kaffeine 插件 (Kubuntu 用戶)
- 閱讀 #概述
- 閱讀 #怎樣添加額外的軟件源
- 閱讀 #怎樣安裝多媒體編碼/解碼器
- 閱讀 #怎樣安裝DVD播放功能
sudo aptitude install kaffeine-mozilla
- 重啟 Mozilla Firefox
[編輯] MPlayer 插件 (同時要安裝MPlayer)
- 閱讀 #概述
- 閱讀 #怎樣添加額外的軟件源
- 閱讀 #怎樣安裝多媒體編碼/解碼器
- 另參見:#怎樣安裝多媒體播放器(MPlayer)
sudo aptitude install mozilla-mplayer
- 重啟 Mozilla Firefox
- 應用程序 -> 影音 -> MPlayer Movie Player
[編輯] VLC 插件 (同時要安裝 VLC 媒體播放器)
- 閱讀 #概述
- 閱讀 #怎樣添加額外的軟件源
- 另參見:#怎樣安裝媒體播放器 (VLC)
sudo aptitude install vlc vlc-plugin-* mozilla-plugin-vlc
- 要用vlc播放視頻媒體流,還需要安裝以下這些包:
sudo aptitude install avahi-daemon sudo aptitude install avahi-utils
- 應用程序 -> 影音 -> VLC 媒體播放器
[編輯] 其他桌面環境
[編輯] 怎樣安裝 KDE
sudo aptitude install kubuntu-desktop
- 提示: 這個安裝要求大約400MB的硬盤空間
- 系統 -> 註銷 -> 登出
- 通過點擊會話並點選KDE來登錄到KDE
[編輯] 怎樣安裝 XFCE
sudo aptitude install xubuntu-desktop
如果錯誤,可以嘗試 sudo apt-get install xubuntu-desktop
- 系統 -> 註銷 -> 登出
- 通過點擊會話並點選XFCE來登錄到XFCE
[編輯] 怎樣安裝 FluxBox
這裡有些 屏幕抓圖. Fluxbox 是一個流行並小巧的窗口管理器.
sudo aptitude install fluxbox
[編輯] 使它在您使用GDM登錄時啟動
echo "exec startfluxbox" > ~/.xinitrc
[編輯] 使它在登錄時伴有好聽的登錄音
sudo aptitude install sox gedit ~/.fluxbox/startup
- 找到這一行:
exec /usr/local/bin/fluxbox
- 將這裡這一行放到前邊那一行前面:
play /usr/share/sounds/login.wav > /dev/null 2>&1 &
- 享受登錄音.
[編輯] 怎樣掛載 Windows 分區
[編輯] 怎樣掛載 NTFS 分區
[編輯] 視覺效果
[編輯] 安裝 Beryl (ATI顯卡)
- 閱讀: #概述
- 參考: ubuntuforums.org
"這裡的所有內容都來源於上面鏈接中論壇用戶的討論,放在這個wiki里的目的是(希望)使其他用戶無需自行搜索解決方案。這些方法在Feisty Fawn i386版已經得到驗證。如果哪位朋友知道AMD64位版本也兼容請修改一下這些內容。
- 打開終端:
应用程序 > 附件 > 终端
- 確保系統為最新:
sudo apt-get update sudo apt-get upgrade
- 安裝 Xgl (這是ATI顯卡遇到的主要問題。fglrx驅動將不支持Ubuntu內置的Compiz特性,因此用ATI顯卡的用戶需要用到Xgl來運行新版本的Beryl):
sudo apt-get install xserver-xgl
- 寫一個腳本以使Xgl自己啟動:
sudo gedit /usr/local/bin/startxgl.sh
- 輸入並保存以下腳本內容:
#!/bin/sh Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer & DISPLAY=:1 exec dbus-launch --exit-with-session gnome-session
- If you are missing your shutdown and restart buttons, use this instead:
#!/bin/sh Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer & DISPLAY=:1 cookie="$(xauth -i nextract - :0 | cut -d ' ' -f 9)" xauth -i add :1 . "$cookie" exec dbus-launch --exit-with-session gnome-session
- 將該腳本改為可執行:
sudo chmod a+x /usr/local/bin/startxgl.sh
- 現在需要把一個 Xgl 選項加入GDM登錄畫面:
sudo gedit /usr/share/xsessions/xgl.desktop
- 輸入並保存以下腳本內容:
[Desktop Entry] Encoding=UTF-8 Name=GNOME with XGL Comment= Exec=/usr/local/bin/startxgl.sh Icon= Type=Application
- 也將這本腳本改為可執行:
sudo chmod a+x /usr/share/xsessions/xgl.desktop
- 禁用 universe 源 (這些源里提供的Beryl軟件與fglrx驅動不兼容).
找到 系统 > 系统管理 > 软件源 把 社区维护的开源软件 (universe) 前面的勾去掉。 点“关闭”。
回到終端:
- 加入正確的源密鑰:
sudo wget http://ubuntu.beryl-project.org/root@lupine.me.uk.gpg -O- | sudo apt-key add -
- 在apt源列表中加入正確的源:
sudo gedit /etc/apt/sources.list 输入: deb http://ubuntu.beryl-project.org/ feisty main 保存并关闭 gedit
- 更新 apt 源:
sudo apt-get update
- 安裝正確的 Beryl 應用程序:
sudo apt-get install beryl emerald-themes
Apt 應該會下載所有的依賴,比如插件和庫。
- 安裝 ATI 驅動 (如果需要):
找到 系统 > 系统管理 > 受限驱动管理器 把你的ATI显卡前面的复选框打上勾。
這時需要重啟計算機以啟動顯卡。
- 重啟后,在會話中的登錄畫面選擇Xgl以檢測Beryl。在終端里輸入:
beryl-manager emerald --replace
你應該看到時鐘旁邊的Beryl紅鑽石圖標了。拖動一個窗口試試看,你可能需要右鍵點擊鑽石圖標,然後在飛出的"Select Window Manager"中選擇"Beryl",然後在飛出的"Select Window Decorator"中選擇"Standard Beryl Decorator (Emerald)"。另外可能需要在同一菜單下為每一個飛出的窗口點擊Reload。
- 如果用ATI顯卡的 XGL效果,你會得到一個錯誤信息,說 beryl-xgl 不存在。對此的解決辦法有些笨拙,不過可以用:
下载 beryl-core 的 deb包: http://ubuntu.beryl-project.org/pool/feisty/main/0.2.0/beryl-core_0.2.0~0beryl1_i386.deb 从压缩文件中提取 beryl-xgl 到某个目录,比如 ~/Desktop 在终端输入: sudo cp ~/Desktop/beryl-xgl /usr/bin/beryl-xgl
- 如果一切看來都順利的話,把 Beryl 和 Emerald 主題加到啟動程序中去:
找到 系统 > 首选项 > 会话 点“新建” 在“名称”中输入 "Beryl" (不带引号) 在“命令”中输入 "beryl-manager" (不带引号) 点“确定”。 点“新建” 在“名称”中输入 "Emerald Themes" (不带引号) 在“命令”中输入 "emerald --replace" (不带引号) 点“确定”。
祝賀你!你的Beryl應該就可以正常運行了。現在可以把universe源重啟啟用,不過要確認不要讓這個源更新與Beryl有關的任何東西。或許universe源中的Beryl應用程序不久就可以運行於ATI顯卡(不帶Xgl)。
Alternative to installing Beryl (As of 01/05/07 this has been confirmed and tested on a 64 bit system as well) - I found this worked better for me (especially on older ATI cards). I would suggest trying this first as it is very simple and no damage should be caused to your system. It is also very easy to revert if it does not work (without a fresh install).
This assumes that you are not going to use the proprietary drivers and that the (Open Source) radeon drives are working ok for you. It will also use AIGLX. Don't worry if direct rendering is not working for you yet as this will software render (slowly) until you can get that up and running.
Step 1 : Edit your sources.list file adding
deb http://ubuntu.beryl-project.org feisty main
to the bottom of it.
Step 2 : Add the GPG key. Open terminal and type
wget http://ubuntu.beryl-project.org/root@lupine.me.uk.gpg -O- | sudo apt-key add -
Step 3 :
sudo aptitude update
Step 4 :
sudo gedit /etc/X11/xorg.conf
(Note any changes so you can revert back if needed).
Under Section "Module", make sure that the following lines are included, and add them if they are not:
Load "dri" Load "vbe" Load "glx"
Also ensure the bottom of the file has:
Section
"DRI" Mode 0666
EndSection
Step 5 : Reboot the system (Please don't restart only X. I had odd things happen to me when I skipped rebooting until my next proper restart).
Step 6 : In a terminal:
sudo aptitude install beryl beryl-manager emerald-themes
Step 7 : type into terminal
beryl-manager --no-force-window-manager
(this will start beryl but wont activate it yet).
Step 8 : Right click on the diamond near the clock - select advanced beryl options and change rendering path to copy. Also under advanced change rendering platform to force AIGLX.
Step 9 : Right click the diamond again. This time - select window manager - Beryl.
If it all works and you can spin the cube ok etc. you can try changing the rendering path back to automatic. If it all freaks out just reboot and start beryl again with:
beryl-manager --no-force-window-manager
Step 10 : Assuming it all worked ok you need beryl to start automatically on boot : Click System-Preferences-sessions. Click add and type
beryl-manager
Now reboot - beryl should all be sweet.
Help! Everytings broken!! Ok so you did all this and it didn't work for you/your GUI is now broken etc. Revert all changes by following these steps.
Step undo 1 : Drop to console outside GUI. and type
rm ~/.config/autostart/beryl-manager.desktop
This removes beryl from startup.
Step undo 2 : sudo nautilus from terminal. Then show hidden files. Browse to you users home directory and delete the .beryl folder. Alternatively do this from via command line but your GUI should be working now.
Step undo 3 :
sudo aptitude purge beryl beryl-manager emerald-themes
Step undo 4 : Edit your sources.list file again and remove the added source for beryl. Then revert any changes you made earlier to your Xorg.conf file.
That's it. Your system is back as it was before you started. All the undo steps can be done without a GUI from the console
Good luck - I can vouch this method works for me on at least 2 different notebooks and a PC.
[編輯] How to install Compiz (Nvidia)
- How to enable Compiz in Feisty Simple tutorial how to enable compiz with Nvidia drivers
[編輯] How to install Beryl (Nvidia)
- Read #General Notes
- Read #How to add extra repositories
- Read Beryl and Nvidia Drivers Installation Steps
- Ensure all packages up to date
sudo aptitude update sudo aptitude dist-upgrade
- Back up xorg.conf
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup gksudo gedit /etc/X11/xorg.conf
- Install Nvidia Driver for Graphics Card*
- System -> Administration -> Restricted Driver Manager
Enable Nvidia Drivers
Ctrl+Alt+Backspace to confirm Nvidia Drivers are working correctly
- Install Beryl
sudo aptitude install beryl emerald-themes beryl-manager
- Start Beryl
beryl-manager
- Start Emerald (if it doesn't start on its own)
emerald --replace
- Have Beryl and Emerald load on login
- System -> Preferences -> Sessions
- Startup Programs -> New
beryl-manager
and
emerald --replace
- If, on reboot, program menus aren't displaying in the correct layer (you can't see them when you select them because they are displaying behind the window) then right click on the 'Beryl Manager' icon in the panel (the red gem icon) and select 'Reload Window Manager'. The problem should be solved the next time you reboot.
- If when you start Beryl you find your windows have no title bar (with the minimise, maximise and close buttons) or borders, you may need to add the following line to the device section of the file /etc/X11/xorg.conf (See this page http://forum.beryl-project.org/viewtopic.php?f=35&t=1631 for details):
Option "AddARGBGLXVisuals" "True"
and change to
DefaultDepth 24
in the "Screen" section.
[編輯] What to do if Video players crash while using Beryl
see bug 96226 Currently you will need to change video driver from xv to x11 in ~/.mplayer/config ang gstreamer-properties
[編輯] How to improve sub-pixel font rendering for Feisty
This will dramatically improve the appearance of fonts with respect to the default Ubuntu install. The patched libraries are built against Freetype 2.3.x (not currently in feisty) and include David Turner's sub-pixel rendering patches.
- For i386 add the following to /etc/apt/sources.list
deb http://www.telemail.fi/mlind/ubuntu feisty fonts deb-src http://www.telemail.fi/mlind/ubuntu feisty fonts
- For AMD64/EMT add the following to /etc/apt/sources.list
deb http://raof.dyndns.org/falcon feisty experimental deb-src http://raof.dyndns.org/falcon feisty experimental
- Packages you're about to upgrade are libfreetype6, libcairo2 and libxft2
sudo aptitude update sudo aptitude install libfreetype6 libcairo2 libxft2
- After the install, you may want reconfigure font settings. The following settings work well: Native, Automatic, No bitmapped fonts.
sudo dpkg-reconfigure fontconfig-config sudo dpkg-reconfigure fontconfig
- If you get errors about missing gpg key
gpg --keyserver subkeys.pgp.net --recv-keys 937215FF gpg --export --armor 937215FF | sudo apt-key add -
- GPG key to repository for AMD64/EMT packages
wget http://ubuntu.moshen.de/2F306651.gpg -O- | sudo apt-key add -
- At this point you can reboot your computer or restart X (Ctrl-Alt-BackSpace) to see the changes take affect.
Note:
If you later decide to go back to Ubuntu packages, you must downgrade all three installed packages
source: http://ubuntuforums.org/showthread.php?t=343670
[編輯] How to configure GLSlideshow
- GLSlideshow is a screensaver that shows your images in a slideshow with smooth panning and fading. To enable it:
System > Preferences > Screensaver Choose GLSlideshow
- Feisty doesn't offer a way to edit the directory for the images. To change it, create a .xscreensaver file in your home directory:
gedit .xscreensaver
- Add this line:
imageDirectory: /path/to/images/
- Save it and test the screensaver by locking your screen. You'll see your images, but it will repeat the same one over and over. To fix this, change your glslideshow.desktop configuration file:
gksudo gedit /usr/share/applications/screensavers/glslideshow.desktop
- Look for the following entry:
Exec=glslideshow -root
- Modify this line to instead read:
- See the manpage for glslideshow for what these options do, and to see more options:
Exec=glslideshow -root -duration 10 -pan 10 -fade 3
- Save and try the screensaver again. You should see all of your images in a random-ordered slideshow.
source: http://rclermont.blogspot.com/2007/02/modifying-glslideshow-settings-in_28.html
[編輯] 商業應用程序
[編輯] 虛擬技術
[編輯] Virtualbox
Innotek VirtualBox 是x86下的多功能的完整虛擬計算機. 其應用領域包括服務器、桌面型和嵌入型,是目前唯一一個擁有專業水準的虛擬技術解決方法,而且,它是開源的。
[編輯] Vmware Server
VMware Server是Windows和Linux平台下擁有企業級支持和VirtualCenter管理的免費虛擬計算機。它致力於推進虛擬化技術,運行迅速,方便使用。
[編輯] Linux下如何安裝Windows 9X/ME/2000/XP
[編輯] 如何安裝Windows程序 (VMWare Server 或Workstation)
http://www.vmware.com
VMWare 提供的VMWare Server是免費的,而VMWare Workstation則是收費的. VMWare Server下Ubuntu和Windows之間是不能互通的(需要通過像samba等程序)。除此之外,它的其他方面功能齊備. 它還有一個優點就是桌面獨立。你可以在和Windows已建立或重新建立會話期間重啟GNOME/KDE. 安裝嚮導同樣適用於VMWare和Workstation.
下載VMWare Server http://www.vmware.com/download/server/
選擇tar.gz格式的版本,不要選rpm版本 (你沒必要轉換它), 下載后解壓縮。
請確保你滿足編譯包所需的環境:
sudo aptitude install build-essential linux-headers-`uname -r`
切換至vmware server展開后的目錄,執行:
sudo ./vmware-install.pl
所需的部件將會被安裝,除非你有足夠的理由,否則請保留默認值. 安裝完畢會提示你啟用你的配置,選擇 "是".
接受協議,並使用提供的默認值. 編譯時期出錯不要慌張,只需安裝2個包便可,均是非常容易安裝的。 相信不久后vmware會對安裝過程的問題進行修補的,但目前問題仍然存在.
下載: http://icanthack.com/wp-content/uploads/2007/01/vmmon.tar http://icanthack.com/wp-content/uploads/2007/01/vmnet.tar
確保你擁有root的權限,並將它們 (仍是tar包狀態) 放入 /usr/lib/vmware/modules/source, 覆蓋原來的包(如果你希望保留原來的包,將其重命名即可)
然後以root的身份重新執行:
sudo vmware-config.pl
一切應該正確無誤,編譯所需的核心模塊及其他, 這時會出現配製網絡情況,請參考vmware安裝嚮導。一切準備就緒后你便可以開始了.
本文參考 Chris Rose的http://icanthack.com/?p=53
[編輯] 如何安裝Windows程序 (CrossOver Office)
[編輯] 如何安裝Windows遊戲 (Cedega)
[編輯] 如何安裝 Maple 11
1) 以sudo權限登入.
2) 插入 Maple 11 cd for Linux.,並選擇掛載。
3) 打開終端,鍵入:
cd /cdrom
sudo sh ./installMapleLinux32
4) 輸入你的密碼.
5) 選擇安裝在 /usr/local/maple11 ,而不使用默認值.
6) 安裝(並激活)完成後,創建如下軟符號鏈接: 在終端鍵入
cd /usr/local/bin
sudo ln -s /usr/local/maple11/bin/xmaple
sudo ln -s /usr/local/maple11/bin/maple
sudo ln -s /usr/local/maple11/bin/mint
7) 收工!
[編輯] 用戶管理
[編輯] 怎樣設置/更改/啟用 root用戶密碼
- 閱讀 #概述
sudo passwd root
[編輯] 怎樣禁用root用戶密碼
- 閱讀 #概述
sudo passwd -l root
[編輯] 怎樣允許root用戶登錄到 GNOME
- 閱讀 #概述
- 閱讀 #怎樣設置/更改/啟用 root用戶密碼
- 系統 -> 系統管理 -> 登錄窗口
- 登錄窗口首選項
“安全”标签 -> 安全 -> 允许本地系统管理员登录 (打勾)
[編輯] 怎樣在控制台(console)模式切換到root用戶
- 閱讀 #概述
sudo -s -H Password: <specify user password>
或
sudo su Password: <specify user password>
[編輯] 怎樣添加/編輯/刪除系統用戶
- 閱讀 #概述
- 系統 -> 系統管理 -> 用戶和組
- 用戶和組
用户标签 -> 添加用户.../属性/删除
- 或
sudo useradd jim sudo userdel jim
- 更多信息參見
man usermod
[編輯] 怎樣添加/編輯/刪除系統用戶組
- 閱讀 #概述
- 系統 -> 系統管理 -> 用戶和組
- 用戶和組
组标签 -> 添加组.../属性/删除
[編輯] 怎樣自動登錄到 GNOME (不安全)
- 閱讀 #概述
- 系統 -> 系統管理 -> 登錄窗口
“安全”标签 -> 启用自动登录 (打勾) 从下拉菜单中选择一个用户。
[編輯] 怎樣允許更多的 sudoers
- 閱讀 #概述
EDITOR=gedit sudo visudo
- 把下面一行添加到文件末尾:
system_username ALL=(ALL) ALL
- 保存文件
或者 既然admin組中的每個成員都可以使用sudo:
sudo adduser a_username admin
This appends the admin group to the user's supplementary group list. They will now have sudo access.
[編輯] 怎樣使 "sudo" 不提示輸入密碼 (不安全)
- 閱讀 #概述
EDITOR=gedit sudo visudo
- 找到這一行
... system_username ALL=(ALL) ALL ...
- 用下面一行代替
system_username ALL=(ALL) NOPASSWD: ALL
- 保存文件
[編輯] How to explicitly destroy the "sudo" session
- Read #General Notes
sudo -K
[編輯] How to change files/folders permissions
- Read #General Notes
Right click on files/folders -> Properties
Permissions Tab -> Read/Write/Execute (Checked the permissions for Owner/Group/Others)
[編輯] How to change files/folders ownership
- Read #General Notes
sudo chown system_username /location_of_files_or_folders
If you want to change ownership of all containing files and folders recursively, use the -R option like this:
sudo chown -R system_username /location_of_files_or_folders
[編輯] How to change files/folders group ownership
- Read #General Notes
sudo chgrp system_groupname /location_of_files_or_folders
If you want to change group ownership of all containing files and folders recursively, use the -R option like this:
sudo chgrp -R system_username /location_of_files_or_folders
[編輯] 硬件
[編輯] 鼠標
[編輯] 在FireFox中激活鼠標側鍵
只需在 xorg.conf 中加入兩行即可在 FireFox中激活鼠標側鍵。在大多數5鍵鼠標上有效。 這裡是本說明支持的鼠標列表。
- Logitech MX310
- Logitech MX510
- Logitech MX518
- Logitech MX700
- Logitech MX Revolution
- Intellimouse Explorer (first edition)
- Razer Copperhead
備份 X.org 配置文件
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
修改 X.org 配置文件
gksudo gedit /etc/X11/xorg.conf
找到 Input Device部分,按照如下所示為您的鼠標加入兩行。如果您的鼠標按鍵多於7,你也可以增加按鍵數,餘下部分依據按鍵數量確定(記住 前進/後退,滾輪擊鍵和斜向 左/右都算作按鍵)
修改:
Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" ... Option "Protocol" "ExplorerPS/2" ... Option "Emulate3Buttons" "true" EndSection
為:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
Option "Buttons" "7"
Option "ButtonMapping" "1 2 3 6 7"
EndSection
If you want the wheel scroll button to scroll in firefox rather than the side buttons make "ZAxisMapping" "6 7" and "ButtonMapping" "1 2 3 4 5".
At this point you can reboot your computer or restart X (Ctrl-Alt-BackSpace) to see if your forward/back buttons work in FireFox. They still won't work in Nautilus yet until you install the imwheel dameon.
[編輯] Install & Configure IMWheel
- Install IMWheel
sudo apt-get install imwheel
- Modify IMWheel configuration file
gksudo gedit /etc/X11/imwheel/imwheelrc
- Insert the following at the bottom of this existing file
".*" None, Up, Alt_L|Left None, Down, Alt_L|Right "(null)" None, Up, Alt_L|Left None, Down, Alt_L|Right
- Create IMWheel start-up script
sudo mkdir /home/login gksudo gedit /home/login/mouse
- Insert the following into this new file
#!/bin/sh exec xmodmap -e "pointer = 1 2 3 6 7 4 5" & exec imwheel -k -b "67" & exec $REALSTARTUP
- Grant execution for everyone to this new script
sudo chmod +x /home/login/mouse
- Configure this script to be executed at start-up
- Select 'System' > 'Preferences' > 'Sessions'
- Click the StartUp tab
- Click Add, then input: /home/login/mouse
- Click OK, then Close
- Reboot your computer or your Gnome environment and then test your back/forward mouse buttons in Nautilus
(Dont know why but the above worked flawlessly for me with Dapper but not with Feisty, to get it to work in Feisty had to enter a space between 6 and 7 on the line exec imwheel -k -b "67" & hope this helps)
[編輯] How to configure Apple Mighty Mouse
Apple Mighty Mouse works out of the box, this how to should cover setting up of horizontal scrolling using ball and sidebuttons.
This is placeholder only. Please, provide working howto.
[編輯] 顯卡(圖像適配器)
[編輯] 安裝顯卡驅動 (NVIDIA)
- 閱讀 #概述
- 閱讀 #如何添加額外的軟件源
- 閱讀 Feisty的 nVidia 加速補丁
sudo apt-get install nvidia-glx nvidia-kernel-common sudo nvidia-xconfig
- 假如上面這些還不能啟用新的驅動,可以手動啟用。打開 X 的配置文件:
sudo gedit /etc/X11/xorg.conf
- 用"nvidia" 代替 "nv"。
- 啟用 XvMC 。方法:創建 nVidia XvMC 配置文件:
sudo gedit /etc/X11/XvMCConfig
- 把下面一行插入新的配置文件,以告訴各種播放器nVidia XvMC共享庫的名稱:
libXvMCNVIDIA_dynamic.so.1
- 要使用 XvMC 加速視頻回放,使用以下標記。更多細節參見:
[[1]]
xine -V xxmc filename.ts mplayer -vo xvmc -vc ffmpeg12mc filename.ts
[編輯] 怎麼樣安裝Beta 版本的 NVIDIA圖形卡(顯卡)驅動
- WARNING this is very error prone.. a better method is to use Alberto Milones Envy program; http://albertomilone.com/nvidia_scripts1.html
- Thanks to Alberto Milone
- The nVidia driver has been split into different branches; latest and new legacy. See http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9755/README/appendix-a.html to find out which driver you should be using. Latest=97xx / New Legacy=96xx
- Read [[|#How to add extra repositories]]
sudo gedit /etc/apt/sources.list
- 在文檔后添加選擇添加下面的行,注意32位的還是64位
deb http://www.albertomilone.com/drivers/edgy/latest/32bit binary/ deb http://www.albertomilone.com/drivers/edgy/latest/64bit binary/
deb http://www.albertomilone.com/drivers/edgy/newlegacy/32bit binary/ deb http://www.albertomilone.com/drivers/edgy/newlegacy/64bit binary/
- 保存編輯的文件
- 添加GPG 鍵
wget http://albertomilone.com/drivers/tseliot.asc gpg --import tseliot.asc gpg --export --armor albertomilone@alice.it | sudo apt-key add -
- 更新並安裝
sudo apt-get update sudo apt-get install nvidia-glx sudo apt-get upgrade
- 升級之前應該更新
- linux-restricted-modules & linux-restricted-modules-common.
sudo nvidia-xconfig
- 為nVidia 設置添加一個快捷方式
sudo gedit /usr/share/applications/NVIDIA-Settings.desktop
- 在打開
- 新文件中添加下面幾行,並保存
[Desktop Entry] Name=NVIDIA Settings Comment=NVIDIA Settings Exec=nvidia-settings Icon= Terminal=false Type=Application Categories=Application;System;
- 重啟你的電腦,新驅動安裝完畢
- .
- 可以用下面的程序測試安裝是否成功
glxinfo glxgears
[編輯] How to setup pivot (screen rotation) with default X.org NVIDIA drivers
- Read #General Notes
- Some LCD monitors are equipped with the pivot feature, to take advantage of it the display has to be rotated 90 degrees. The default nVidia drivers shipped with X.org ("nv") support software screen rotation. Note that it's unaccelerated and can be slow, read #How to install Graphics Driver (NVIDIA) if you decide to install the proprietary driver.
- If you have the proprietary drivers from nVidia installed, please read #How to setup pivot (screen rotation) with proprietary NVIDIA drivers instead.
- To rotate the screen find the "Device" section for the "nv" driver in the /etc/X11/xorg.conf file:
Section "Device"
Identifier "NVIDIA Corporation NV34 [GeForce FX 5200]"
Driver "nv"
- Add the following options to this section:
Option "Rotate" "CW"
Where the "Rotate" option has two possible values (depending on the orientation of the monitor):
- CW - rotate the display clockwise (right).
- CCW - rotate the display counterclockwise (right).
[編輯] How to setup pivot (screen rotation) with proprietary NVIDIA drivers
- Some LCD monitors are equipped with the pivot feature, to take advantage of it the display has to be rotated 90 degrees. The proprietary nVidia drivers support hardware rotation with the Xrandr extension.
- To enable rotation support find the "Device" section for the "nvidia" driver in the /etc/X11/xorg.conf file:
Section "Device"
Identifier "NVIDIA Corporation NV34 [GeForce FX 5200]"
Driver "nvidia"
- Add the following option to this section:
Option "RandRRotation" "on"
- Then the display can be rotated (direction depends on the orientation of the monitor) by:
- Setting the "Rotation" property to either "Left" or "Right" in the "System > Preferences > Screen Resolution" dialog.
- Issuing either "xrandr -o left" or "xrandr -o right" command.
[編輯] 怎麼樣去掉系統啟動的畫面的NVIDIA 顯卡logo
- 簡單途徑
sudo nvidia-xconfig --no-logo
- 另外的方法
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup gksudo gedit /etc/X11/xorg.conf
- 找到以下部分
... Section "Device" Identifier "NVIDIA Corporation NV11 [GeForce2 MX/MX 400]" Driver "nvidia" BusID "PCI:1:0:0" ...
- 在後面添加以下代碼
Option "NoLogo"
- 保存編輯的文件
- Read #How to restart GNOME without rebooting computer
[編輯] How to configure dual head on NVIDIA based cards
- Install binary driver
- Make a backup of xorg.conf
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
- Edit xorg.conf
sudo nano /etc/X11/xorg.conf
- Add these lines to the "Device" section
Option "TwinView" "True" Option "TwinViewOrientation" "RightOf" Option "UseEdidFreqs" "True" Option "MetaModes" "1280x1024,1280x1024; 1024x768,1024x768" Option "UseDisplayDevice" "string" #replace 'string' with either 'DFP' (Digital flat panel connected via DVI port), 'CRT' (any monitor that is connected via VGA ports), or 'TV'
- Save and close xorg.conf
- Restart X (ctrl + alt + backspace) or reboot
- This was tested on an NVIDIA FX 5200 and known to work using "CRT" as an option for the second monitor
- If you run into trouble where X is hosed and can get back to the command line, replace xorg.conf with the backup copy
sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf
- Information and inspiration drawn from http://ubuntuforums.org/showthread.php?p=1773584
[編輯] How to install Graphics Driver (ATI)
[編輯] 怎樣糾正顯示分辨率 (Intel)
- 如果使用的是大屏幕(>20寸),請閱讀 #怎樣啟用大型寬屏支持。
- Intel 915g、945g 等顯示芯片初始安裝之時只有非常有限的幾組分辨率,儘管已經檢測出了正確的驅動。
- 安裝更改分辨率的工具:
sudo apt-get install 915resolution
- 運行下面的命令看一下可用的模式:
915resolution -l
Choose a resolution you don't need and replace, for example the following changes 1920x1440 to 1920x1200 (譯者:這句的表述是不是有些問題?)
915resolution 5c 1920 1200
- 這樣就應該把這一分辨率的選項加到了"系統>首選項>屏幕分辨率" 工具中。
- 如果順利,就可以永久改變分辨率了:
sudo gedit /etc/rc.local
- 只需把上面輸入過的那條命令放在這一行的前面:
exit 0
- 要得到想要的分辨率還有一種方法:
sudo apt-get install xserver-xorg-video-intel
- 這樣就不需要在Feisty中任何位置加入 915resolution,因為你的分辨率現在已經交給 X 來處理了。
[編輯] How to show nvidia GPU temperature (nvidia-settings)
At a terminal, type
nvidia-settings
[編輯] How to detect CPU temperature, fan speeds and voltages (lm-sensors)
- Read #General Notes
- Read #How to add extra repositories
sudo apt-get install lm-sensors
Create file called mkdev.sh, and paste in the following
#!/bin/bash # Here you can set several defaults. # The number of devices to create (max: 256) NUMBER=32 # The owner and group of the devices OUSER=root OGROUP=root # The mode of the devices MODE=600 # This script doesn't need to be run if devfs is used if [ -r /proc/mounts ] ; then if grep -q "/dev devfs" /proc/mounts ; then echo "You do not need to run this script as your system uses devfs." exit; fi fi i=0; while [ $i -lt $NUMBER ] ; do echo /dev/i2c-$i mknod -m $MODE /dev/i2c-$i c 89 $i || exit chown "$OUSER:$OGROUP" /dev/i2c-$i || exit i=$[$i + 1] done #end of file
Make this file executable, then run it
sudo chmod +x mkdev.sh sudo ./mkdev.sh
Now detect sensors, and answer "y" to all questions.
sudo sensors-detect
To load the manual modules, type
sudo /etc/init.d/module-init-tools
Load the modules into kernel with
sudo sensors -s
And check the output
sudo sensors
[編輯] How to control fan speed (lm-sensors)
Install and config lm-sensors first, see section above. Then run pwmconfig to test your fans
pwmconfig
If you can control fan speeds, great. Now creat a file called /etc/init.d/fancontrol, and paste in the following
#!/bin/sh
#
# Fancontrol start script.
#
set -e
# Defaults
DAEMON=/usr/sbin/fancontrol
PIDFILE=/var/run/fancontrol-pid
PATH=/sbin:/bin:/usr/sbin:/usr/bin
test -f $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_begin_msg "Starting fancontrol daemon..."
start-stop-daemon --start -o -q -m -b -p $PIDFILE -x $DAEMON
log_end_msg $?
;;
stop)
log_begin_msg "Stopping fancontrol daemon..."
start-stop-daemon --stop -o -q -p $PIDFILE
log_end_msg $?
;;
force-reload|restart)
sh $0 stop
sh $0 start
;;
*)
log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload}"
log_success_msg " start - starts system-wide fancontrol service"
log_success_msg " stop - stops system-wide fancontrol service"
log_success_msg " restart, force-reload - starts a new system-wide fancontrol service"
exit 1
;;
esac
exit 0
Make it excutable
sudo chmod +x /etc/init.d/fancontrol
Test it
/etc/init.d/fancontrol start
and
/etc/init.d/fancontrol stop
If it works fine, autoload it when you reboot. Insert the following line into /etc/rc.local, before "exit 0"
/etc/init.d/fancontrol start
[編輯] 怎樣監測 CPU、GPU 溫度、風扇轉速和電壓 (GKrellM)
- 閱讀 #概述
- 閱讀 #怎樣添加額外的軟件源
- 首先安裝 lm-sensors以便在GKrellM中監測 CPU 溫度、風扇轉速和電壓。#怎樣檢測 CPU 溫度、風扇轉速和電壓 (lm-sensors)
- 安裝nvidia 視頻驅動以監測 nvidia GPU的溫度。#怎樣安裝顯示驅動 (NVIDIA)
- 首先安裝 hddtemp 以監測硬盤溫度。
sudo apt-get install hddtemp
GKrellM 是一個硬件監測工具,用於顯示CPU和GPU溫度、風扇轉速、電壓、CPU負載、網絡負載、磁盤活動、磁盤溫度、存儲器使用情況,以及交換(swap)的使用情況。安裝很簡單,配置也只是點擊幾下鼠標而已。如果CPU過熱或者風扇故障,可以給自己設置一個警報。hddtemp功能與GKrellM一起工作,允許感應磁盤溫度,因為與長時間運轉在高溫環境(如高於50C)相比,保持磁盤冷卻(如低於約40C)可以延長磁盤使用壽命。
sudo apt-get install gkrellm
要運行程序,
点 应用程序 -> 系统工具 -> GKrellM
要配置選項,
右击 GKrellM -> Configuration
I was struggling with lm_sensors before, but it doesn't detect all of the sensors on my computer. Later I found "GKrellM". It displays the GPU temperature on my nVidia 6600 GT out of the box. GKrellM also has plugins that show weather info, set reminders, etc.
Add an audio alert (optional Step): Here is how to play an audio message when the CPU is too hot or a fan fails. First you need to find or record your own audio alert files. (I use Audacity to record my own.) Then go to:
Configuration -> Builtins folder (Left side)-> Sensors -> Temperatures folder (Right side)-> CPU -> Alerts Button
Paste ONE of the following lines into a Terminal window first to test the sound. If you have two sound cards, you can use "-ao oss:/dev/dsp1" option to route the sound to the second sound card. Modify the file path and name so it points to the correct file. If you can hear the sound, then copy that line to a command line text field on the GKrellM's Alerts window.
mplayer /home/myfolder/alert_messages/heat_alert.mp3 mplayer -ao oss:/dev/dsp1 /home/myfolder/alert_messages/heat_alert.mp3
[編輯] CPU
[編輯] How to enable your CPU's Power Saving/Frequency Scaling features
- Read #General Notes
- Step 1: Enable BIOS Support
Enter your BIOS at boot and make sure both ACPI and Cool'n'Quiet (AMD) or SpeedStep (Intel) are enabled. Some BIOSes may not have option at all. If that is the case it is probably enabled by default. Other BIOSes may have the option but it is listed as another name altogether. If that is the case check your BIOS manual for more info.
- Step 2: Remove Userspace Scaling Software
powernowd
sudo apt-get remove powernowd
cpudyn
sudo apt-get remove cpudyn
- Step 3: Install CPU Module
Identify your cpu type by runnig the command
cat /proc/cpuinfo
You can also Check the following links AMD CPU Chart - [[2]] Intel CPU Chart - [[3]]
AMD Sempron/Athlon/MP ( K7 )
Socket Types: A, Slot A
sudo modprobe powernow-k7
AMD Duron/Sempron/Athlon/Opteron 64 ( K8 )
Socket Types: 754, 939, 940, S1 ( 638 ), AM2 ( 940 ), F ( 1207 )
sudo modprobe powernow-k8
Intel Core Duo
sudo modprobe speedstep-centrino
Intel Pentium M
sudo modprobe speedstep-centrino
Intel Pentium 4
sudo modprobe p4_clockmod
Others (Unknown)
I'm not entirely sure which cpus are supported using this module. If your cpu doesn't work with one of the above methods try this one.
sudo modprobe acpi-cpufreq
- Step 4: Scaling Modules
sudo modprobe cpufreq_conservative sudo modprobe cpufreq_ondemand sudo modprobe cpufreq_powersave sudo modprobe cpufreq_stats sudo modprobe cpufreq_userspace
- Step 5: Testing/Configuration
Show Available Governors
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
You should see output similar to
powersave conservative ondemand performance
- Step 6: Load Modules at Boot
Add the following lines to the end of /etc/modules
cpufreq_conservative cpufreq_ondemand cpufreq_powersave cpufreq_stats cpufreq_userspace Also add the module you selected in Step 3
- Step 7: Install cpufrequtils
This is a simple, effective tool for using the modules from the command line.
sudo apt-get install cpufrequtils
Test that it's working.
cpufreq-info
- Step 8: Select a governor
The different governors control how the CPU speed is scaled. Your choices are:
ondemand
CPU frequency is scaled based on load.
conservative
The CPUfreq governor "conservative", much like the "ondemand" governor, sets the CPU depending on the current usage. It differs in behaviour in that it gracefully increases and decreases the CPU speed rather than jumping to max speed the moment there is any load on the CPU. This behaviour more suitable in a battery powered environment.
performance
CPU only runs at max frequency regardless of load.
powersave
CPU only runs at min frequency regardless of load.
See [[4]] for more details.
I typically use ondemand. You get a very slight performance hit and save a lot of power (and produce a lot less heat when idle).
Try it out:
cpufreq-set -g ondemand
On systems with more than one CPU you need to repeat the last command for every other CPU you have with specifying the parameter -c (CPU). To set the governor for the second CPU write:
cpufreq-set -c 1 -g ondemand
To see how many CPUs you have type:
ls /sys/devices/system/cpu/
- Step 9: Configure cpufrequtils to automatically set this governor on boot
Edit the file /etc/default/cpufrequtils. Change the line:
ENABLE="false"
to
ENABLE="true"
Set the GOVERNOR value to the governor name you chose in Step 8.
[編輯] Modems / Network
[編輯] How to identify Modem chipset
- Read #General Notes
- To install Modem chipset identifier
- Read #How to install Basic Compilers (build-essential)
wget -c http://easylinux.info/uploads/scanModem.gz gunzip -c scanModem.gz > scanModem chmod +x scanModem sudo cp scanModem /usr/bin/
- To identify Modem chipset
sudo scanModem gedit Modem/ModemData.txt
[編輯] How to install Windows Wireless Drivers (Ndiswrapper)
- Read #General Notes
- In order to install ndiswrapper you need a copy the windows drivers for your Wireless ethernet device.
- This is only meant to be installed if your card isn't supported by Ubuntu, check Ubuntu's list of natively supported wireless cards.
- Check ndiswrapper's list of supported wireless cards if your card isn't supported natively, please visit Ndiswrapper's official supported cards list
- Find out if you have acx module loaded. Because acx module interferes with windows driver, we need to remove it if it is found.
lsmod | grep acx
- Remove the acx module if found. It could also be acx_pci or similar. Please Note: New kernel updates will auto load the acx module again. So repeat the following two commands every time the kernel is updated.
sudo rmmod acx sudo nano /etc/modprobe.d/blacklist
- Add a new list at the end of the file like this:
# drivers wireless ACX blacklist acx
- Install ndiswrapper and drivers (due to a bug in Edgy, you need to specify ndiswrapper-utils-1.8)
sudo apt-get install ndiswrapper-utils-1.8 sudo ndiswrapper -i /location_of_your_wireless_driver/your_driver.inf sudo ndiswrapper -l sudo modprobe ndiswrapper
- Set ndiswrapper to load on startup
sudo ndiswrapper -m gksudo gedit /etc/modules
- Add the following module to the list
ndiswrapper
- Now you can configure your wireless card with ifconfig and iwconfig.
- e.g. Supposing wlan0 is your wireless device.
sudo iwconfig wlan0 essid "AP" key ababababababababab mode Managed iwconfig
- You sould now be able to see the MAC address of the access point and signal rate.
- Please note that certain card drivers have re-association errors when used with ndiswrapper. This means that whenever you restart Ubuntu, your internet connection does not work, even if it is set to load on startup. To combat this, use this line in the terminal (also assuming wlan0 is your wireless device).
sudo iwconfig wlan0 essid x mode Managed
[編輯] Ndiswrapper for Broadcom 43xx wireless chipset
- The Broadcom 43xx (bcm43xx) wireless chipset is one of the most common chipsets, so special scripts have been written for it.
- Only follow this if you have a bcm43xx device. To check in the Terminal type:
lspci | grep Broadcom\ Corporation
If it displays a line similar to this,
0000:02:02.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)
you have a Broadcom wireless chipset. Please proceed with the instructions.
- Put the Ubuntu CD that you installed Ubuntu with in the CD drive.
- Download this to the desktop (the Firefox default, so if you haven't changed it, that's where it went/will go).
Note - you will have to register to get this file. Registration is free so please don't report a broken link.
- In a terminal type
cd ~/Desktop (or wherever you downloaded the file) tar -xf bcm4318*.tar.gz sudo ./ndiswrapper_setup_Feisty
Your wireless chipset should now work. Try rebooting if you have problems. Please see this thread if you have problems: http://ubuntuforums.org/showthread.php?t=197102&highlight=install+ndiswrapper
Edit : The above guide did not work for me (Pete) on 64 bit ubuntu. My lspci output read:
03:02.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)
However I found a much easier way to install the drivers, this will probably work on 32 bit as well (someone please confirm).
Code in terminal :
sudo aptitude install bcm43xx-fwcutter
fwcutter asks if you would like it to extract the firmware as part of the setup. Say yes. After this type:
sudo modprobe bcm43xx
Unplug you Wired connection, wait 30-60 seconds and then enjoy wireless using network manager by the clock.
[編輯] How to enable WPA with Ndiswrapper driver
- First, make sure the Ndiswrapper driver works by itself without encryption.
- Create a file called /etc/wpa_supplicant.conf, and paste in the following. Modify the ssid and psk values.
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="YourWiFiSSID"
psk="YourWiFiPassword"
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
}
- Test it. Make sure your router is broadcasting its SSID.
sudo wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd
- If your WPA works. Load it automatically when you reboot.
gksudo gedit /etc/network/interfaces
- Change your wlan0 section to the following.
If you are using static IP:
auto wlan0 iface wlan0 inet static address 192.168.1.20 netmask 255.255.255.0 gateway 192.168.1.1 pre-up wpa_supplicant -Bw -Dwext -iwlan0 -c/etc/wpa_supplicant.conf post-down killall -q wpa_supplicant
or this, if you are using dhcp.
auto wlan0 iface wlan0 inet dhcp pre-up wpa_supplicant -Bw -Dwext -iwlan0 -c/etc/wpa_supplicant.conf post-down killall -q wpa_supplicant
- Reload your network configuration:
sudo /etc/init.d/networking restart
Alternately, you can follow the instructions in /usr/share/doc/wpasupplicant/README.modes.gz to configure roaming WPA authentication.
[編輯] How to install Modem Driver (SmartLink)
- Read #General Notes
- Read #How to add extra repositories
uname -r (must be 2.6.10-5-386) wget -c http://easylinux.info/uploads/sl-modem-modules-2.6.10-5-386_2.9.9a-1ubuntu2+2.6.10-34_i386.deb sudo dpkg -i sl-modem-modules-*.deb sudo apt-get install sl-modem-daemon
[編輯] Palm
[編輯] How to configure PalmOS Devices
- Read #General Notes
gksudo gedit /etc/udev/rules.d/10-custom.rules
- Insert the following line into the new file
BUS="usb", SYSFS{product}="Palm Handheld*", KERNEL="ttyUSB*", NAME{ignore_remove}="pilot", MODE="666"
- Save the edited file
- Add the pilot-applet to the Taskbar by Right-Clicking on an empty spot
- Follow the instructions on screen
[編輯] Hard Drive
Please note the disks utility mentioned below does not exist anymore. It was part of GNOME and has now been removed in the newer versions. Ie. there is no System -> Administration -> Disks. There are however 2 alternate tools that should in conjunction with each other be able to accomplish the same tasks that one may use "Disks" for.
Code in terminal
sudo aptitude install pysdm sudo aptitude install gparted
To run Gparted
System -> Administration -> GNOME Partition Editor
To run pysdm open terminal and type
sudo pysdm
Please note - Both of these applications have the ability (if used incorrectly) to destroy all your data forever.
Please take care when using them.
[編輯] How to list partition tables
- Read #General Notes
sudo fdisk -l
- You can also use System -> Administration -> Disks
[編輯] 怎樣列出文件系統的硬盤使用空間
- Read #General Notes
df -Th
- 你也可以這樣查看 System -> Administration -> Disks
[編輯] How to list mounted devices
- Read #General Notes
mount
[編輯] 怎樣不重啟的情況下重新加載 /etc/fstab
- Read #General Notes
sudo mount -a
[編輯] USB
[編輯] 怎樣列出 USB 設備
- 閱讀 #概述
lsusb
[編輯] Workaround for random device disconnections
Random disconnection is a kernel bug that is not fixed yet. Some users report randomly disconnecting USB devices, especially external hard drives. One solution is to start the system with the option "irqpoll" in grub, but this doesn't work for everybody, and is believed to make the whole system slower. The other solution is to disable USB 2.0. This will result in way slower read/write, but the connection remains stable.
To disable USB 2.0, type this in the terminal:
sudo modprobe -r ehci_hcd
Test if the copy/write process is stable, and if you want to disable USB 2.0 upon boot, type:
sudo sh -c 'echo blacklist ehci_hcd > /etc/modprobe.d/blacklist-ehci' sudo update-initramfs -u -k `uname -r`
[編輯] 光驅
[編輯] 怎樣加速 CD/DVD-ROM
- 閱讀 #概述
- 例:假設 /dev/cdrom 為 CD/DVD-ROM的位置
sudo hdparm -d1 /dev/cdrom sudo cp /etc/hdparm.conf /etc/hdparm.conf_backup gksudo gedit /etc/hdparm.conf
- 把下面這幾行加到文件末尾:
/dev/cdrom {
dma = on
}
- 保存退出
[編輯] 怎樣手動掛載/卸載 CD/DVD-ROM並顯示所有隱藏的和關聯的文件/目錄
- 閱讀 #概述
- 例:假設 /media/cdrom0/ 為 CD/DVD-ROM的位置
- 掛載 CD/DVD-ROM
sudo mount /media/cdrom0/ -o unhide
- 卸載 CD/DVD-ROM
sudo umount /media/cdrom0/
[編輯] 怎樣手動強制卸載 CD/DVD-ROM
- 閱讀 #概述
- 例:假設 /media/cdrom0/ 為 CD/DVD-ROM的位置
sudo umount /media/cdrom0/ -l
[編輯] Monitors / Displays
[編輯] 怎樣啟用大型寬屏支持
- 24/23" 寬屏顯示器在1920x1200模式下有時有問題。
- 有問題的例子包括: Dell 2405, HP 2335 ,或 Apple Cinema Display.
sudo gedit /etc/X11/xorg.conf
- 注意: Feisty 中的「桌面效果」可能自已重新配置你的xorg.conf文件。如果你自己編輯了這個文件,「桌面效果」可能無法正常運行。(編輯xorg.conf文件之前一定要做個備份: cp /etc/X11/xorg.conf /etc/X11/xorg.conf.A)
- 把下面這一行加到正確的 "Monitor"部分:
Modeline "1920x1200" 154 1920 1968 2000 2080 1200 1203 1209 1235
- 例如在 HP2335,這部分應該是這個樣子:
Section "Monitor" Identifier "hp L2335" Option "DPMS" Modeline "1920x1200" 154 1920 1968 2000 2080 1200 1203 1209 1235 EndSection
[編輯] 怎麼樣在筆記本(intel 顯卡)里啟用CRT顯示器輸出 (擴展顯示器/投影儀)
注意:只對intel 系列顯卡有效
- Read #General Notes
- Read #How to add extra repositories
sudo apt-get install i810switch
啟用CRT輸出
i810switch crt on
停用CRT輸出
i810switch crt off
[編輯] Sound
[編輯] How to setup the surround speakers (5.1 and others) with ALSA
- Read #General Notes
- Edit the ~/.asoundrc file, create it if it doesn't exist:
gedit ~/.asoundrc
- Enter the following section:
pcm.!default {
type plug
slave.pcm "surround51"
slave.channels 6
route_policy duplicate
}
- This will allow to play the surround output and duplicate the stereo output to all 6 channels (not only front ones).
[編輯] 怎樣改變默認聲卡
- 閱讀 #概述
- 查看可使用的聲卡
sudo asoundconf list
- 您將看到類似這樣的顯示
Names of available sound cards: Live V8237
- 將'example'改成你選擇的聲卡來改變聲卡
sudo asoundconf set-default-card example
[編輯] How to setup PulseAudio Sound Server
- What Is It?
PulseAudio, previously known as Polypaudio, is a sound server for POSIX and Win32 systems. A sound server is basically a proxy for your sound applications. It allows you to do advanced operations on your sound data as it passes between your application and your hardware. Things like transferring the audio to a different machine, changing the sample format or channel count and mixing several sounds into one are easily achieved using a sound server.
PulseAudio has been tested on Linux, Solaris, FreeBSD, Windows 2000 and Windows XP. It should also run on all other POSIX and Windows systems, but may require new backends to handle their sound systems.
But first, some motivation. Why use a sound server these days? Doesn』t ALSA work now? Well, there』s 3 main reasons to rig up PulseAudio:
1. Here』s the main one - PulseAudio can seamlessly play audio on any networked PC, regardless of what computer you』re actually at. What does this mean? Basically, you can hit play on your laptop and have the audio come out of the speakers attached to the desktop.
2. Old programs that use OSS can be rigged to work correctly while having other sounds playing at the same time
3. This one hasn』t been realized yet, but it』s also a very cool feature: audio can be manipulated per-application. While controlling this manually can already be done, it gets really cool when this is automatic based on the class of audio - for example, the music being turned down automatically when a VOIP phone call comes in. Someone worked on this as a Google SoC project, but he didn』t get very far (his implementation was a bit farfetched imo anyways)
- Installation
Type the following in a terminal:
sudo apt-get install "pulseaudio-*" paman padevchooser paprefs pavucontrol
Optionally you may want to install gst-pulse, a GStreamer 0.10 plugin for the PulseAudio sound server.
sudo apt-get install gst-pulse
If you have Flash Player 9:
wget http://pulseaudio.vdbonline.net/libflashsupport/libflashsupport_1.0~2219-1_i386.deb sudo dpkg -i libflashsupport_1.0-2219-1_i386.deb
here is a mirror for the package in case the link above dies:
libflashsupport_1.0-2219-1_i386.deb
Then, edit the ALSA configuration file using the command:
sudo mv /etc/asound.conf /etc/asound.conf.backup sudo gedit /etc/asound.conf
Add this to the asound.conf:
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}
Go to System->Preferences->Sounds and check 「Enable Software Mixing」
Then either Applications->Sound & Video->PulseAudio Preferences or in a terminal type:
paprefs
Set the following settings:
Make sure that Multicast/RTP is off or else you』ll have problems with skipping and latency. Reboot or in a terminal type:
pulseaudio
then Applications->Sound & Video->PulseAudio Device Chooser and if you have more than one PC with this setup, you』ll be able to choose which computer to send the audio to.
Add everyone to the pulse-access group. To do this, go to System->Administration->Users and Groups, click on 「Manage Groups」, scroll down to 「pulse-access」, Properties, then check everyone in the list. Otherwise, you』ll get weird 「no-sound」 errors and lockups.
To control the volume go to Applications->Sound & Video->PulseAudio Volume Control
- Final Notes
Unfortunately while you can definitely get this to work, it』s a bit of a hassle and kind of buggy - PulseAudio isn』t very bullet-proof quite yet and you might have to do some haggling. Skype in particular is annoying; it』s usually better to killall pulseaudio before trying to make a Skype call although I did get it working through OSS and padsp.
- Credits
The Perfect Setup Revolution Linux wiki http://blog.paulbetts.org
[編輯] Misc
[編輯] 怎樣得到 PCI 設備列表
- 閱讀 #概述
lspci
[編輯] 怎樣安裝Wacom數位板
有關如何在你的繪圖軟件中配置"擴展輸入設備"的帶有屏幕截圖的詳細說明,請在https://wiki.ubuntu.com//Wacom 參看Dapper官方嚮導
"Ubuntu 6.06 Dapper Drake下的Linux Wacon驅動(0.7.2),如果tablet已拔出,當再把它插回去時它不會正常工作,你必須重啟X。因此,最好讓tablet一直插着。這個限制會在Ubuntu自帶0.7.4版本的驅動中取消。"
- Read #General Notes
- 閱讀 #通用說明
- 1. 使用新立得(Synaptic)軟件包管理器,檢查xserver-xorg-input-wacom和wacom-tools包是否已經安裝 - 如果沒有,安裝它們。如果你喜歡用命令行,也可以執行:
sudo apt-get install xserver-xorg-input-wacom wacom-tools
- 2. 備份你的/etc/X11/xorg.conf :
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
- 然後在命令行下編輯:
gksudo gedit /etc/X11/xorg.conf
- 然後把所有出現"/dev/wacom"的地方改成"/dev/input/wacom"(由wacom-tools udev腳本創建的),保存文件。
- 重啟X以後就可以使用了。記住在你的繪圖軟件(Gimp, Inkscape)中配置"擴展輸入設備",但你可能早就檢查過指示筆是否能在tablet上使用了:鼠標指針應該能穿過整個屏幕。
[編輯] CD/DVD 刻錄
[編輯] 怎樣刻錄空白 CD-RW/DVD-RW
- 閱讀 #概述
- 例:假設 /dev/cdrom 為 CD/DVD-ROM的位置
sudo umount /dev/cdrom cdrecord dev=/dev/cdrom blank=fast
[編輯] 怎樣向CD/DVD刻錄文件和目錄
- 閱讀 #概述
位置 -> CD/DVD 创建者
- 把文件/目錄拖到窗口裡
菜单:文件 -> 写入碟片... -> 写入
[編輯] 怎樣將映像(ISO)刻錄成CD/DVD
- 閱讀 #概述
在映像文件(ISO)上点右键 -> 写入碟片... -> 写入
[編輯] 怎樣複製 CD/DVD
- 閱讀 #概述
- 閱讀 #怎樣從CD/DVD創建映像文件
- Read #怎樣將映像(ISO)刻錄成CD/DVD
[編輯] 怎樣從CD/DVD創建映像文件
- 閱讀 #概述
- 例:假設 /dev/cdrom 為 CD/DVD-ROM的位置
sudo umount /dev/cdrom dd if=/dev/cdrom of=file.iso bs=1024
[編輯] 怎樣從目錄創建映像文件 (ISO)
- 閱讀 #概述
mkisofs -r -o file.iso /location_of_folder/
[編輯] 怎樣生成 MD5 checksum 文件
- 閱讀 #概述
md5sum file.iso > file.iso.md5
[編輯] 怎樣檢查文件的 MD5 checksum
- 閱讀 #概述
- 例:假設 file.iso 和 file.iso.md5 在同一目錄
md5sum -c file.iso.md5
[編輯] 怎樣只是掛載/卸載而不刻錄映像文件 (ISO)
- 閱讀 #概述
- 掛載
sudo mkdir /media/iso sudo modprobe loop sudo mount file.iso /media/iso/ -t iso9660 -o loop
- 卸載
sudo umount /media/iso/
- 如果想通過右鍵直接掛載/卸載映像文件,可以在你的主目錄這樣做:
cd .gnome2/nautilus-scripts/ gedit Mount
把這個腳本複製到Mount中:
#!/bin/bash # for I in "$*" do foo=`gksudo -u root -k -m "Enter your password for root terminal access" /bin/echo "got r00t?"` sudo mkdir /media/"$I" sudo mount -o loop -t iso9660 "$I" /media/"$I" && nautilus /media/"$I" --no-desktop done done exit0
保存退出,卸載也是一樣:
gedit Unmount
把這個腳本複製到文件中:
#!/bin/bash # for I in "$*" do foo=`gksudo -u root -k -m "Enter your password for root terminal access" /bin/echo "got r00t?"` sudo umount "$I" && zenity --info --text "Successfully unmounted /media/$I/" && sudo rmdir "/media/$I/" done done exit0
用以下命令使之成為可執行文件:
chmod +x Mount chmod +x Unmount
- 也可用圖形化工具,需要在終端打以下命令:
sudo aptitude install gisomount
要運行該工具,在終端輸入:
sudo gisomount
[編輯] 怎麼設置/更改CD/DVD刻錄速度
- 閱讀 #概述
- Applications -> System Tools -> Configuration Editor
- Configuration Editor
/ -> apps -> nautilus-cd-burner -> default_speed (set/change the burn speed)
[編輯] How to enable burnproof for CD/DVD Burner
- Read #General Notes
- Applications -> System Tools -> Configuration Editor
- Configuration Editor
/ -> apps -> nautilus-cd-burner -> burnproof (Checked)
[編輯] How to enable overburn for CD/DVD Burner
- Read #General Notes
- Applications -> System Tools -> Configuration Editor
- Configuration Editor
/ -> apps -> nautilus-cd-burner -> overburn (Checked)
[編輯] 網絡操作
- 完整的Ubuntu 網絡操作指南 是一個手把手的Ubuntu網絡操作指南,適合新手和老鳥。
[編輯] 配置 Google Talk
- 答案見 Google Talk 幫助中心
[編輯] 激活/禁用網絡連接
- 閱讀 #概述
- 系統 -> 系統管理 -> 網絡
- 網絡設置
“连接”标签 -> 选择 "有线连接" -> 激活/禁用
[編輯] 配置網絡連接
- 閱讀 [[|#概述]]
- 系統 -> 系統管理 -> 網絡
- 網絡設置
“连接”标签 -> 选择 "有线连接" -> 属性 连接 -> 启用这个连接 (打勾) 连接设置 -> 配置: 选择 "自动配置/静态IP地址"
DNS标签 -> DNS 服务器 -> 添加/删除
- 閱讀 [[|#激活/禁用網絡連接]]
[編輯] 怎樣配置撥號連接
- 閱讀 #概述
- 配置撥號
sudo pppconfig
- 連接撥號
pon provider_name
- 斷開連接
poff
[編輯] 配置寬帶連接
- 閱讀 #概述
sudo pppoeconf
[編輯] 改變計算機名稱
- 閱讀 #概述
- 系統 -> 系統管理 -> 網絡
- 網絡設置
“常规”标签 -> 主机设置 -> 主机名: 指定计算机名称
- 保存,關閉所有打開的應用程序,重啟電腦
[編輯] 改變計算機描述
- 閱讀 #概述
- 閱讀 #安裝 Samba 服務器提供文件/目錄共享服務
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- 找到這一行
... server string = %h server (Samba, Ubuntu) ...
- 用下面這一行代替:
server string = new_computer_descriptions
- 保存編輯過的文件
sudo testparm sudo /etc/init.d/samba restart
[編輯] 改變計算機域/工作組
- 閱讀 #概述
- 閱讀 #安裝 Samba 服務器提供文件/目錄共享服務
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
- 找到這一行
... workgroup = MSHOME ...
- 用下面這一行代替:
workgroup = new_domain_or_workgroup
- 保存編輯過的文件
sudo testparm sudo /etc/init.d/samba restart
[編輯] 使用動態域名解析服務給本機指定動態IP
- Read #General Notes
- Read #How to add extra repositories
- Register free Dynamic DNS at http://www.dyndns.com/services/dns/dyndns
sudo apt-get install ipcheck gksudo gedit /etc/ppp/ip-up.d/dyndns_update
- 在新的文件中添加以下代碼,並用你自己的用戶名和密碼來替換「myusername」和「mypassword」。
#!/bin/sh USERNAME=myusername PASSWORD=mypassword HOSTNAME=myhostname.dyndns.org cd /root/ if [ -f /root/ipcheck.dat ]; then ipcheck -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME else ipcheck --makedat -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME fi
- 保存修改的文件
sudo chmod 700 /etc/ppp/ip-up.d/dyndns_update sudo sh /etc/ppp/ip-up.d/dyndns_update
[編輯] How to share folders the easy way
Right click on folder -> Share folder
Shared folder -> Share with: Select "SMB" Share properties -> Name: Specify the share name
[編輯] How to browse network computers
- Read #General Notes
- e.g. Assumed that network connections have been configured properly
- If computers or network folders could not be found, try access them directly
- Read #How to access network folders without mounting
- Places -> Network Servers
[編輯] How to access network folders without mounting
- Read #General Notes
- e.g. Assumed that network connections have been configured properly
- Network computer's IP: 192.168.0.1
- Shared folder's name: linux
- Press 'Alt+F2' (Run Application...) and enter:
smb://192.168.0.1/linux
[編輯] How to mount/unmount network folders manually, and allow all users to read
- e.g. Assumed that network connections have been configured properly
- Network computer's IP: 192.168.0.1
- Network computer's Username: myusername
- Network computer's Password: mypassword
- Shared folder's name: linux
- Local mount folder: /media/sharename
- To mount network folder
sudo mkdir /media/sharename sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword
- To unmount network folder
sudo umount /media/sharename/
[編輯] How to mount/unmount network folders manually, and allow all users to read/write
- e.g. Assumed that network connections have been configured properly
- Network computer's IP: 192.168.0.1
- Network computer's Username: myusername
- Network computer's Password: mypassword
- Shared folder's name: linux
- Local mount folder: /media/sharename
- To mount network folder
sudo mkdir /media/sharename sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777
- To unmount network folder
sudo umount /media/sharename/
[編輯] How to mount network folders on boot-up, and allow all users to read
- e.g. Assumed that network connections have been configured properly
- Network computer's IP: 192.168.0.1
- Network computer's Username: myusername
- Network computer's Password: mypassword
- Shared folder's name: linux
- Local mount folder: /media/sharename
sudo mkdir /media/sharename gksudo gedit /root/.smbcredentials
- If you do not have smbfs installed yet, install that first:
apt-get install smbfs
- Insert the following lines into the new file
username=myusername password=mypassword
- Save the edited file
sudo chmod 700 /root/.smbcredentials sudo cp /etc/fstab /etc/fstab_backup gksudo gedit /etc/fstab
- Append the following line at the end of file
//192.168.0.1/linux /media/sharename smbfs credentials=/root/.smbcredentials 0 0
- Save the edited file
- Read #How to remount /etc/fstab without rebooting
[編輯] How to mount network folders on boot-up, and allow all users to read/write
- e.g. Assumed that network connections have been configured properly
- Network computer's IP: 192.168.0.1
- Network computer's Username: myusername
- Network computer's Password: mypassword
- Shared folder's name: linux
- Local mount folder: /media/sharename
sudo mkdir /media/sharename gksudo gedit /root/.smbcredentials
- Insert the following lines into the new file
username=myusername password=mypassword
- Save the edited file
sudo chmod 700 /root/.smbcredentials sudo cp /etc/fstab /etc/fstab_backup gksudo gedit /etc/fstab
- Append the following line at the end of file
//192.168.0.1/linux /media/sharename smbfs credentials=/root/.smbcredentials,dmask=777,fmask=777 0 0
- Save the edited file
- Read #How to remount /etc/fstab without rebooting
[編輯] How to get ipw2200 and WPA to work
Under Feisty, WPA works right out of the box with network manager.
[編輯] How to get ipw3945 and wep/wpa to work
- Read #General Notes
- Read #How to add extra repositories
- Edgy already has all the drivers built in, except for the ipw3945 regulatory daemon. There are two ways to get it:
- Install it manually from source:
- See the daemon source and the Intel ipw3945 project page.
OR
- Install the daemon using apt (recommended for new users):
sudo apt-get install linux-restricted-modules-generic
- reboot your system and you should have wireless internet/network.
- For easy network connection, read #How to Configure Ubuntu/Kubuntu with WPA using Network-Manager.
[編輯] How to Configure and start PPTP tunnels (VPN)
- Read #General Notes
You can use NetworkManager which comes with Feisty.
- Configure VPN with Network Manager
In a terminal
sudo apt-get install network-manager-pptp
You have to restart after install.
To setup a VPN Click the NetworkManager Icon in the tray VPN Connections->Configure VPN Use the defaults and be sure to check the box: Refuse EAP under the Authentication tab. To get my connection to work I also had to check Require MPPE Encryption under Compression & Encryption
- A Nice tutorial here
Alternative programs listed below
- Use these instructions to automatically install PPTP Client
- OR
- Install manually
wget -c http://linux.edu.lv/uploads/content/pptp.tar.gz tar zxvf pptp.tar.gz cd ./pptp/ sudo sh ./pptp/install cd ..
- To configure PPTP Client
gksudo gedit /usr/share/applications/pptpconfig.desktop
- Replace content of this file with the following lines
[Desktop Entry] Name=PPTP Client Comment=Configure and start PPTP tunnels (VPN) Categories=Application;Network Encoding=UTF-8 Exec=gksudo pptpconfig Icon=gnome-remote-desktop.png StartupNotify=true Terminal=false Type=Application
- The above lines change the default file in three ways: the application is placed in the Application/Internet category, gksudo will make the application run as superuser and we put a nice icon that appears in the menu.
- Start the client with Applications -> Internet -> PPTP Client
[編輯] How to Configure Ubuntu/Kubuntu with WPA using Network-Manager
- Note: Network-Manager is included by default in Feisty! This section should probably be removed?
Ubuntu Dapper in typical cases can configure WPA to work out of the box with minimal hassle. You'll need to install network-manager.
For Ubuntu:
sudo apt-get install network-manager-gnome
For Kubuntu (will install knetworkmanager):
sudo apt-get install network-manager-kde
Logout/Reboot.
Ubuntu users should now see the NetworkManager Applet in the Gnome notification area. Kubuntu users will probably have to run knetworkmanager before they see NetworkManager in the systray.
If instead, you get a "The NetworkManager applet could not find some required resources. It cannot continue." message, then:
sudo gtk-update-icon-cache -f /usr/share/icons/hicolor
Once Network-Manager is installed, click on the NM icon in the notification area (default is at the top right of Ubuntu/Gnome). Choose your network, then enter your passphrase. Type a password for the keyring, and you're set.
If you don't see your network, click "Create New Wireless Network...", type your essid/networkname, then choose "WPA Personal" for wireless security.
- Note: If you installed Kubuntu then installed ubuntu-desktop & network-manager-gnome, you may not be able to use network-manager in Gnome, if at all. In this case, you may have to use WPA Supplicant and do some manual editing of conf files to get WPA up and running.
- Note: When you first log into Gnome/KDE, the keyring application will ask for a password. Future revisions of Network-Manager should resolve this.
[編輯] How to setup a GPG key with Seahorse and Evolution
- Read #General Notes
- Install seahorse
apt-get install seahorse
- Applications > Accessories > Passwords and Encryption Keys
- Key > Create New Key
- Select "PGP Key", then fill out information. Ensure that you use your real email address.
- Wait for key to finish generating.
- You may now right-click on the key entry to export, sync or publish your key.
- Evolution should now hopefully see the key transparently.
[編輯] How to Setup BIND DNS Server
Reference: copied from http://ubuntuforums.org/showthread.php?t=236093
- 安裝bind9:
sudo apt-get install bind9
- 配置Bind主文件。通常如果你是通過源碼安裝的Bind,那麼你必須編輯named.conf文件。不過Ubuntu提供了一個預先配置過的Bind,所以我們現在編輯另一個文件:
sudo vi /etc/bind/named.conf.local
這是插入我們自己zone的地方,捎帶一句,所謂zone就是一個指向DNS服務器的域名。在named.conf.local文件中我們插入如下內容:
# This is the zone definition. replace example.com with your domain name
zone "example.com" {
type master;
file "/etc/bind/zones/example.com.db";
};
# This is the zone definition for reverse DNS. replace 0.168.192 with your
# network address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
- 好,現在我們來編輯options文件:
sudo vi /etc/bind/named.conf.options
- 我們需要修改前向記錄,就是當我們的DNS服務器不能處理請求時,將前向詢問的那個DNS服務器。
forwarders {
# Replace the address below with the address of your provider's DNS server
123.123.123.123;
};
- 現在,加入我們自己的zone定義文件(用你自己的域名代替example.com):
sudo mkdir /etc/bind/zones sudo vi /etc/bind/zones/example.com.db
- zone定義文件就是放我們DNS所知道的「address/機器名」對的地方。你可以看看下面的例子:
// replace example.com with your domain name. do not forget the . after the domain name! // Also, replace ns1 with the name of your DNS server example.com. IN SOA ns1.example.com. admin.example.com. ( // Do not modify the following lines! 2006081401 28800 3600 604800 38400 ) // Replace the following line as necessary: // ns1 = DNS Server name // mta = mail server name // example.com = domain name example.com. IN NS ns1.example.com. example.com. IN MX 10 mta.example.com. // Replace the IP address with the right IP addresses. www IN A 192.168.0.2 mta IN A 192.168.0.3 ns1 IN A 192.168.0.1
- 現在我們建立反向DNS zone文件:
sudo vi /etc/bind/zones/rev.0.168.192.in-addr.arpa
- 把下面這段貼進去,按你的需求修改一下:
//replace example.com with yoour domain name, ns1 with your DNS server name. // The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1. @ IN SOA ns1.example.com. admin.example.com. ( 2006081401; 28800; 604800; 604800; 86400 ) IN NS ns1.example.com. 1 IN PTR example.com
- 好啦,現在你只要重啟bind就好了:
sudo /etc/init.d/bind9 restart
- 現在我們測試一下新DNS服務器...
- 修改一下resolv.conf:
sudo vi /etc/resolv.conf
- 敲進下面的東西:
// replace example.com with your domain name, and 192.168.0.1 with the address of your new DNS server. search example.com nameserver 192.168.0.1
- 現在試試你的DNS吧:
dig example.com
[編輯] 遠程登錄
[編輯] 通過XDMCP 遠程登錄
[編輯] 什麼是 XDMCP?
GNOME視窗能夠同時支持幾個不同的用戶。不像只是複製當前的屏幕內容到一個終端的vncviewer那樣,XDMCP允許幾個不同的用戶在同一時間登陸和運行不同的GNOME進程.所以如果你有一台運行Ubuntu的性能良好的電腦,其他電腦性能不好的用戶可以登錄進入你的電腦,並且運行在你電腦上能夠使用的大型程序。
[編輯] 怎麼開啟XDMCP的功能
在性能良好的電腦上開啟XDMCP,點擊如下菜單
System -> Administration -> Login Window
在Login Window首選項對話窗選擇如下:
Remote Tab -> Style: Same as Local -> Close the dialog window -> Restart the PC
[編輯] How to login from another PC running Ubuntu
1. Reboot the slow PC and stop at the login screen 2. Click Options at the lower left corner of the login screen 3. Select "Remote Login via XDMCP" 4. On the dialog window, type in the host name or ip of the fast computer you want to login to
[編輯] Remote Desktop Sharing/Duplication via VNC
[編輯] How to configure remote desktop (not secure)
- Read #General Notes
- Warning! Remote Desktop will only work if there's a GNOME login session
- Leaving computer with an unattended GNOME login session is not secure
- Use (System -> Lock Screen) and switch off the monitor when computer is left unattended
- System -> Preferences -> Remote Desktop
- Remote Desktop Preferences
Sharing -> Allow other users to view your desktop (Checked) Allow other users to control your desktop (Checked)
Security -> Ask you for confirmation (Un-Checked) Require the user to enter this password: (Checked) Password: Specify the password
[編輯] 怎樣遠程連接 Ubuntu桌面
- 例如: 假定遠程UBUNTU電腦已經配置好遠程控制桌面
- 參考 #How to configure remote desktop (not secure)
- 遠程電腦地址為: 192.168.0.1,使用下面的命令
vncviewer -fullscreen 192.168.0.1:0
- 退出控制
按 'F8' -> 退出远程显示
[編輯] 怎樣使用windos 遠程登錄ubuntu 桌面
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have configured Remote Desktop
- Read #How to configure remote desktop (not secure)
- Remote Ubuntu machine: 192.168.0.1
- If you have a router remember to open the appropiate port. The default one is 5900
- This process is called port forwarding port forwarding
- this is a free DotNet version that require the DotNet framework available from microsoft here
- The RealVNC website was created and maintained by the original developers of VNC during their time at AT&T. RealVNC comes in Free, Personal, and Enterprise editions - the latter two costing money.
- Open the VNC client you have chosen, and insert the connection string formatted like this <LINUX BOX IP><:DESKTOP NUMBER>|<::PORT>
- In example use: 192.168.1.2:0 or 192.168.1.2::5900 to connect to desktop 0, to connect to desktop 1 use 192.168.1.2:1 or 192.168.1.2::5901 and so on
[編輯] How to connect into remote Ubuntu desktop via OSX
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have configured Remote Desktop
- Read #How to configure remote desktop (not secure)
- Remote Ubuntu machine: 192.168.0.1
- If you have a router remember to open the appropiate port the default one is 5900
- This process is called port forwarding port forwarding
- Download ChickenOfTheVNC: Here
- Open ChickenOfTheVNC, and insert the host (IP address of remote machine), the display number (0 is default and is port 5900) and the password.
- In example use: Host: 192.168.0.1, Display 0, Password: password
[編輯] Windows
[編輯] How to mount/unmount Windows partitions (NTFS) manually, and allow all users to read only
[編輯] 怎樣去手動掛載/取消掛載一個Windows NTFS分區,並允許所有用戶對其只讀
- Read #General Notes
- 閱讀#General Noties
- Read #How to list partition tables
- 閱讀#How to list partition tables
- e.g. Assumed that /dev/hda1 is the location of Windows partition (NTFS)
例如 假設/dev/hda1是一個NTFS分區
- Local mount folder: /media/windows
本地的掛載目錄為/media/windows
- To mount Windows partition
- 掛載Windows分區
sudo mkdir /media/windows sudo mount /dev/hda1 /media/windows/ -t ntfs -o nls=utf8,umask=0222
- To unmount Windows partition
- 取消掛載Windows分區
sudo umount /media/windows/
[編輯] How to mount/unmount Windows partitions (FAT) manually, and allow all users to read/write
[編輯] 怎樣手動掛載/取消掛載一個Windows FAT,並允許所有用戶對其可讀可寫
- Read #General Notes
- Read #How to list partition tables
- e.g. Assumed that /dev/hda1 is the location of Windows partition (FAT)
例如 假設/dev/hda1是一個Windows FAT分區
- Local mount folder: /media/windows
本地掛載目錄是/media/windows
- To mount Windows partition
掛載Windows分區
sudo mkdir /media/windows sudo mount /dev/hda1 /media/windows/ -t vfat -o iocharset=utf8,umask=000
- To unmount Windows partition
取消掛載Windows分區
sudo umount /media/windows/
[編輯] How to mount Windows partitions (NTFS) on boot-up, and allow all users to read only
[編輯] 怎樣讓系統啟動時掛載Windows NTFS分區,並允許所有用戶對其只讀
- Read #General Notes
- Read #How to list partition tables
- e.g. Assumed that /dev/hda1 is the location of Windows partition (NTFS)
- Local mount folder: /media/windows
sudo mkdir /media/windows sudo cp /etc/fstab /etc/fstab_backup gksudo gedit /etc/fstab
- Append the following line at the end of file
在文件的最後一行加上
/dev/hda1 /media/windows ntfs nls=utf8,umask=0222 0 0
- Save the edited file
保存已經編輯過的文件
[編輯] How to mount Windows partitions (FAT) on boot-up, and allow all users to read/write
[編輯] 怎樣在系統啟動時掛載Windows FAT分區,並允許所有用戶對其可讀可寫
- Read #General Notes
- Read #How to list partition tables
- e.g. Assumed that /dev/hda1 is the location of Windows partition (FAT)
- Local mount folder: /media/windows
sudo mkdir /media/windows sudo cp /etc/fstab /etc/fstab_backup gksudo gedit /etc/fstab
- Append the following line at the end of file
在文件的最後加上下一行
/dev/hda1 /media/windows vfat iocharset=utf8,umask=000 0 0
- Save the edited file
保存編輯過的文件
[編輯] How to mount Windows partitions (NTFS) on boot-up, and allow users read and write access
[編輯] 怎樣在系統啟動時掛載NTFS分區,並允許所有用戶擁護對其可讀寫權限
Warning: The software you will use is still in Beta. You should not enable it on production machines 警告:這個軟件目前仍然在測試,你最好不要在專用設備上用它
- Read #General Notes
- Enable universe. Read #How to apt-get the easy way (Synaptic)
- Applications -> Add/Remove -> search for 'NTFS', you should find NTFS Configuration Tool, install it.
應用程序 -> 添加/刪除 -> 搜索'NTFS',你能找到NTFS配置工具(NTFS Configuration Tool),安裝它
- Applications -> System Tools -> NTFS Configuration Tool -> Enable Write Support (depending on your device internal/external)
應用程序 -> 系統工具 -> NTFS配置工具 -> 可寫支持(依靠你的internal擴展設備)
- Further troubleshooting is listed at this comprehensive howto thread.
[編輯] Security
[編輯] What are the basic things I need to know about securing my Ubuntu
- Read #General Notes
- Ensure hard drive is first in BIOS boot-up sequence
- To prevent trespassers from using Linux Installation CD which allows them to gain root user access
- To prevent trespassers from using Linux Live CD (e.g. UBUNTU/KNOPPIX/MEPIS) which allows them to destroy/browse/share the entire hard drive
- To prevent trespassers from installing another Operating System
- Ensure a password is set for BIOS
- To prevent trespassers from changing the BIOS boot-up sequence
- Ensure computer is located at a secured place
- To prevent trespassers from removing computer's hard drive which allows them to destroy/browse/share the entire hard drive from a different computer
- To prevent trespassers from removing computer's on-board battery which resets the BIOS password
- Ensure passwords used on the system cannot be easily guessed
- To prevent trespassers from cracking password file using brute force attacks (e.g. John the Ripper)
- Create password with minimum length of 8 characters
- Create password with mixture of characters/numbers, and upper/lower case
- Not create a password with just a single or just a typical union of main languages (english, german, french, spanish...) dictionary words
- Ensure interactive editing control for GRUB menu is disabled
- To prevent trespassers from modifying kernel boot-up arguments which allows them to have root user access
- Read #How to disable all interactive editing control for GRUB menu
- Ensure history listing is disabled in Console mode
- To prevent trespassers from seeing previously issued commands
- Read #How to disable history listing in Console mode
- Ensure Ctrl+Alt+Del is disabled in Console mode
- To prevent trespassers from restarting the system without permission in Console mode
- Read #How to disable Ctrl+Alt+Del from restarting computer in Console mode
- Ensure interactive option is set for remove, copy and move of files/folders in Console mode
- To prevent accidental removal/overwritten of files/folders
- Read #How to enable prompt before removal/overwritten of files/folders in Console mode
- For day to day usage, login as a normal user
- To prevent accidental deletion/modification of system files/folders
- Read #How to add/edit/delete system users
- Disable root user account, use "sudo" instead
- To reduce the amount of time spent with root privileges, and thus the risk of inadvertently executing a command as root
- "sudo" provides a more useful audit trail (/var/log/auth.log)
- Read #How to disable root user account
- Install a Firewall
- A firewall does not guarantee security but it is in most environments the first line of defense against network based attacks
- Read #How to install Firewall (Firestarter)
- Perform vulnerability test
- Nessus is a great tool designed to automate the testing and discovery of known security problems
- Read #How to install Vulnerability Scanner (Nessus)
[編輯] How to disable all interactive editing control for GRUB menu
- Read #General Notes
- Run This:
grub-md5-crypt
Password: Retype password: $1$tumnZ1$xB/shuXs7MlawZXkLiBDV/
- Backup your current configuration file
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Find this section
... ## password ['--md5'] passwd # If used in the first section of a menu file, disable all interactive editing # control (menu entry editor and command-line) and entries protected by the # command 'lock' # e.g. password topsecret # password --md5 $1$tumnZ1$xB/shuXs7MlawZXkLiBDV/ # password topsecret ...
- Add the following line below it
password --md5 $1$tumnZ1$xB/shuXs7MlawZXkLiBDV/ (encrypted password above)
- Find the section(s) that look like this (note the 'recovery mode' and the word 'single'):
... title Ubuntu, kernel 2.6.10-5-386 (recovery mode) root (hd0,1) kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single initrd /boot/initrd.img-2.6.10-5-386 savedefault boot ...
- Add lock between the title and root lines:
... title Ubuntu, kernel 2.6.10-5-386 (recovery mode) lock root (hd0,1) ...
- Save the edited file
This will make it so your grub console will require a password to edit the lines, and the recovery modes won't work unless the password is typed. To access the other grub options at the menu, follow the instructions at the bottom of the screen. It will be something like pressing p and typing your password.
[編輯] How to disable history listing in Console mode
- Read #General Notes
- From Gentoo Wiki:
rm -f .bash_history gedit ~/.bash_profile
- Add the following:
export HISTFILESIZE=4 unset HISTFILE # Change this to a reasonable number of lines to save, I like to save only 100. export HISTSIZE=1 # Ignores duplicate lines next to each other export HISTCONTROL=ignoredups
This will disable Bash history for the user, retaining keystroke history and recall to use while limiting recall history to 100 lines. This will also not record duplicate lines next to each other.
[編輯] How to disable Ctrl+Alt+Del from restarting computer in Console mode
- Read #General Notes
sudo cp /etc/inittab /etc/inittab_backup gksudo gedit /etc/inittab
- Find this line
... ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now ...
- Replace with the following line
#ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
- Save the edited file
sudo telinit q
[編輯] How to enable prompt before removal/overwritten of files/folders in Console mode
- Read #General Notes
sudo cp /etc/bash.bashrc /etc/bash.bashrc_backup gksudo gedit /etc/bash.bashrc
- Append the following lines at the end of file
alias rm='rm -i' alias cp='cp -i' alias mv='mv -i'
- Save the edited file
[編輯] How to setup a LoJack system for your laptop
- Read #General Notes
- Read #How to add extra repositories
- Read #How to assign Hostname to local machine with dynamic IP using free DynDNS service
What: Quote from Wikipedia: "LoJack is an aftermarket vehicle tracking system that allows cars to be tracked by police after being stolen. The manufacturer claims a 90% recovery rate. The name "LoJack" is a play on the word "hijack," meaning the theft of a vehicle through force."
Why: If your laptop is ever stolen and connected to the Internet. You will be able to find out from what IP it connects to the Internet from and contact the authorities.
How:
- Get a free dynamic IP account from one of the many providers. Here we will use DynDNS.
- Install ddclient. In the section #How to assign Hostname to local machine with dynamic IP using free DynDNS service we installed the package ipcheck, here we prefer to use ddclient because it can get the IP from an external source on the Internet instead of getting it from a network adapter.
sudo apt-get install ddclient
- Edit the configuration file /etc/ddclient.conf using you fevorite text editor (emacs, gedit, kedit or even vi)
sudo emacs /etc/ddclient.conf
- Make it look like this:
# Configuration file for ddclient generated by debconf # # /etc/ddclient.conf pid=/var/run/ddclient.pid protocol=dyndns2 use=web server=members.dyndns.org login=YourNameHere password='YourPasswordHere' YourHostNameHere.gotmyip.com
- NOTE:
- * Make sure that you use the web IP detection method.
- * Specify your own user id instead of the place holder YourNameHere.
- * Specify your own password instead of the place holder YourPasswordHere, make sure to surround it with single quotes.
- * The last line should specify the hostname you registered with the dynamic IP service.
- You can now start the ddclient daemon, or wait until your next reboot.
sudo /etc/init.d/ddclient start
- The hostname you registered with your dynamic IP service should be updated. You can test it with the ping command:
ping YourHostNameHere.gotmyip.com
- Even if your laptop has a firewall that prevents pings the hostname should resolve to the IP of the network gateway that your laptop is connected to.
- Now all that is left is for someone to steal your laptop.....
References:
[編輯] Boot Menu
[編輯] How to gain root user access without login
- Read #General Notes
- Easiest method (will not work if GRUB menu password is set)
- Boot-up computer
- If GRUB menu is hidden, press 'Esc' to enter the GRUB menu
- Select
Ubuntu, kernel 2.6.10-5-386 (recovery mode)
- Press 'Enter' to boot
- Other methods
[編輯] How to modify kernel boot-up arguments, to gain root user access
- Read #General Notes
- Boot-up computer
- If GRUB menu is hidden, press 'Esc' to enter the GRUB menu
- If GRUB password is set, press 'p' to unlock the GRUB menu
- Select
Ubuntu, kernel 2.6.10-5-386
- Press 'e' to edit the commands before booting
- Select
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash
- Press 'e' to edit the selected command in the boot sequence
- Add "rw init=/bin/bash" to the end of the arguments
grub edit> kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash rw init=/bin/bash
- Press 'b' to boot
[編輯] How to use Ubuntu Installation CD, to gain root user access
- Read #General Notes
- Boot-up computer into Ubuntu Installation CD
- At "boot:" prompt, add "rescue" to the argument
boot: rescue
- Follow the instructions on screen
[編輯] How to change root user/main user password if forgotten
- Read #General Notes
- Read #How to gain root user access without login
- To change root user password
# passwd root
- To change main user password
# passwd system_main_username
[編輯] How to change GRUB menu password if forgotten
- Read #General Notes
grub
grub> md5crypt Password: ****** (ubuntu) Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password) grub> quit
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Find this line
... password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/ ...
- Replace with the following line
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password above)
- Save the edited file
[編輯] How to restore GRUB menu after Windows installation
[編輯] Super Grub Disk
- Use Super Grub Disk
- More info on how to use it here
[編輯] Grub
If you have booted your linux distro with Super Grub Disk, or a live CD and want to restore your grub, follow the below instructions:
- As root (or with sudo), type
grub - When at the grub prompt, type
find /boot/grub/stage2 - This will return something like
(hd0,2) - To setup the boot partition boot type
root (hd0,2). This is the harddrive and the partition your linux is installed on... - And then to configure grub type
setup (hd0) - Now you're done, so exit with
quit
[編輯] How to identify the name of the boot drive (hd0, hd1, hd2, etc)
Press "c" on boot menu. If you don't see a boot menu, press ESC key first when booting to show the boot menu.
Type:
root (hd0,0)
Most likely you will get "(hd0,0) ext2fs", which should be your current Linux drive. Now change hd0 to hd1 to see what is there.
root (hd1,0)
If you get "(hd1,0) filesystem type unknown, partition type 0x7", then hd1 is a Windows drive.
Now change hd1 to hd2, keep going until you reach hd7.
OR
In a terminal you can type:
cat /boot/grub/device.map
You will get something like this:
(hd0) /dev/hda (hd1) /dev/sda
This represents that grub recognizes your IDE drive and assigned it the value hd0; and also your SATA drive and assigned it the value hd1.
- Note that grub assigns all hard disks by hd* where * is a number.
Edit: As far as I'm aware SATA drive are identified as sda* - Can anyone confirm this then edit this as appropriate?
This is useful if you are editing your /boot/grub/menu.lst from a terminal in Ubuntu and need to know what grub is seeing.
Use
sudo fdisk -l
to find which drives are bootable
[編輯] How to add Windows entry into GRUB menu
- Read #General Notes
- Read #How to list partition tables
- e.g. Assumed that /dev/hda1 is the location of Windows partition
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Append the following lines at the end of file
title Microsoft Windows root (hd0,0) savedefault makeactive chainloader +1
- Save the edited file
- Finally, do
sudo update-grub
This will update the grub bootloader and finalize any changes you made
[編輯] How to boot into Windows installed on a seperate SATA drive
This configuration applies to people who have Linux installed on a IDE drive, and Windows installed on a seperate SATA. The IDE drive boots first, so we need to add an entry to the boot menu on the Linux disk. Here we assume the name of your Windows drive is hd1. If you are not sure, click the link above to find out.
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Append the following lines at the end of file.
title Windows XP on SATA drive map (hd0) (hd1) map (hd1) (hd0) chainloader (hd1,0)+1
- Save the edited file
- Finally, do
sudo update-grub
This will update the grub bootloader and finalize any changes you made
[編輯] How to read Linux partitions (ext2, ext3) in Windows machine
- Read #General Notes
- Download Explore2fs: Here
- OR
[編輯] Tips And Tricks
[編輯] How to Install Citrix ICAClient 10
- Read here
[編輯] Mplayer Frontend
If you are looking for nice Mplayer Frontend check this
[編輯] How to enable lame for FFMPEG (needed to encode FLV with sound)
KINO FLVs silent? You need to recompile FFMPEG with LAME enabled. FFMPEG can be installed via apt-get as a package, but is not able encode MP3, which is the audio stream in FLV video (like Google & YouTube).
- Read #How to add extra repositories
- Ensure Ubuntu Universe repository is not preceded by # in /etc/apt/sources.list
- Download and install lame liblame-dev and gcc packages (mp3 encoder + GNU compiler collection)
sudo apt-get build-dep ffmpeg sudo apt-get install liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 \ liba52-0.7.4-dev libx264-dev libdts-dev libgsm1-dev libvorbis-dev libdc1394-13-dev \ checkinstall build-essential gcc
- Download and extract FFMPEG source to current working directory
sudo apt-get source ffmpeg
- Compile FFMPEG from source
cd ffmpeg-* sudo ./configure --enable-gpl --enable-pp --enable-vorbis --enable-libogg \ --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug \ --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-pthreads \ --enable-x264 maybe try instead = sudo ./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libogg \ --enable-liba52 --enable-libdts --enable-dc1394 --enable-libgsm --disable-debug \ --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-xvid --enable-pthreads \ --enable-x264 sudo make sudo checkinstall [accept defaults, set version to 3:0.cvs20060823-3.1ubuntu2]
If during the make it dies at 'x264.c:147: error: `struct <anonymous>` has no member name `i_rf_constant` you need to do the following. Open libavcodec/x264.c and goto line 147. Change 'i_rf_constant' to 'f_rf_constant' and retry.
If an application you are using employs FFMPEG to encode FLV, it should now work properly. You can also call FFMPEG directly from the command line. The extension/suffix of the outfile tells FFMPEG which audio or video format to encode to.
ffmpeg [-i infile] [outfile]
[編輯] How to enable smooth fonts
gedit ~/.fonts.conf
- Paste in this text:
<?xml version=”1.0” ?> <!DOCTYPE fontconfig SYSTEM “fonts.dtd”> <fontconfig> <match target=”font”> <edit name=”autohint” mode=”assign”> <bool>true</bool> </edit> </match> </fontconfig>
- You』ll have to log out and back in to see the difference.
[編輯] 如何在不重啟計算機的情況下重啟GNOME
- 保存並關閉所有打開的應用程序
按 'Ctrl + Alt + Backspace'鍵
- 或者
sudo /etc/init.d/gdm restart
- 或者
如果這些方法都不奏效,請參見#System requests (What to do if your system is unresponsive)
[編輯] 如何在啟動GNOME時開啟數字鍵盤鎖Num Lock
sudo aptitude install numlockx sudo cp /etc/X11/gdm/Init/Default /etc/X11/gdm/Init/Default_backup gksudo gedit /etc/X11/gdm/Init/Default
- 找到下面一行
... exit 0
- 將如下內容添加到該行上面
if [ -x /usr/bin/numlockx ]; then /usr/bin/numlockx on fi
[編輯] How to remap the Caps Lock key as another Control key
gksudo gedit /etc/console-tools/remap
[編輯] In the Console
- Change
#s/keycode 58 = Caps_Lock/keycode 58 = Control/;
to
s/keycode 58 = Caps_Lock/keycode 58 = Control/;
- Save your work
sudo /etc/init.d/console-screen.sh
- Try using it
[編輯] In X Windows
gksudo gedit ~/.Xmodmap
- Add this:
keycode 66 = Control_L clear Lock add Control = Control_L
- Now, apply the changes.
xmodmap ~/.Xmodmap
- To apply them on startup
- If ~/.xinitrc does not exist,
cp /etc/X11/xinit/xinitrc ~/.xinitrc
- In all cases
gedit ~/.xinitrc
- Make the first line this:
xmodmap ~/.Xmodmap
- Restart X (Ctrl - Alt - Backspace)
- Log In, a dialog should pop up, add .Xmodmap to the left side with the add button, and Save.
[編輯] How to run programs on startup when login into GNOME
- System -> Preferences -> Sessions
- Sessions
Startup Programs Tab -> Add/Edit/Delete
[編輯] How to speed-up your Ubuntu box
- Read the following post: http://ubuntuforums.org/showthread.php?t=189192
[編輯] How to switch to Console mode in GNOME
- To switch to Console mode
Press 'Ctrl + Alt + F1' (F2 - F6)
- To switch between consoles in Console mode
Press 'Alt + F1' (F2 - F6)
- To switch back to GNOME mode
Press 'Alt + F7'
[編輯] 如何禁止Ctrl+Alt+Backspace從GNOME/KDE 3.5.x環境中重啟X Window
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup gksudo gedit /etc/X11/xorg.conf
- 在文件末,添加如下內容
Section "ServerFlags" Option "DontZap" "yes" EndSection
[編輯] How to enable Ctrl+Alt+Del to open System Monitor in GNOME
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 "<Control><Alt>Delete" gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 "gnome-system-monitor"
[編輯] 如何刷新GNOME桌面
killall nautilus
[編輯] 如何刷新GNOME面板
killall gnome-panel
[編輯] How to enable autosave in Gedit and disable creation of some_file~ files
- Applications -> System Tools -> Configuration Editor
- Configuration Editor
/ -> apps -> gedit-2 -> preferences -> editor -> save -> create_backup_copy (Unchecked) / -> apps -> gedit-2 -> preferences -> editor -> save -> auto_save (Checked)
[編輯] How to show all hidden files/folders in Nautilus
- Places -> Home Folder
- To temporary show all hidden files/folders in Nautilus
Press 'Ctrl + H'
- To permanently show all hidden files/folders in Nautilus
Edit Menu -> Preferences
Views Tab -> Default View -> Show hidden and backup files (Checked)
[編輯] How to browse files/folders as root user in Nautilus
- To install File Browser (Root)
gksudo gedit /usr/share/applications/Nautilus-root.desktop
- Insert the following lines into the new file
[Desktop Entry] Name=File Browser (Root) Comment=Browse the filesystem with the file manager Exec=gksudo "nautilus --browser %U" Icon=file-manager Terminal=false Type=Application Categories=Application;System;
- Save the edited file
- Read #How to refresh GNOME panel
- To browse files/folders as root user in Nautilus
- Applications -> System Tools -> File Browser (Root)
[編輯] How to install a "View in Terminal" Menu for Nautilus
sudo aptitude install nautilus-open-terminal
- Nautilus -> Right-click on folder or background -> Open in Terminal
[編輯] How to change default file type "Open with" program
Right click on file -> Properties
Open With Tab -> Add Select "Open with" program
Select "Open with" program (Checked)
[編輯] How to change preferred email client to Mozilla Thunderbird
- Read #How to install Email Client (Mozilla Thunderbird)
- System -> Preferences -> Preferred Applications
- Preferred Applications
Mail Reader Tab -> Default Mail Reader -> Command: mozilla-thunderbird %s
[編輯] 如何通過單擊右鍵以超級用戶方式打開文件
gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ root
- 在新建的文件中插入如下內容
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do gksudo "gnome-open $uri" & done
- 保存修改的文件
chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ root
Right click on file -> Scripts -> Open as root
[編輯] How to disable beep sound in Terminal mode
Not for Dapper---- firingstone
- Applications -> Accessories -> Terminal
- Terminal
Edit Menu -> Current Profile...
General Tab -> General -> Terminal bell (Un-Checked)
[編輯] How to handle mms protocol in Mozilla Firefox
- Open your firefox.
- Type as url: about:config
Now just right click somewhere into the main window. A little box with options to choose will appear. Choose "new", then "string". Then copy the following line into the appearing text field:
network.protocol-handler.app.mms
Into the next text field copy this:
/usr/bin/X11/vlc
Now you do the same thing again, but this time you do not choose "string" but "boolean", and the line to copy is:
network.protocol-handler.external.mms
Then set
true
[編輯] How to handle rtsp (realmedia) protocol in Mozilla Firefox
- Open your firefox.
- Type as url: about:config
Now just right click somewhere into the main window. A little box with options to choose will appear. Choose "new", then "string". Then copy the following line into the appearing text field:
network.protocol-handler.app.rtsp
Into the next text field copy this:
/usr/bin/X11/realplay
Now you do the same thing again, but this time you do not choose "string" but "boolean", and the line to copy is:
network.protocol-handler.external.rtsp
Then set
true
[編輯] How to load Web site faster in Mozilla Firefox
- Applications -> Internet -> Firefox Web Browser
- Mozilla Firefox
Address Bar -> about:config
Filter: -> network.dns.disableIPv6 -> true network.http.pipelining -> true network.http.pipelining.maxrequests -> 8 network.http.proxy.pipelining -> true
- Restart Mozilla Firefox
[編輯] How to disable beep sound for link find function in Mozilla Firefox
- Applications -> Internet -> Firefox Web Browser
- Mozilla Firefox
Address Bar -> about:config
Filter: -> accessibility.typeaheadfind.enablesound -> false
- Restart Mozilla Firefox
[編輯] How to apt-get the easy way (Synaptic)
- Step By Step Synaptic Package Manager Tutorials with Screenshots
- System -> Administration -> Synaptic Package Manager
- To enable the extra Universe and Multiverse repositories
- Settings -> Repositories
- In the Installation Media tab, click Add. There are three separate repositories; Dapper Drake, Security Updates and Updates. Select each repository and check Officially supported, Restricted copyright, Community maintained (Universe) and Non-free (Multiverse). Ensure you click OK between each repository to save your changes
- You should now see those three repositories under Channels. Make sure Officially supported, Restricted copyright, Community maintained (Universe) and Non-free (Multiverse) appears under each repository
- To add backports and PLF (new versions of many applications. Unsupported. May contain illegal packages. Use at own risk.)
- Settings -> Repositories
- Click on Add and then Custom
- Paste the following four lines into the box and click Add Repository, one line at a time:
deb http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse
deb http://medibuntu.sos-sts.com/repo/ edgy free deb http://medibuntu.sos-sts.com/repo/ edgy non-free deb-src http://medibuntu.sos-sts.com/repo/ edgy free deb-src http://medibuntu.sos-sts.com/repo/ edgy non-free
- To refresh the list of known packages (equivalent to apt-get update)
Edit Menu -> Reload Package Information
- To install all possible upgrades (equivalent to aptitude upgrade)
Edit Menu -> Mark All Upgrades... -> Default Upgrade Edit Menu -> Apply Marked Changes
- To search for a package (equivalent to aptitude search package_name)
Edit Menu -> Search... Specify the package name
- To install the selected package (equivalent to aptitude install package_name)
Select "package_name" Package Menu -> Mark for Installation Edit Menu -> Apply Marked Changes
- To remove installed package (equivalent to aptitude remove package_name)
Select "package_name" Package Menu -> Mark for Removal Edit Menu -> Apply Marked Changes
[編輯] How to install Flock Web Browser in Ubuntu
[編輯] What packages do the extra repositories provide
- The PLF repository provides
- DVD playback support (libdvdcss2)
- Skype
- Sun Java SDK (Software Development Kit) and JRE (Java Runtime Environment)
- Opera Web browser
- RealPlayer 10
- Win32 binary multimedia codecs
如何安裝/卸載.deb格式的文件 (=== How to install/uninstall .deb files ===)
安裝 .deb格式的文件(*To install .deb file)
sudo dpkg -i package_file.deb
卸載.deb格式的文件(*To uninstall .deb file)
sudo dpkg -r package_name
[編輯] How to find out which version of a package I have installed
dpkg -l packagename
[編輯] How to convert .rpm files to .deb files
sudo alien -d package_file.rpm
[編輯] How to compile .deb files from source
- Read #How to add extra repositories
- There are various programs available to help automate the process of create .deb files from source. For more information, see the links at the end of this section. A basic well tested method is described here.
- Install the necessary software to build the source (build-essential may be all that is necessary, though there may be other dependencies) and checkinstall (which creates deb files).
sudo aptitude install checkinstall build-essential
- In the directory where you have extracted the source, after you have run ./configure and make you can create a .deb file and install it with either of the following commands. The second -D option creates a .deb file in the directory that you can share with others or install without needing the source.
sudo checkinstall
or
sudo checkinstall -D
- For more info go to CheckInstall home page and the Installing software on Ubuntu page. Autodeb uses a modified version of AutoApt to complete the entire process above including extraction from the .tar.gz file, however it is still in an early stage of development.
[編輯] 批量重命名目錄中的所有文件
- 安裝 "mvb" 文件重命名工具
wget -c http://easylinux.info/uploads/mvb_1.6.tgz sudo tar zxvf mvb_1.6.tgz -C /usr/share/ sudo chown -R root:root /usr/share/mvb_1.6/ sudo ln -fs /usr/share/mvb_1.6/mvb /usr/bin/mvb
- 批量重命名目錄中的所有文件
mvb NEW_NAME
[編輯] How to manipulate all image files in directory at once
- To install bash batch image processing script
sudo aptitude install imagemagick wget -c http://easylinux.info/uploads/bbips.0.3.2.sh sudo cp bbips.0.3.2.sh /usr/bin/bbips sudo chmod 755 /usr/bin/bbips
- To manipulate all image files in directory at once
bbips
[編輯] How to set System-wide Environment Variables
sudo cp -p /etc/profile /etc/profile_backup gksudo gedit /etc/profile
- Append the System-wide Environment Variables at the end of file
- Save the edited file
[編輯] How to save "man" outputs into files
man command | col -b > file.txt
[編輯] How to hide GRUB menu on boot-up
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Find this line
... #hiddenmenu ...
- Replace with the following line
hiddenmenu
- Save the edited file
[編輯] How to change the timeout seconds for GRUB menu on boot-up
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Find this line
... timeout 3 ...
- Replace with the following line
timeout X_seconds
- Save the edited file
[編輯] How to change default Operating System boot-up for GRUB menu
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Find this line
... default 0 ...
- Replace with the following line
default X_sequence
- Save the edited file
[編輯] How to display Splash Image for GRUB menu on boot-up
- e.g. Assumed that hd0,1 is the location of Ubuntu boot partition
wget -c http://easylinux.info/uploads/ubuntu.xpm.gz chmod 644 ubuntu.xpm.gz sudo mkdir /boot/grub/images sudo cp ubuntu.xpm.gz /boot/grub/images/ sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup gksudo gedit /boot/grub/menu.lst
- Find this section
# menu.lst - See: grub(8), info grub, update-grub(8) # grub-install(8), grub-floppy(8), # grub-md5-crypt, /usr/share/doc/grub # and /usr/share/doc/grub-doc/. ...
- Add the following line below it
splashimage (hd0,1)/boot/grub/images/ubuntu.xpm.gz
- NOTE: If you have seperate boot partition use this line: splashimage (hd0,1)/grub/images/ubuntu.xpm.gz
- Save the edited file
[編輯] How to convert Wallpaper to Splash Image for GRUB menu
- e.g. Assumed that wallpaper.png is the Wallpaper to be converted to Splash Image
- splashimage.xpm.gz is the Splash Image for GRUB menu
- ImageMagick is installed
convert -resize 640x480 -colors 14 wallpaper.png splashimage.xpm && gzip splashimage.xpm
- Read #How to display Splash Image for GRUB menu on boot-up (use splashimage.xpm.gz instead of ubuntu.xpm.gz)
[編輯] How to display only one kernel on GRUB menu
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup-`date +%F` gksudo gedit /boot/grub/menu.lst
- Find this line
... # howmany=all ...
- Replace with the following line
# howmany=1
Where 1 means to keep the last kernel, 2 to keep the last 2 kernels, etc. Do not delete the # symbol. The menu will be updated once a new kernel will be updated by the system, not before.
- Save the edited file
- Update /boot/grub/menu.lst
sudo update-grub
[編輯] How to force GDM to system beep when login screen ready
- This is useful on computers where headphones are usually plugged in, allowing them to utilize the speakers for this attention-getting task.
echo foo >> ~/foo.wav
- System -> Administration -> Login Window -> Accessibility
Now make sure the "Login Screen Ready" check mark is checked. Click on the folder icon and navigate to your home folder and select "foo.wav".
rm foo.wav
The drop down menu should now say "(None)"
[編輯] How to temporary skip boot-up services
Press 'Ctrl + C'
[編輯] Clean up Ubuntu GNU/Linux System
- Clean up Ubuntu GNU/Linux System - This is very Detailed step by step procedure how to Clean up Ubuntu GNU/Linux System with different tools.
[編輯] How to permanently disable/enable boot-up services
[編輯] 怎樣在關機時自動清空 /tmp/ 目錄中的內容
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup gksudo gedit /etc/init.d/sysklogd
- 找到這個部分:
... stop) log_begin_msg "Stopping system log daemon..." start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile log_end_msg $? ...
- 在其下方加入下面這一行:
rm -fr /tmp/* /tmp/.??*
- 保存文件。
[編輯] How to scroll up and down to view previous outputs in Console mode
- To scroll up to view previously outputs
Press 'Shift + Page Up'
- To scroll down to view previously outputs
Press 'Shift + Page Down'
[編輯] How to find out which version of Ubuntu I am using
cat /etc/issue
[編輯] How to set up (automatic) background/wallpaper-changer application for GNOME
- To install the script into a different location than your home directory, replace "~" with your path
cd ~ wget http://members.chello.at/horst.jens/files/wallpaperchanger.py chmod +x wallpaperchanger.py ~/wallpaperchanger.py gedit ~/.wallpaperchanger/wallpaperchangerconfig.py
- Edit all the lines not beginning with an "#" according to your needs. Save the file and close gedit.
- To create an menu entry for wallpaperchanger:
Click the menuitems: Applications -> Accessoires -> Alacarte Menu Editor -> File -> New Entry: Name: wallpaperchanger command: ~/wallpaperchanger.py
- To change desktop background every time you reboot your computer:
Click the menuitems: System -> Preferences -> Session -> Startup Programs -> Add: ~/wallpaperchanger.py
[編輯] How to set up automatic background change (KDE)
- Go to K-menu -> System Settings -> Desktop -> Background
- Choose Slide Show
- Press Setup...
- Press Add... to add pictures you wish to see as desktop background
- Set 'Change picture after' to desired picture rotation interval.
- Press 'OK'
[編輯] How to add keyboard layouts for other languages
- Go to System -> Preferences -> Keyboard
- Choose Layouts
- Press Add... to add the secondary keyboard layout. It is simpler to have two layouts; the maximum is currently four for Xorg.
- Choose Layout Options
- Expand option Group Shift/Lock behaviour
- Choose the key combination that enables you to switch between keyboard layouts. The default is by pressing both Alt keys at the same time. A common alternative is to use Alt+Shift.
- Press Close.
See #How to add the Keyboard (Layout) Indicator applet to add the Keyboard Indicator applet.
[編輯] How to add keyboard layouts toggle for other languages (Xfce)
- use *.lst files on /etc/X11/xkb/rules to select 2nd_laguage_code
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,2nd_laguage_code
- you can add it to a startup file, which will be set to be executed on startup, with the following lines (remember to 'chmod +x' the file):
#!/bin/tcsh setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,il
[編輯] How to add the Keyboard (Layout) Indicator applet
- Right-click on empty space on the top panel so that you see the pop-up menu.
- Click Add to Panel...
- Choose Keyboard Indicator (it is under the Utilities section, at the end)
The Keyboard Indicator applet appears on the panel. The default language should be USA for U.S. English. You can either right-click on this applet for more options or see above on how to configure.
[編輯] How to type extended characters
- Read #How to add keyboard layouts for other languages
- Read #How to add the Keyboard (Layout) Indicator applet
- Add the keyboard layout US English International (with dead keys)
- Make US English International (with dead keys) the default keyboard layout.
The key marked ['"] is now a dead key. When you press it, nothing happens. However if you press a consonant immediately afterwards, the consonant appears with an accent.
- ' + a = á
- ' + e = é
- and so on for i-í, o-ó, y-ý, c-ć, z-ź, n-ń, l-ĺ, u-ú, r-ŕ
- " + a = ä
- " + e = ë
- and so on for y-ÿ, u-ü, i-ï, o-ö
Similarly, ` and a consonant generates à, è, ù, ì, ò. Similarly, ~ and a consonant generates ã, ũ, ĩ, õ, ñ.
To type ' and ", press RightAlt+' and RightAlt+" respectively. To type ' and ", you may also press '+<space> and "+<space> respectively.
There are more characters available by keeping RightAlt pressed and typing a character. Therefore,
- RightAlt+q = ä
- RightAlt+w = å
- RightAlt+e = é
- RightAlt+r = ®
- RightAlt+t = þ
- RightAlt+y = ü
- RightAlt+u = ú
- RightAlt+i = í
- RightAlt+o = ó
- RightAlt+p = ö
- RightAlt+[ and ] for « and » respectively.
- RightAlt+a = á
- RightAlt+s = ß
- RightAlt+d = ð
- RightAlt+l = ø
- RightAlt+; = ¶
- RightAlt+: = °
- RightAlt+z = æ
- RightAlt+c = ©
- RightAlt+n = ñ
- RightAlt+m = µ
- RightAlt+, = ç
- RightAlt+/ = ¿
- RightAlt+1 = ¡
- RightAlt+2 = ²
- RightAlt+3 = ³
- RightAlt+4 = ¤
- RightAlt+5 = €
- RightAlt+6 = ¼
- RightAlt+7 = ½
- RightAlt+8 = ¾
- RightAlt+9 = 『
- RightAlt+0 = 』
- RightAlt+- = ¥
- RightAlt+= = ×
- RightAlt+! = ¹
- RightAlt+@, then o = ő (and Ő).
- RightAlt+#, then a = ā (and Ā). Similarly for ēĒ, ūŪ, īĪ, ōŌ.
- RightAlt+$ = £
- RightAlt+% =
- RightAlt+^ =
- RightAlt+& =
- RightAlt+*, then a = ą (and Ą). Similarly for ęĘ, įĮ.
- RightAlt+(, then a = ă (and Ă)
- RightAlt+(, then g = ğ (and Ğ)
- RightAlt+), then a = å (and Å)
- RightAlt+_ =
- RightAlt++ = ÷
[編輯] How to set the Compose key to type special characters
- Read #How to add keyboard layouts for other languages
- Read #How to add the Keyboard (Layout) Indicator applet
- Click System, Preferences, Keyboard.
- Under Layout Options, expand on Compose key position.
- Choose Right-Win key is compose, click Close.
Now you can type extended characters using the RightWin key (next to AltGr), according to this keyboard settings file. Specifically, the lines that start with GDK_Multi_key are those that we can use here. The Compose key is actually GDK_Multi_key.
Some examples,
- RightWin + C + = produces €
- RightWin + = + C produces €
- RightWin + C + O produces ©
- RightWin + O + C produces ©
- RightWin + a + ' produces á
- RightWin + a + " produces ä
- RightWin + a + ` produces à
- RightWin + a + ~ produces ã
- RightWin + a + * produces å
- RightWin + a + ^ produces â
- RightWin + a + > produces â
- RightWin + a + , produces ą
- RightWin + e + - produces ē
- RightWin + S + 1 produces ¹
- RightWin + S + 2 produces ²
- RightWin + S + 3 produces ³
[編輯] How to install ubuntu-title font used in Ubuntu logo
sudo aptitude install ttf-ubuntu-title
Now you can use this font in your favorite applications
[編輯] How to associate Adobe Reader with files in Nautilus
- Read #How to install PDF Reader (Adobe Reader) with Plug-in for Mozilla Firefox
- Open Nautilus (Places -> Desktop)
- Browse to a .pdf file
- Right-click the .pdf file, select Properties, go to the Open With tab, choose Adobe Reader.
Now when you double-click on a .pdf file, it will be opened with Adobe Reader.
[編輯] How to print from Adobe Reader
- Read #How to install PDF Reader (Adobe Reader) with Plug-in for Mozilla Firefox
- Read #How to add a printer
- Applications -> Office -> Adobe Reader
- File -> Print
- In the Print Command box, append -d printername. For example, if your printer was named FS-1010, the Print Command would read:
/usr/bin/lp -d FS-1010
[編輯] How to pull apart and combine pdf files
sudo aptitude install pdftk cd mkdir bin cd bin gedit pdftk_burst
- add the following text to pdftk_burst:
#!/bin/bash
cd ${1%/*}
/usr/bin/pdftk "$1" burst
rm doc_data.txt
- save and close pdftk_burst
gedit pdftk_cat
- add the following text to pdftk_cat:
#!/bin/bash
cd ${1%/*}
outfile="00out.pdf"
if [ -f $outfile ] ; then
rm -f $outfile
fi
/usr/bin/pdftk *.pdf cat output $outfile
- save and close pdftk_cat
chmod u+x pdftk_burst pdftk_cat
- open Nautilus (Places -> Desktop) and browse to a .pdf file
- right-click the .pdf file, select Properties, go to the Open With tab, click Add, click Use a Custom Command, click Browse, browse to pdftk_burst. Do the same with pdftk_cat.
Now, when you right-click on a .pdf file, you'll get two extra options:
- Open With -> pdftk_burst which will convert a 30 page pdf file to 30 x 1 page pdf files
- Open With -> pdftk_cat which will join together all the pdf files in the same directory, and create a file called 00out.pdf
Note: this won't work with pdfs with any type of protection - read man pdftk for more command line options.
[編輯] How to remove jedit when Synaptic package manager fails after install
sudo dpkg --remove --force-depends --force-remove-reinstreq jedit
Now, you can use your Synaptic package manager again.
[編輯] How to compile a kernel the Ubuntu Way
http://www.howtoforge.com/kernel_compilation_ubuntu
[編輯] System requests (What to do if your system is unresponsive)
You can "talk" to the kernel directly via system requests: Press "ALT" + "sysreq-key" + "one of the keys" listed below (The sysreq-key is also known as the 'print screen' key):
(Taken from /usr/src/linux/Documentation/sysrq.txt)
- 'r' - Turns off keyboard raw mode and sets it to XLATE.
- 'k' - Secure Access Key (SAK) Kills all programs on the current virtual console.
- 'b' - Will immediately reboot the system without syncing or unmounting your disks.
- 'c' - Will perform a kexec reboot in order to take a crashdump.
- 'o' - Will shut your system off (if configured and supported).
- 's' - Will attempt to sync all mounted filesystems.
- 'u' - Will attempt to remount all mounted filesystems read-only.
- 'p' - Will dump the current registers and flags to your console.
- 't' - Will dump a list of current tasks and their information to your console.
- 'm' - Will dump current memory info to your console.
- 'v' - Dumps Voyager SMP processor info to your console.
- '0'-'9' - Sets the console log level, controlling which kernel messages will be printed to your console. ('0', for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)
- 'f' - Will call oom_kill to kill a memory hog process
- 'e' - Send a SIGTERM to all processes, except for init.
- 'i' - Send a SIGKILL to all processes, except for init.
- 'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system will be non-functional after this.)
- 'h' - Will display help ( actually any other key than those listed above will display help. but 'h' is easy to remember :-)
Note that you may have to enable system requests. Read "/usr/src/linux/Documentation/sysrq.txt" for details. By default it is enabled though.
[編輯] How to add locales to Ubuntu the command line way
- Open up a terminal
- Generate a /var/lib/locales/supported.d/local from /usr/share/i18n/SUPPORTED:
cat /usr/share/i18n/SUPPORTED | grep "en\|ru" > /var/lib/locales/supported.d/local
This example shows all Russian (ru) and English (en) locales being chosen. Look through /usr/share/i18n/SUPPORTED to find the ones for you, then put them in a list, replacing en\|ru and separating each language with a \| (backslash, bar). If you only want one language, just put it in quotes.
- Then regenerate all of the locales:
dpkg-reconfigure locales
- Then set your locale:
update-locale LANG=en_US.UTF-8
In this step, make sure to choose the language and country that you would like your computer to think it is in. Here, I choose en_US, the United States version of English. Once again, look at your /var/lib/locales/supported.d/local or /usr/share/i18n/SUPPORTED for the one right for you. You may also want to research locales, using the Internet.
That was easy, now the commandlxtermwill open up the Unicode version of xterm or your translated software will display things properly, like vim.
[編輯] How to set default Terminal App window size
The size for a gnome terminal session can be passed through the geometry parameter, specifying columns and rows like 80x40. The default geometry is 80x25.
- First way is to add the following parameter to gnome-terminal launcher:
--geometry 100x40
- Other way is to change this parameter globaly for all gnome-terminal launcher's. Go to /usr/share/applications/gnome-terminal.desktop and edit the EXEC line like this:
Exec=gnome-terminal --geometry=120x30
[編輯] Using VI editor
A few very simple tricks of using basic but strong unix editor called vi can be found here.
[編輯] 怎樣播放 DVD
- 閱讀 #概述
- 閱讀 #如何添加額外的軟件源
- 安裝編碼/解碼器:
sudo aptitude install libdvdnav4 libdvdplay0 libdvdread3 libdvdcss2
- 用 totem-xine 代替默認的 "totem-gstreamer":
sudo aptitude remove --purge totem totem-gstreamer sudo aptitude install totem-xine
[編輯] How to install Gmail Notifier alternative (CheckGmail)
- Add the following sources to the repository list:
deb http://asher256-repository.tuxfamily.org dapper main dupdate french deb http://asher256-repository.tuxfamily.org ubuntu main dupdate french
- Install the application
sudo aptitude install checkgmail
- Go to 'System/Preferences/Sessions/Startup Programs' and add the following path to start notifier automatically
/usr/bin/checkgmail
After this the program will appear in your notification area.
[編輯] How to emulate Mac OS X Spotlight (Deskbar)
- Right click to your panel and select 'Add to panel...'. Now choose 'Deskbar' applet and click 'Add' button.
- Install 'Beagle' packet to enable data indexing on your computer
[編輯] How to make Ubuntu look like Mac OS X
- Detailed instruction can be found here.
[編輯] How to remove temporary files on shutdown
- Backup sysklogd file
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
- Edit sysklogd file
gksudo gedit /etc/init.d/sysklogd
- After the following lines...
stop) log_begin_msg "Stopping system log daemon..." start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile log_end_msg $?
- Add this line:
rm -fr /tmp/* /tmp/.??*
[編輯] How to tile windows in gnome
First, download the wmtile debian package here.
If you are not running i386, the project's homepage is here.
- Double click the package and install it.
- Login as root and browse to /usr/share/tile/
- Open the rc file in gedit
- Change the second option to read "multi-desktop netwm"
- Save the rc file
Now, create a launcher:
- Right-click on the gnome panel (the taskbar at the top of the screen) and choose "Add to Panel"
- Select "Custom Application Launcher" and fill in these values:
- Type: Application
- Name: Tile Windows Vertically
- Command: tile -v -w
- You can also select an icon to use with the launcher.
- Click "OK"
Now open a couple windows and click your new launcher button to test it. This works great with two or three windows, but it can get a bit strange with more.
If you want to create another launcher that tiles windows horizontally, just follow the same directions, but use the command "tile -h -w"
[編輯] 安裝虛擬 PDF 打印機
用新立得軟件包管理器安裝 cups-pdf
找到 系統 -> 系統管理 -> 打印
添加打印機: 打印機 -> 添加打印機,或雙擊 "新打印機" 圖標
"步驟1" 現在PDF 打印機 (虛擬打印機) 應該已經出現在已經檢測到的本地打印機列表中了。選中它,點「下一步」。
"步驟2" 選擇 "Generic" 為生產商,以 "PostScript" 為打印機,點「下一步」。
"步驟3" 給打印機添加一個描述和位置,點「應用」。
"CUPS/PostScript" 打印機應該已經存在於應用程序的打印對話框中,並把輸入的PDF文件保存到 /HOME/PDF 目錄。也可以通過編輯 /etc/cups/cups-pdf.conf 文件來改變目標位置。
[編輯] Servers
[編輯] Ubuntu Feisty LAMP Server
- Ubuntu Feisty LAMP Server Installation with Screenshots Simple Step by Step Installation Guide
- Ubuntu Edgy LAMP Server Installation with Screenshots Simple Step by Step Installation Guide for Ubuntu Users
[編輯] AntiVirus Server
[編輯] How to install ClamAV AntiVirus Server
sudo clamscan -r /location_of_files_or_folders
[編輯] How to automatically scan files/folders for viruses
- e.g. Automatically scan files/folders for viruses at midnight everyday
- * * * * * means minute hour date month year
export EDITOR=gedit && sudo crontab -e
*Append the following line at the end of file
00 00 * * * sudo clamscan -r /location_of_files_or_folders
- Save the edited file
[編輯] Monitoring Server
- Read #General Notes
- Read #How to add extra repositories
If you want to monitor your Ubuntu servers and clients like memory usage,CPU usage,Load average,Disk usage,Mysql monitoring, Network Monitoring,Processes Monitoring this is for you
[編輯] Print Server (cupsd)
- Read #General Notes
- Read #How to add extra repositories
[編輯] How to install cupsd
- Cupsd should be automatically installed during standard instaltion. Checkout if there is a file "/etc/init.d/cupsys". If you want to manually install it, do
sudo apt-get install cupsys*
[編輯] How to add a printer
- Go to System -> Administration -> Printing.
- Choose "Add printer".
- "Add printer wizard" should start and tell you what to do.
[編輯] 怎樣移除(刪除)打印機
sudo lpadmin -x printernamewhere
- printername 是你想移除的打印機的名字
[編輯] 怎樣通過另一台ubuntu機器在遠程unubtu機器上打印
- 確認你本地打印機的配置是正確的.
- 共享本地打印機 - 系統/System -> 管理/Administration -> 打印/Printing -> 全局設置/Global Settings menu -> 共享打印機/Share printers
- 服務器ip地址: 192.168.0.1
- 客戶端ip 地址: 192.168.0.23
- 服務器設置
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup gksudo gedit /etc/cups/cupsd.conf
- 找到以下塊
<Location /> ... Allow localhost ... </Location>
- 加入以下一行.
Allow 192.168.0.23
- 重啟 cups.
sudo /etc/init.d/cupsys restart
- 客戶端設置
sudo cp /etc/cups/client.conf /etc/cups/client.conf.backup gksudo gedit /etc/cups/client.conf
- 添加以下一行.
ServerName 192.168.0.1
- 重啟 cups.
sudo /etc/init.d/cupsys restart
- 現在試一下 "lpq",將會看到顯示如下
vitek@lightfox:~$ lpq HPLJ6P is ready no entries
[編輯] 怎樣在windows的機器上使用遠程的 Ubuntu 機器實現打印
- Read #How to install Samba Server for files/folders sharing service
- Read #How to print on remote Ubuntu machine via samba
1.19.4.5
How to set up 4 port printer server
Setting up COMPUSA print server on Ubuntu
(1) go to System, Administration, Printing.
(2) Then Add a printer
(3) Network Printer and choose HP JetDirect
(4) Where it says Host you put in the IP Address of the Print server. You can find it with Smb4k
(5) Where it says Port you put 9100 for USB port 1. 9101 for USB port 2. 9102 for USB port 3. and 9103 for USB port 4.
(6) Then click on forward and install your printer
[編輯] NFS Server
[編輯] Installing NFS Server
sudo apt-get install nfs-kernel-server nfs-common portmap
Reconfigure Portmap to not bind to loopback interface:
sudo dpkg-reconfigure portmap sudo /etc/init.d/portmap restart
Define which folders to share (export):
sudo vi /etc/exports
Add share (export) definitions:
This will export path to all IP addresses between 192.168.1.1 and 192.168.1.255 with Read/Write access:
/path/to/shared/files 192.168.1.1/24(rw,no_root_squash,async)
This will export path to all IP addresses between 192.168.1.1 and 192.168.1.255 with Read Only access:
/path/to/shared/files 192.168.1.1/24(ro,async)
When finished, save changes and restart the NFS Server:
sudo /etc/init.d/nfs-kernel-server restart
Export your new configuration:
sudo exportfs -a
[編輯] Installing NFS Client
sudo apt-get install portmap nfs-common
[編輯] Mounting Manually
cd ~ mkdir temp sudo mount 192.168.1.1:/path/to/shared/files temp
You may need to restart NFS services:
sudo /etc/init.d/portmap restart sudo /etc/init.d/nfs-common restart
[編輯] Mounting Automatically
Create mountpoint:
sudo mkdir /mnt/files
Edit configuration:
sudo vi /etc/fstab
Add something similar to below:
192.168.1.1:/path/to/shared/files /mnt/files nfs rsize=8192,wsize=8192,timeo=14,intr
Test new configuration:
sudo mount /mnt/files
Reboot to test automatic mounting.
[編輯] Samba Server
[編輯] 怎樣安裝用於文件/文件夾共享的 Samba 服務
- Read #General Notes
- Read #How to add extra repositories
sudo apt-get install samba smbfs
[編輯] 如何添加/編輯/刪除網絡用戶
- 閱讀 #通用注意事項
- 閱讀 #如何安裝Samba服務器來獲得文件/文件夾共享服務
- 添加網絡用戶
sudo smbpasswd -a 系统用户名 gksudo gedit /etc/samba/smbusers
- 插入下面行到新文件中
system_username = "网络用户名"
- 保存剛才編輯的文件
- 編輯網絡用戶帳戶
sudo smbpasswd -a 系统用户名
- 刪除網絡用戶帳戶
sudo smbpasswd -x 系统用户名
注意:如果執行以上失敗,請添加smb用戶之前,先添加ubuntu的用戶,也就是說smb用戶首先是ubuntu用戶。
[編輯] 怎樣以只讀權限共享根文件夾 (Authentication=Yes)
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- 找到以下行
... ; security = user ...
- 替換成以下幾行
security = user username map = /etc/samba/smbusers
- Uncomment the following lines:
;[homes] ;comment = Home Directories ;browseable = no ;valid users = %S ;writable = yes
- 保存編輯的文件
- Read #How to add/edit/delete network users
sudo testparm sudo /etc/init.d/samba restart
[編輯] 怎樣以讀寫權限共享根文件夾(Authentication=Yes)
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Find this line
... ; security = user ...
- Replace with the following lines
security = user username map = /etc/samba/smbusers
- Find this section
... # By default, the home directories are exported read-only. Change next # parameter to 'yes' if you want to be able to write to them. writable = no ...
- Replace with the following lines
# By default, the home directories are exported read-only. Change next # parameter to 'yes' if you want to be able to write to them. writable = yes
- Save the edited file
- Read #How to add/edit/delete network users
sudo testparm sudo /etc/init.d/samba restart
[編輯] How to share group folders with read only permission (Authentication=Yes)
sudo mkdir /home/group sudo chmod 777 /home/group/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Find this line
... ; security = user ...
- Replace with the following lines
security = user username map = /etc/samba/smbusers
- Append the following lines at the end of file
[Group] comment = Group Folder path = /home/group public = yes writable = no valid users = system_username1 system_username2 create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup
- Save the edited file
- Read #How to add/edit/delete network users
sudo testparm sudo /etc/init.d/samba restart
[編輯] How to share group folders with read/write permissions (Authentication=Yes)
sudo mkdir /home/group sudo chmod 777 /home/group/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Find this line
... ; security = user ...
- Replace with the following lines
security = user username map = /etc/samba/smbusers
- Append the following lines at the end of file
[Group] comment = Group Folder path = /home/group public = yes writable = yes valid users = system_username1 system_username2 create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup
- Save the edited file
- Read #How to add/edit/delete network users
sudo testparm sudo /etc/init.d/samba restart
[編輯] How to share public folders with read only permission (Authentication=Yes)
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Find this line
... ; security = user ...
- Replace with the following lines
security = user username map = /etc/samba/smbusers
- Append the following lines at the end of file
[public] comment = Public Folder path = /home/public public = yes writable = no create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Save the edited file
- Read #How to add/edit/delete network users
sudo testparm sudo /etc/init.d/samba restart
[編輯] How to share public folders with read/write permissions (Authentication=Yes)
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Find this line
... ; security = user ...
- Replace with the following lines
security = user username map = /etc/samba/smbusers
- Append the following lines at the end of file
[public] comment = Public Folder path = /home/public public = yes writable = yes create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Save the edited file
- Read #How to add/edit/delete network users
sudo testparm sudo /etc/init.d/samba restart
[編輯] How to share public folders with read only permission (Authentication=No)
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Find this line
... ; security = user ...
- Replace with the following line
security = share
- Append the following lines at the end of file
[public] comment = Public Folder path = /home/public public = yes writable = no create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Save the edited file
sudo testparm sudo /etc/init.d/samba restart
[編輯] How to share public folders with read/write permissions (Authentication=No)
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Find this line
... ; security = user ...
- Replace with the following line
security = share
- Append the following lines at the end of file
[public] comment = Public Folder path = /home/public public = yes writable = yes create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Save the edited file
sudo testparm sudo /etc/init.d/samba restart
[編輯] How to print on remote Ubuntu machine via samba
- Read #Print Server (cupsd)
- Make sure your Ubuntu printers are configured properly.
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup gedit /etc/samba/smb.conf
- Find the following lines
... # printing = cups # printcap name = cups ...
- and uncomment them.
printing = cups printcap name = cups
- Restart cups server
sudo /etc/init.d/cupsys restart
- Now printers working on your Ubuntu machine should be acessible via samba.
[編輯] Samba Web Administration Tool (SWAT)
[編輯] How to install INETD Superserver
- Read #General Notes
- Read #How to add extra repositories
sudo apt-get install netkit-inetd
[編輯] How to install SWAT for Samba daemon
- Read #General Notes
- Read #How to add extra repositories
- Read #How to install Samba Server for files/folders sharing service
- Read #How to install INETD Superserver
sudo apt-get install swat
- Open inetd daemon configuration
sudo gksu gedit /etc/inetd.conf
- If string is:
<#off#> swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/sbin/swat
- Change to (due to know BUG which resets peer connection):
swat stream tcp nowait.400 root /usr/sbin/swat swat
- Restart daemon
sudo /etc/init.d/inetd restart
- If you have not set root password, do it, because you'll need it to access swat for editing
- Read #How to set/change/enable root user password
[編輯] SSH Server
[編輯] How to install SSH Server for remote administration service
- Read #General Notes
- Read #How to add extra repositories
sudo apt-get install ssh
[編輯] How to SSH into remote Ubuntu machine
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Remote Ubuntu machine: 192.168.0.1
ssh username@192.168.0.1
[編輯] How to copy files/folders from remote Ubuntu machine into local machine (scp)
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Remote Ubuntu machine: 192.168.0.1
- Remote files/folders location: /home/username/remotefile.txt
- Local machine save location: . (current directory)
scp -r username@192.168.0.1:/home/username/remotefile.txt .
[編輯] How to copy files/folders from local machine into remote Ubuntu machine (scp)
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Local files/folders location: localfile.txt
- Remote Ubuntu machine: 192.168.0.1
- Remote Ubuntu machine save location: /home/username/
scp -r localfile.txt username@192.168.0.1:/home/username/
[編輯] How to copy files/folders from remote Ubuntu machine into local machine (rsync)
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Remote Ubuntu machine: 192.168.0.1
- Remote files/folders location: /home/username/remotefile.txt
- Local machine save location: . (current directory)
rsync -v -u -a --delete --rsh=ssh --stats username@192.168.0.1:/home/username/remotefile.txt .
[編輯] How to copy files/folders from local machine into remote Ubuntu machine (rsync)
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Local files/folders location: localfile.txt
- Remote Ubuntu machine: 192.168.0.1
- Remote Ubuntu machine save location: /home/username/
rsync -v -u -a --delete --rsh=ssh --stats localfile.txt username@192.168.0.1:/home/username/
[編輯] How to mount remote folders into local Ubuntu machine (sshfs)
- Read #General Notes
- e.g. Assumed that remote machine has installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Remote machine: 192.168.0.1
- Remote machine folder location: /media/music
- Install sshfs
sudo apt-get install sshfs
- Load kernel driver for sshfs
sudo modprobe fuse
- Join the 'fuse' user group
sudo adduser your_user_name fuse
- Logout and login for this to take effect.
- fix group on /dev/fuse
sudo chgrp fuse /dev/fuse
- Create local mountpoint in your home directory
mkdir ~/remote_music
- Mount the remote folder into ~/remote_music
sshfs 192.168.0.1:/media/music ~/remote_music
[編輯] How to SSH into remote Ubuntu machine via Windows machine
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Download PuTTY: Here
[編輯] How to copy files/folders from/into remote Ubuntu machine via Windows machine
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Download FileZilla: Here
[編輯] How to limit the user accounts that can connect through ssh remotely
- Read #General Notes
- e.g. If you enable the SSH server, then any user with a valid account can connect remotely
- This can lead to security risks, as there exist remote password cracking tools that
- try common username/password pairs.
- Keep a backup of the ssh server configuration file with
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIGINAL
- Edit the configuration file
gksudo gedit /etc/ssh/sshd_config
- Change the parameter PermitRootLogin from yes to no. The superuser must not be able to connect directly from remote.
- Add the parameter AllowUsers and specify the usernames (space separated) that can connect remotely.
NOTE: This will allow ONLY the users specified to connect. You may use wildcards here (example: j* will allow jsmith to connect but not fsmith)
- You can also use DenyUsers for fine-grained selection of users.
- If you enable the openssh server and you have no intention for now to enable remote connections, you may add AllowUsers nosuchuserhere to disable anyone connecting.
[編輯] Using SSH to Port Forward
- Read #General Notes
- e.g. Assumed that remote machine has installed SSH Server service
- Read #How to install SSH Server for remote administration service
If is possible to create secure SSH tunnels between multiple sites. Imagine two sites (home and office). If you have an SSH server available in the office available via the Internet, you can tunnel across to this server and communicate with any local PC in the office from home.
- Example: Make Port 80 (Web Server) on 10.0.2.10 in the office available locally on Port 81
From home:
ssh -L 81:10.0.2.10:80 user@office.net
Once logged in, you can now browse to http://localhost:81 which is really a secure tunnel to the web server in your office. You can setup multiple port forwardings.
ssh -L 81:10.0.2.10:80 -L 82:10.0.2.20:80 -L 83:10.0.2.30:80 user@office.net
Now, port 81 locally forwards to port 80 on 10.0.2.10, port 82 forwards to port 80 on 10.0.2.20 and port 83 forwards to port 80 on 10.0.2.30
For example, http://localhost:81 connects you to port 80 on 10.0.2.10 (computer at remote location)
Specify port with -p?? if SSH Server on office.net does not run on default port 22.
Explanation:
ssh -L <local port>:<remote computer>:<remote port> <user>@<remote ip>
[編輯] Protecting SSH from brute force atack
- Read #General Notes
- Read #How to add extra repositories
It is possible to easily protect SSH from a password brute force attack with a pam_abl module. You can install it by the two ways:
- Manually according to pam_abl documentation and manually apply patch for a bug №405041 onto openssh-server
- Automatically by the repository from tolero.org
To install from a repository:
- Add a repository for your distribution listed on the ssh brute force protection page
And execute the following commands:
sudo aptitude update sudo aptitude upgrade sudo aptitude install libpam-abl sudo /etc/init.d/ssh restart
First command is to fetch the repository listing. Second is to upgrade the openssh-server package to patched version (openssh-client will be also updated). Third is to set up a protection plugin. And the fourth is to restart a server with a new security plugin.
[編輯] Enable SSH Banner
After login you can have a "banner" file's contents displayed on the user's screen.
- First of all open up the sshd's configuration file:
sudo gedit /etc/ssh/sshd_config
- Find:
#Banner /etc/issue.net
- Replace:
Banner /etc/issue.net
- Save and close.
- Now you need to edit the issue.net file to contain what you want displayed:
sudo gedit /etc/issue.net
- Add what you want:
_
___ _ _ ___ _____ ___| |___
| -_|_'_| .'| | . | | -_|
|___|_,_|__,|_|_|_| _|_|___|
|_|
Welcome to my server
- Save and close
- Restart SSHD:
sudo /etc/init.d/ssh restart
[編輯] DHCP 服務
[編輯] 怎樣安裝自動指派動態ip地址的 DHCP 服務
- Read #General Notes
- Read #How to add extra repositories
- 舉例.假定 "eth0" 是網卡界面,如下
- IP地址的範圍: 192.168.0.100 to 192.168.0.200
- 子網掩碼: 255.255.255.0
- DNS 服務: 202.188.0.133, 202.188.1.5
- 域名: tm.net.my
- 網關地址: 192.168.0.1
sudo apt-get install dhcp3-server sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup gksudo gedit /etc/default/dhcp3-server
- 找到以下行
... INTERFACES=""
- 替換成以下行
INTERFACES="eth0"
- 保存編輯的文件
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup gksudo gedit /etc/dhcp3/dhcpd.conf
- 找到以下部分
... # option definitions common to all supported networks... option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600; max-lease-time 7200; ...
- 替換成以下幾行
# option definitions common to all supported networks... #option domain-name "example.org"; #option domain-name-servers ns1.example.org, ns2.example.org;
#default-lease-time 600; #max-lease-time 7200;
- 找到一下部分
...
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
...
- 替換成以下幾行
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option domain-name-servers 202.188.0.133, 202.188.1.5;
option domain-name "tm.net.my";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}
- 保存編輯文件
sudo /etc/init.d/dhcp3-server restart
[編輯] 備份Ubuntu 系統
如果你想備份你的ubuntu系統,可以嘗試以下的備份工具
[編輯] Sbackup
- Backup Using Sbackup -使用Sbackup 備份和恢復Ubuntu 系統
[編輯] Dar and Kdar
- Backup Using Dar and Kdar - 使用 Dar and Kdar 備份和恢復 Ubuntu 系統
[編輯] Database Server
[編輯] How to install MYSQL Database Server
- Read #General Notes
- Read #How to add extra repositories
sudo apt-get install mysql-server
- MySQL initially only allows connections from the localhost (127.0.0.1). We'll need to remove that restriction if you wish to make it accessible to everyone on the internet. Open the file /etc/mysql/my.cnf
gksudo gedit /etc/mysql/my.cnf
- Find the line bind-address = 127.0.0.1 and comment it out
... #bind-address = 127.0.0.1 ...
- MySQL comes with no root password as default. This is a huge security risk. You'll need to set one. So that the local computer gets root access as well, you'll need to set a password for that too. The local-machine-name is the name of the computer you're working on. For more information see here
mysqladmin -u root password your-new-password mysqladmin -h root@local-machine-name -u root -p password your-new-password sudo /etc/init.d/mysql restart
[編輯] MySQL Database backup using AutoMySQLBackup
- AutoMySQLBackup is a script to take daily, weekly and monthly backups of your MySQL databases using mysqldump.
- AutoMySQLBackup Script Features
- Backup mutiple MySQL databases with one script. (Now able to backup ALL databases on a server easily. no longer need to specify each database seperately)
- Backup all databases to a single backup file or to a seperate directory and file for each database.
- Automatically compress the backup files to save disk space using either gzip or bzip2 compression.
- Can backup remote MySQL servers to a central server.
- Runs automatically using cron or can be run manually.
- Can e-mail the backup log to any specified e-mail address instead of 「root」. (Great for hosted websites and databases).
- Can email the compressed database backup files to the specified email address.
- Can specify maximun size backup to email.
- Can be set to run PRE and POST backup commands.
- Choose which day of the week to run weekly backups.
- Download from here
- AutoMySQLBackup Requirements
The AutoMySQLBackup script only requires mysqldump (A standard utility provided with the mysql client) and gzip or bzip2 for compression of the backup files. If you would like to have the log emailed to you then you will need to have permission to execute the 「mail」 program. If you want the compressed backup files mailed to you then Mutt must be available on the server. Finally you will need a bash shell and the standard system tools and utilities (all these requirements should be the default on most linux system.)
- What AutoMySQLBackup does
Every day AutoMySQLBackup will run (if setup in /etc/cron.daily) and using mysqldump and gzip will dump your specified databases to the /backups/daily directory, it will rotate daily backups weekly so you should never have more than 7 backups in there..
Every Saturday AutoMySQLBackup will again backup the databases you have chosen but they will be placed into /backups/weekly, these will be rotated every 5 weeks so there should never be more than 5 backups in there..
Every 1st of the month AutoMySQLBackup will create a backup of all databases and place them into /backups/monthly. These will never be rotated so it will be up to you to do your own house keeping. I would suggest taking a copy of this offline every month or two so that if you have a hard drive failure you will be able to restore your database
- AutoMySQLBackup Installation
The install is as simple as editing a few variables in the AutoMySQLBackup file. The full setup is documented in the AutoMySQLBackup script file below the variables section.
- Download automysqlbackup.sh and place it into your /etc/cron.daily directory or your home directory.
- Edit (at least) the following lines :
... USERNAME=dbuser PASSWORD=password DBNAMES=”DB1 DB2 DB3″ ...
- Note:The user must have at least select privileges to the databases and make sure to keep the quotes 」 」 otherwise it won』t work
- Make the file executable :
sudo chmod u+rwx
- Create the following directory
./backups
- That』s it...Now you can run it using the command line 「./automysqlbackup.sh」 or if it is in /etc/cron.daily it will run each day when cron
[編輯] How to install MYSQL Administrator
sudo apt-get install mysql-admin
- Read #How to refresh GNOME panel
- Applications -> System Tools -> MySQL Administrator
[編輯] How to install MySQL Query Browser (SQL Client)
sudo apt-get install mysql-query-browser
- Read #How to refresh GNOME panel
- Applications -> Programming -> MySQL Query Browser
[編輯] How to install Oracle Database XE
- Read #General Notes
- Read #How to add extra repositories
- Read http://www.oracle.com/technology/tech/linux/install/xe-on-kubuntu.html
- Add the following repository to your /etc/apt/sources.list:
deb http://oss.oracle.com/debian unstable main non-free
- Install the software using apt-get
sudo apt-get update sudo apt-get install oracle-xe
- Add your login to the 'dba' group (where your login name is username)
sudo usermod -G dba -a username
- Run the initial configuration
sudo /etc/init.d/oracle-xe configure
You can configure any ports you want as long as they don't interfere with any other services listening on ports. You can choose the defaults by pressing enter instead of entering something in.
[編輯] Apache HTTP Server
[編輯] 怎樣安裝Apache HTTP服務器
- 閱讀 #概述
- Read #How to add extra repositories
sudo apt-get install apache2
[編輯] How to install PHP for Apache HTTP Server
[編輯] How to install PHP4
- Read #General Notes
- Read #How to add extra repositories
- Read #How to install Apache HTTP Server for HTTP (Web) Server service
sudo apt-get install php4 sudo apt-get install libapache2-mod-php4 sudo /etc/init.d/apache2 restart
- To test if php4 installed correctly
gksudo gedit /var/www/testphp.php
- Insert the following line into the new file
<?php phpinfo(); ?>
- Save the edited file
- http://localhost/testphp.php
- Be sure to remove the file afterwards, as it may pose a security risk
PHP4 NO LONGER SUPPORTED IN FEISTY. MARK FOR REMOVAL
[編輯] How to install PHP5
- Read #General Notes
- Read #How to add extra repositories
- Read #How to install Apache HTTP Server for HTTP (Web) Server service
sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo /etc/init.d/apache2 restart
- To test if php5 installed correctly
gksudo gedit /var/www/testphp.php
- (Optional) Insert the following line into the new file
<?php phpinfo(); ?>
- Save the edited file
- http://localhost/testphp.php
- Be sure to remove the file afterwards, as it may pose a security risk
If that didn't work (for example, if your browser prompted you to save the testphp.php page), try these commands:
sudo a2enmod php5 sudo /etc/init.d/apache2 force-reload
Then try opening http://localhost/testphp.php again
- (Optional) Install recommended PHP5 modules
sudo apt-get install php5-xsl php5-gd php-pear
- Restart Apache
sudo /etc/init.d/apache2 restart
Many PHP applications use XSLT technology as well as server-side graphic manipulation (via GD). Also, PEAR provides access to PHP's module repository.
pear help
[編輯] How to install MYSQL for Apache HTTP Server
- Read #General Notes
- Read #How to add extra repositories
- Read #How to install Apache HTTP Server for HTTP (Web) Server service
- Read #How to install PHP for Apache HTTP Server
- Read #How to install MYSQL Database Server
sudo apt-get install libapache2-mod-auth-mysql
- Select either php4-mysql or php5-mysql depending on which version of PHP you installed
sudo apt-get install php<version-number>-mysql sudo aptitude install phpmyadmin
- If you installed phpmyadmin using apt-get and cannot log in, run sudo aptitude purge phpmyadmin and then sudo aptitude install phpmyadmin.
- To get PHP to work with MySQL, open the file (where <version> is either 4 or 5 depending on which PHP you installed)
gksudo gedit /etc/php<version>/apache2/php.ini
- You'll need to uncomment the ";extension=mysql.so" line so that it looks like this
... extension=mysql.so ...
- Save the file then exit
sudo /etc/init.d/apache2 restart
Alternative if the above doesn't work (which it probably won't and this probably will):
sudo apt-get install mysql-server
[編輯] How to install Python for Apache 2
sudo aptitude install python sudo aptitude install libapache2-mod-python sudo gedit /etc/apache2/mods-available/mod_python.conf
add the following lines
AddType application/x-httpd-python .py AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On
save
cd /etc/apache2/mods-enabled sudo ln -s ../mods-available/mod_python.conf mod_python.conf sudo /etc/init.d/apache2 restart
[編輯] How to map URLs to folders outside /var/www/
gksudo gedit /etc/apache2/conf.d/alias
- Insert the following lines into the new file
Alias /URL-path /location_of_folder/
<Directory /location_of_folder/> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
- Save the edited file
sudo /etc/init.d/apache2 restart
- When you get "403 - Permission denied", you might try:
chmod o+x /location_of_folder/
- If that doens't work, the following might help:
chmod o+r,o+x /location_of_folder/
[編輯] 怎樣更改Apache HTTP 服務器的默認端口
- 閱讀 #概述
- 閱讀 #怎樣安裝Apache HTTP 服務器
- 舉例 : 假定將要設置的新端口是78
sudo cp /etc/apache2/ports.conf /etc/apache2/ports.conf_backup gksudo gedit /etc/apache2/ports.conf
- 找到下面這一行
Listen 80
- 替換成以下這行
Listen 78
- 保存編輯的文件
sudo /etc/init.d/apache2 restart
[編輯] How to parse RSS into PHP for Apache HTTP Server
- Read #General Notes
- Read #How to install Apache HTTP Server for HTTP (Web) Server service
- Read #How to install PHP for Apache HTTP Server
- e.g. Assumed that RSS is DistroWatch.com - News
wget -c http://easylinux.info/uploads/magpierss-0.71.1.tar.gz sudo mkdir /var/www/feeds sudo tar zxvf magpierss-0.71.1.tar.gz -C /var/www/feeds/ sudo mv /var/www/feeds/magpierss-0.71.1/* /var/www/feeds/ sudo rm -fr /var/www/feeds/magpierss-0.71.1/ sudo chown -R www-data:root /var/www/feeds/ gksudo gedit /var/www/feeds/index.php
- Insert the following lines into the new file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>DistroWatch.com - News</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
/*<![CDATA[*/
/*
DEFAULT TAG STYLES
*/
body {
background: #ffffff;
margin-left: 20px;
font-family: bitstream vera sans,sans-serif;
font-size: 9pt;
}
h1 {
font-family: luxi sans,sans-serif;
font-size: 15pt;
}
/*]]>*/
</style>
</head>
<body>
<?php
require_once 'rss_fetch.inc';
error_reporting(E_ERROR);
$url = 'http://distrowatch.com/news/dw.xml';
$rss = fetch_rss($url);
if ($rss) {
echo "<h1>";
echo "<a href=$url>", $rss->channel[title], "</a><br/>";
echo "</h1>";
foreach ($rss->items as $item ) {
$url = $item[link];
$title = $item[title];
$description = $item[description];
echo "<li>";
echo "<b>Topic:</b> <a href=$url><b><u>$title</u></b></a><br/><br/>";
echo "$description<br/><br/>";
echo "</li>";
}
}
else {
echo "<a href=$url>", $url, "</a> - Server Down!<br/>";
}
?>
</body>
</html>
- Save the edited file
- http://localhost/feeds/index.php
[編輯] Troubleshooting Feisty Fawn
- Fix broken Ubuntu Feisty Fawn This is simple Procedure how to fix broken Ubuntu Feisty
[編輯] FTP Server
[編輯] 怎樣安裝文件傳輸的FTP服務器
- Read #General Notes
- Read #How to add extra repositories
sudo apt-get install proftpd
[編輯] How to configure FTP user to be "jailed" (chrooted) into their home directory
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- Find this section
... DenyFilter \*.*/ ...
- Add the following line below it
DefaultRoot ~
- Save the edited file
sudo /etc/init.d/proftpd restart
[編輯] 怎樣配置FTP服務器使得匿名訪問的用戶只有隻讀權限
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- 在文檔末尾添加以下代碼
<Anonymous ~ftp> User ftp Group nogroup UserAlias anonymous ftp DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off MaxClients 10 DisplayLogin welcome.msg DisplayFirstChdir .message <Directory *> <Limit WRITE> DenyAll </Limit> </Directory> </Anonymous>
- 保存文件
sudo /etc/init.d/proftpd restart
[編輯] 怎麼配置FTP服務器允許匿名用戶有讀寫權限
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- 在文檔末尾添加以下代碼
<Anonymous ~ftp> User ftp Group nogroup UserAlias anonymous ftp DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off MaxClients 10 DisplayLogin welcome.msg DisplayFirstChdir .message </Anonymous>
- 保存編輯的文件
sudo /etc/init.d/proftpd restart
[編輯] 怎樣將匿名用戶所訪問的文件夾映射到 /home/ftp/ 目錄之外
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- 添加如下代碼
<Anonymous /location_of_folder/> User ftp Group nogroup UserAlias anonymous ftp DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off MaxClients 10 DisplayLogin welcome.msg DisplayFirstChdir .message <Directory *> <Limit WRITE> DenyAll </Limit> </Directory> </Anonymous>
- 保存編輯的文件
sudo /etc/init.d/proftpd restart
[編輯] 怎樣更改FTP服務器的默認端口
- 舉例. 假定將要設置的新端口是77
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- 找到以下這行
Port 21
- 替換成以下這行
Port 77
- 保存編輯的文件
sudo /etc/init.d/proftpd restart
[編輯] How to ftp into remote Ubuntu machine via Windows machine
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed FTP Server service
- Read #How to install FTP Server for File Transfer service
- Download FileZilla: Here
- Paste the FTP url to the Windows Explorer Address Bar
- Windows Explorer is Windows' "File Manager," Goto "My Computer"
- The Address Bar may be hidden, right-click the toolbar area and make sure "Lock toolbars" is not selected, rearrange the toolbars so you can paste the address
- FTP addresses take the form ftp://[username]:[password]@[hostname].[domain].[tld]:[portnumber]/[directory]/
- the username and password are optional, if not given and the server is not configured for anonymous access then Windows will request them
- Don't tell Windows to save the password, because there's no obvious way to edit this record
- If a directory on the FTP server allows uploads, you can drag-and-drop or copy-paste files or folders to it just like Windows Explorer
[編輯] How to configure your NAT/router/gateway/firewall for FTP server
- Read #General Notes
- e.g. Assumed that remote Ubuntu machine have installed FTP Server service
- Read #How to install FTP Server for File Transfer service
- Configure your FTP server with a limited passive port range so that TCP range can be opened in the incoming firewall
- For proftpd, this is parameter "PassivePorts" in /etc/proftpd/proftpd.conf
- For security, it's a good idea to operate the server at a non-standard port, see #How to change the default port number for FTP Server
- For proftpd, this is parameter "Port" in /etc/proftpd/proftpd.conf
- NAT/router/gateway/firewall devices or software must be configured to allow the configured incoming TCP ports.
[編輯] Personal Apt Repository
- Read #General Notes
[編輯] Setting Up Repository
- Read #How to add extra repositories
- Read #How to install Apache HTTP Server for HTTP (Web) Server service
Note: This type of repository is known as a Trivial Repository.
This type of repository does not fully comply with Debian standards, so should not be used commercially. However, it is ideal for home or personal use.
- Install Package Tools
sudo apt-get install dpkg-dev
- Create Repos on Filesystem
mkdir /somewhere/apt mkdir /somewhere/apt/archives mkdir /somewhere/apt/archives/binary
- (Optional) Copy existing local APT cache to your Repos
cp -v /var/cache/apt/archives/*.deb /somewhere/apt/archives/binary/
- Create Package Lists for Repos
cd /somewhere/apt/archives dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
- Publish Repos with Apache
cd /var/www sudo ln -s /somewhere/apt/archives apt
- Add Repos to Sources (on all PCs) to /etc/apt/sources.list
Open /etc/apt/sources.list
sudo gedit /etc/apt/sources.list
Add the following to the bottom of the file:
# My Repos deb http://localhost/apt binary/
- Update APT Database
sudo apt-get update
[編輯] Updating Repository
Simply copy or download ".deb" files to /somewhere/apt/archives/binary/ and then update the Packages list:
cd /somewhere/apt/archives dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
[編輯] Streaming Media Server
[編輯] How to install GNUMP3d for Streaming Media Server service
- Read #General Notes
- Read #How to add extra repositories
- Read #How to install Apache HTTP Server for HTTP (Web) Server service
- e.g. /var/music/ is the directory containing multimedia files
sudo apt-get install gnump3d
[編輯] How to change the default directory containing multimedia files for GNUMP3d
- e.g. Assumed that new directory containing multimedia files is /home/music/
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup gksudo gedit /etc/gnump3d/gnump3d.conf
- Find this line
root = /var/music
- Replace with the following line
root = /home/music
- Find this line
user = gnump3d
- Replace with the following line
user = root
- Save the edited file
sudo /etc/init.d/gnump3d restart
[編輯] How to change the default port number for GNUMP3d
- e.g. Assumed that new port number is 7878
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup gksudo gedit /etc/gnump3d/gnump3d.conf
- Find this line
port = 8888
- Replace with the following line
port = 7878
- Save the edited file
sudo /etc/init.d/gnump3d restart
[編輯] Groupware (Email/Calendaring)
[編輯] How to install Meldware Communication Suite
- Read #General Notes
- Read #How_to_install_Java_Development_Kit_.28JDK.29_v5.0
- Meldware Communication Suite provides a multi-platform alternative to popular groupware like Exchange or Lotus Notes including Email(SMTP/POP/IMAP) and Calendaring(iCAL,WCAP). It depends on Java and, optionally, for the webmail/webcal client, Flash.
sudo aptitude install sun-java5-jdk sudo update-java-alternatives -s java-1.5.0-sun
- Download the jar file for a recent milestone or build here
- Open a new terminal (capture java path updates)
- change directory to your download directory
- replace below filename with correct version based on your download
sudo java -jar buni-meldware-20070225.jar
- A series of configuration questions are asked, for destination directory specify /opt/mcs
sudo cp /etc/init.d/skeleton /etc/init.d/meldware-cs sudo vi /etc/init.d/meldware-cs
- Replace the value in the line beginning with PATH with "/usr/sbin:/usr/bin:/sbin:/bin:/opt/mcs/bin" excluding quotes (assuming you specified /opt/mcs as the destination directory to the installer)
- Replace the value in the line beginning with DESC with "Meldware Communication Suite" including quotes
- Replace the value in the line beginning with NAME with "run.sh" excluding quotes
- Replace the value in the line beginning with DAEMON with "/opt/mcs/bin/$NAME" excluding quotes
- Replace the value in the line beginning with DAEMON_ARGS with "-c meldware" excluding quotes
- Replace the value in the line beginning with SCRIPTNAME with "/etc/init.d/meldware-cs" excluding quotes
- save (ESC):wq
sudo chmod 755 /etc/init.d/meldware-cs sudo ln -s /etc/init.d/meldware-cs /etc/rc3.d/S21meldware-cs sudo ln -s /etc/init.d/meldware-cs /etc/rc6.d/K21meldware-cs sudo ln -s /etc/init.d/meldware-cs /etc/rc4.d/S21meldware-cs
- start MCS
sudo /etc/init.d/meldware-cs restart
- Additional documentation is available here
[編輯] Image Gallery Server
- For a comparison between Gallery1 and Gallery2 see here
[編輯] Gallery1
[編輯] How to install Gallery1 for Image Gallery Server service
- Read #General Notes
- Read #How to add extra repositories
- Read #How to install Apache HTTP Server for HTTP (Web) Server service
- Read #How to install PHP for Apache HTTP Server
sudo apt-get install gallery (when prompted to restart Apache, choose No or Cancel) sudo apt-get install imagemagick sudo apt-get install jhead sudo apt-get install libjpeg-progs sudo /etc/init.d/apache2 restart sudo sh /usr/share/gallery/configure.sh
- http://localhost/gallery/setup/index.php
- Gallery Configuration
Gallery Configuration Wizard: Step 1 Next Step ->
Gallery Configuration Wizard: Step 2 General settings Tab -> Admin password: Specify the password Locations and URLs Tab -> Album directory: /var/www/albums/ Temporary directory: /tmp/ Gallery URL: http://localhost/gallery Albums URL: http://localhost/albums Next Step -->
Gallery Configuration Wizard: Step 3 Next Step -->
Gallery Configuration Wizard: Step 4 Save Config ->
[編輯] How to configure Gallery1 to be accessible via Internet (Hostname or fix IP) or LAN (fix IP)
- e.g. Assumed that network and internet connections have been configured properly
- Internet (Hostname or fix IP) or LAN (fix IP): http://www.url.com
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup gksudo gedit /etc/gallery/config.php
- Find this section
... $gallery->app->photoAlbumURL = "http://localhost/gallery"; $gallery->app->albumDirURL = "http://localhost/albums"; ...
- Replace with the following lines
$gallery->app->photoAlbumURL = "http://www.url.com/gallery"; $gallery->app->albumDirURL = "http://www.url.com/albums";
- Save the edited file
- http://www.url.com/gallery/albums.php
[編輯] How to configure Gallery1 to be accessible via LAN (dynamic IP)
- e.g. Assumed that network connections have been configured properly
- LAN (dynamic IP): 192.168.0.1
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup gksudo gedit /etc/gallery/config.php
- Find this section
... $gallery->app->photoAlbumURL = "http://localhost/gallery"; $gallery->app->albumDirURL = "http://localhost/albums"; ...
- Replace with the following lines
$gallery->app->photoAlbumURL = "/gallery"; $gallery->app->albumDirURL = "/albums";
- Save the edited file
- http://192.168.0.1/gallery/albums.php
[編輯] How to backup/restore Gallery1 data
- Read #General Notes
- To backup Gallery data
sudo tar zcvf gallery.tgz /var/www/albums/ /etc/gallery/
- To restore Gallery data
sudo tar zxvf gallery.tgz -C /
[編輯] Gallery2
[編輯] How to install Gallery2
[編輯] How to configure Gallery2
[編輯] How to install Subversion version control server (with Apache support)
- Read #General Notes
- Install Subversion and Apache 2 Module
sudo aptitude install subversion libapache2-svn
- Enable Subversion/DAV Apache 2 Module
sudo a2enmod dav_svn
- Configure Apache 2
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
Edit the file to look something like this:
<Location /svn> DAV svn SVNPath /home/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </Location>
- Create Subversion Repository
sudo mkdir /home/svn sudo svnadmin create /home/svn
- Give Apache 2 Permissions to Repository
sudo chown -R www-data /home/svn
- Create Repository User
Replace 'username' with your username
sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd username
Enter password when prompted.
- Restart Apache 2
sudo /etc/init.d/apache2 restart
[編輯] How to install Subversion version control server (svnserve)
- Read #General Notes
- Install Subversion and Internet services daemon
sudo apt-get install subversion xinetd
- Create user that will own the repositories
sudo adduser --system --no-create-home --home /var/svn --group --disabled-login svn
- Create directory that will hold the repositories
sudo mkdir /var/svn sudo chown -R svn:svn /var/svn
- Create file /etc/xinetd.d/svnserve with the following content
service svn
{
port = 3690
socket_type = stream
protocol = tcp
wait = no
user = svn
server = /usr/bin/svnserve
server_args = -i -r /var/svn
}
- Restart xinetd
sudo /etc/init.d/xinetd restart
- Create the first repository
sudo -u svn svnadmin create /var/svn/testrepo
- It should be possible to check out the repository and work on it
svn co svn://localhost/testrepo
[編輯] Troubleshooting
[編輯] How to disable system time/date from being reset to UTC (GMT)
- Read #General Notes
sudo cp /etc/default/rcS /etc/default/rcS_backup gksudo gedit /etc/default/rcS
- Find this line
... UTC=yes ...
- Replace with the following line
UTC=no
- Save the edited file
- System -> Administration -> Time and Date
Set the correct time/date
sudo /etc/init.d/hwclock.sh restart
[編輯] How to configure sound to work properly in GNOME
- Read #General Notes
- Read #How to add extra repositories
sudo killall esd sudo cp /etc/esound/esd.conf /etc/esound/esd.conf_backup gksudo gedit /etc/esound/esd.conf
- Find this section
... auto_spawn=0 spawn_options=-terminate -nobeeps -as 5 ...
- Replace with the following lines
auto_spawn=1 spawn_options=-terminate -nobeeps -as 2 -d default
- Save the edited file
sudo apt-get install libesd-alsa0 gksudo gedit /etc/asound.conf
- Insert the following lines into the new file
pcm.card0 {
type hw
card 0
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1025
slave {
pcm "hw:0,0"
period_time 0
period_size 2048
buffer_size 32768
rate 48000
}
bindings {
0 0
1 1
}
}
- Save the edited file
sudo ln -fs /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
System -> Preferences -> Sound Sound preferences
General Tab -> Sounds for events (Un-Checked)
- Save and close all opened applications, Reboot computer
[編輯] How to forcefully empty Trash in GNOME
- Read #General Notes
sudo rm -fr $HOME/.Trash/
[編輯] How to remove duplicate menu/menu items in GNOME
- Read #General Notes
- Type "rm -f $HOME/.config/menus/applications.menu" in a terminal window
- Read Ubuntu:Edgy/TipsAndTricks#How to refresh GNOME panel
[編輯] How to refresh Places menu in GNOME (if mounts to /media/ in /etc/fstab does not show up)
- Read #General Notes
sudo /etc/init.d/dbus restart
[編輯] How to consume static (not dhcp) wireless LAN (WLAN) connection (KDE)
- I assume you have successfully consumed WLAN connection in Windows
- To enable the network device please follow the following steps
- Go to K-menu -> System Settings -> Network Settings
- Enable Administrator mode
- Select Network Interfaces tab and the wireless interface (usually ath0) to configure
- Click Configure Interface...
- Choose Manual or Automatic. Choose Manual
- Fill the preferred IP address to identify your computer and the netmask. Choose to activate when computer starts
- Click Advanced Settings to for more properties
- Select Routes tab and fill the gateway IP address
- Make sure you choose the correct device in the right dropdown (e.g. ath0)
- Click apply to commit all changes
- To choose wireless connection please follow the following steps
- Go to K-menu -> Internet -> Wireless Assistant
- Right click on preferred connection ssid
- Choose and complete fields for Manual connection
- Click Ok
- Create connection configuration
gksudo gedit /etc/wpa_supplicant.conf
- Insert the following lines into the new file
network={
ssid="YOUR_PREFERRED_CONNECTION_SSID"
scan_ssid=1
proto=WPA
key_mgmt=WPA-PSK
psk="STRING_TO_GENERATE_PASSWORD"
#psk=123456789 #you have option to use connection key instead of connection password
}
- Save the edited file
- Create script to easily activate connection
gksudo gedit /etc/init.d/wifi_wpa.sh
- Insert the following lines into the new file
#! /bin/sh # wifi: wpa_supplicant init echo " * [Wifi]: Enabling WPA supplicant..." if [ -x /sbin/wpa_supplicant ]; then /sbin/wpa_supplicant -B -i ath0 -c /etc/wpa_supplicant.conf -D madwifi -w fi exit 0
- Save the edited file
- Make sure both file readable and executable
sudo chmod +r /etc/wpa_supplicant.conf sudo chmod +x /etc/init.d/wifi_wpa.sh
- make wireless connection automaticaly starts when computer starts
sudo ln -s /etc/init.d/wifi_wpa.sh /etc/rcS.d/S40netwifiwpa
- Close all opened applications, Reboot computer
[編輯] How to get 1400x1050 resolution working
[編輯] Upgrading Ubuntu
[編輯] How to upgrade from Feisty Fawn -> Gutsy Gibbons
- Ubuntu Feisty 7.04 has just been released and for now there are no Gutsy Gibbons repositories, enjoy Feisty!
