搞不懂的ubutnu

拿ubuntu的source.list安裝一些東西,結果debian不能上網了.......
好像root端被殺了.............. 
先不談拿ubuntu的apt來玩debian這件事 
我了解到一件事
原來main之前的單字表示版本>"< 所以說要找不同版本的東西,就改source.list就可以了
10.4
deb http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-backports main multiverse restricted universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-backports universe main multiverse restricted
9.10

# 國家高速網路與計算中心
deb ftp://os.nchc.org.tw/ubuntu karmic-updates main restricted universe multiverse
deb ftp://os.nchc.org.tw/ubuntu karmic main universe multiverse restricted
deb ftp://os.nchc.org.tw/ubuntu karmic-backports main universe multiverse restricted
deb ftp://os.nchc.org.tw/ubuntu karmic-proposed main universe multiverse restricted
deb ftp://os.nchc.org.tw/ubuntu karmic-security main restricted universe multiverse
deb ftp://os.nchc.org.tw/ubuntu karmic-proposed main universe multiverse restricted
deb ftp://os.nchc.org.tw/ubuntu karmic-security mai
 
9.04 
deb http://gb.archive.ubuntu.com/ubuntu/ jaunty universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ jaunty universe
deb http://gb.archive.ubuntu.com/ubuntu/ jaunty-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ jaunty-updates universe
 

讓我的"大"A6耳機有聲音

看來許多華碩A系列產品都有這個問題,耳機沒有聲音。
目前測試 debain505 i386
#atp-get install alsa-utils
把以下文字
options snd-hda-intel model=z71v position_fix=1
貼到:
/etc/modprobe.d/alsa-base
看論壇ubuntu要貼到
/etc/modprobe.d/sound

重新開機,搞定!

debian 6
貼到
/etc/modprobe.d/alsa-base
/etc/modprobe.d/alsa-base.conf
/etc/modprobe.d/sound

reboot

linux 常用的播放器

兩個好用的linux音樂播放器

Amarok

Exaile

兩個都非常不錯,而且apt就有了,方便又好用的東西

另外下面留給.......影音播放器>"< 目前還找不到比較好又方便的播放器 不過目前用的Mplayer,debain原有的播放器 想看rmvb可以參考以下網頁

以下內容取自 How to play rmvb in mplayer

This tutorial will take you step by step through installing all of the software necessary to play rmvb (RealMedia Variable Bitrate) files in Ubuntu Linux.
Though the steps and screenshots are specific to Ubuntu, they will likely be similar for other versions of Linux. With that said, be sure to read the MPlayer README file if you’re not using Ubuntu. Similar to some of the other tutorials on Simplehelp, this is almost certainly not the only way to play .rmvb files in Ubuntu, but it’s the easiest way I could find. If you know of a easier method, by all means please feel free to leave a comment.
  1. The first step in playing .rmvb files in Ubuntu is to use the Synaptic Package Manager to install MPlayer. When you mark MPlayer for installation, you’ll be prompted to install additional software packages (if they’re not already installed).
  2. play rmvb files in ubuntu linux click to enlarge
  3. After MPlayer has been installed, exit out of the Synaptic Package Manager and visit the MPlayer binary codec download page. Download the codec package for your platform (for example, if you’re using a 32bit Intel or AMD processor, download the Linux x86 package). Save the file to your desktop (or home folder). Once the download has completed, double-click that file. Select the folder to uncompress, and click the Extract button.
    play rmvb files in ubuntu linux
    click to enlarge

  4. Choose a location to extract the files (your desktop is ideal) and again click Extract.
  5. play rmvb files in ubuntu linux click to enlarge
  6. Make sure the files extracted correctly. They’ll be in a folder titled essential-date.
  7. play rmvb files in ubuntu linux
  8. Open up a Terminal by selecting Applications -> Accessories -> Terminal.
  9. play rmvb files in ubuntu linux
  10. Enter the following commands (and your password when prompted):
    cd Desktop
    cd essential-date
    sudo mkdir /usr/lib/codecs
    sudo cp * /usr/lib/codecs
  11. play rmvb files in ubuntu linux click to enlarge
  12. NOTE: you may need to install libstdc++5 to get .rmvb files to play. Even though it might not be necessary for you, it can’t hurt to install (the package isn’t very big). Run the command: sudo apt-get install libstdc++5 in a Terminal, or use Synaptic and search for libstdc++5. Thanks to everyone who commented (see comments below) for the tip.
  13. Launch MPLayer by selecting Applications -> Sound & Video -> MPlayer Movie Player. Right-click in the Mplayer – Video window and select Preferences from the menu.
  14. play rmvb files in ubuntu linux
  15. Select the Video tab and change the Available drivers: to x11 X11 (XImage/Shm).
  16. play rmvb files in ubuntu linux click to enlarge
  17. Select the Codecs & demuxer tab and change the Video codec family: to RealVideo decoder and the Audio codec family: to FFmpeg/libavcodec audio decoders. When you’re done, click OK and close down MPlayer.
  18. play rmvb files in ubuntu linux click to enlarge
  19. Locate one of your .rmvb files, right-click it and select Properties.
  20. play rmvb files in ubuntu linux
  21. Select the Open With tab and change whatever the default is to MPlayer Movie Player. Click Close.
  22. play rmvb files in ubuntu linux click to enlarge
  23. Double-click any of your .rmvb files and they should open up in MPlayer and start playing.
  24. play rmvb files in ubuntu linux

linux 掛載光碟

#apt-get install fuseiso

#mkdir DVDISO //創造任意一個資料夾

#fuseiso DVD.iso DVDISO //掛載到DVDISO

#cd DVDISO

#fusermount -u DVDISO //卸載

c語言常用IO參數

%d %i 十進位整數
%u unsigned 十進位整數
%x unsigned 16進位整數,小寫表示(a-f)
%X unsigned 16進位整數,大寫表示(A-F)
%o unsigned 8進位整數
以上加-和數字表示左對齊最少幾位,如%-9d表示左切齊最少印9位
以上加+和數字表示右對齊最少幾位,如%+9d表示右切齊最少印9位,不足處補空白
以上加+和0開頭的數字表示右對齊最少幾位,不足補0,如%+09d表示右切齊最少印9位,不足處補0
%ld 以十進位印出long
%lld 以十進位印出long long
%f浮點數float
%e %E科學表示法浮點數double,%e小寫 %E大寫
%g %G依照double的數值自動選擇以%f或%e格式印出
以上加-和具有小數點的數字表示左對齊最少幾位,如%-9.2f表示左切齊最少印9位,其中小數點以下2位
以上加+和具有小數點的數字表示右對齊最少幾位,如%=9.2f表示右切齊最少印9位,其中小數點以下2位
%c unsigned char
%s string(array of char terminated by 0)
%p pointer to void
%% 印出%

用C來寫複數

GNU C99以前通常是用結構(struct)來表示,簡單的例子如下
------------------------------------------------------ 
#include < stdio.h >

struct my_complex {
double real;
double imag;
};
int main(void){
struct my_complex z = {42.0, 42.0};

printf("z = %f + %fI\n",x.real, x.imag);

return 0;
}
-----------------------------------------------------
C99提供了一個方便的表示方法,在complex.h裡面
#include < stdio.h >
#include < complex.h >
int main (void){
complex double z = 42.0 + 42.0*I;

printf("z = %f + %fI\n", creal(z), cimag(z));

return 0;
}
----------------------------------------------------- 
— Function: double creal (complex double z) 
— Function: float crealf (complex float z) 
— Function: long double creall (complex long double z)These functions return the real part of the complex number z.
— Function: double cimag (complex double z) 
— Function: float cimagf (complex float z) 
— Function: long double cimagl (complex long double z)These functions return the imaginary part of the complex number z.
 
詳細的內容可以參考:
http://www.gnu.org/s/libc/manual/html_node/Complex-Numbers.html#Complex-Numbers 

apt 常用指令

本文取自:http://plog.longwin.com.tw/my_note-unix/2005/05/01/use_apt

伺服器列表
/etc/apt/source.list

系統升級相關:
  • apt-get upgrade => 軟體升級
  • apt-get dist-upgrade => 系統升級
  • 更多詳細可見: SoftwareUpgrading
=======
aptitude
=======
1.aptitude install套件名稱
單純安裝指定套件

其他的可以參考apt-get
=======
apt-get
=======
1.apt-get update
更新套件資訊,要升級之前,最好都先執行一次本指令和 Server 端的資訊同步一下

2.apt-get check
檢查你系統上套件的相依性狀況

3.apt-get dist-upgrade 和 apt-get upgrade
執行整個升級動作,建議用 apt-get dist-upgrade 比較好

4.apt-get install 套件名稱
安裝某一個套件及其相關的套件

5.apt-get remove 套件名稱 (含設定檔等完整移除: apt-get --purge remove 套件名稱)
移除某套件,和 rpm -e 功能一樣,同時還會幫您把相關的套件一併移除

6.apt-get source 套件名稱
抓回 source rpm
例: apt-get source --compile zhcon
抓回 source rpm 並編譯成 binary rpm
--compile 參數就如同 rpm -ba 一般

7.apt-get clean
刪除下載回來的檔案
=========
apt-cache
=========
1.apt-cache showpkg
顯示套件資訊
例: apt-cache showpkg zhcon

2.apt-cache stats
顯示相關的統計資訊

3.apt-cache dump
顥示 cache 中每個套件的簡短資訊

4.apt-cache unmet
檢查所有未符合相依性的相關資訊

5.apt-cache show
顯示套件資訊,同 rpm -qi 一般

6.apt-cache search
尋找檔案  例: apt-cache search zhcon

7.apt-cache depends
顯示套件的相依性  例: apt-cache depends zhcon

8.apt-cache pkgnames
尋找符合的套件名稱  例: $ apt-cache pkgnames openss
openssh-askpass
openssl096
openssl-perl
openssl095a
openssl-python
openssh-clients
openssl-devel
openssh-askpass-gnome
openssh
openssl
openssh-serve


==========
apt-config
==========
1.apt-config dump
顯示目前的設定狀態

參考
http://www.linux.org.tw/~candyz/APT-HOWTO_CLE.txt
http://www.debian.org/doc/manuals/apt-howto/ 
其它備註
  • 移除多餘套件(Library): apt-get remove --purge `deborphan`

------------------------------------------------------------------
apt-get install package --reinstall 重新安裝套件
apt-get -f install 修復安裝 "-f = --fix-missing"
apt-cache rdepends package 是查看該套件被哪些套件依賴
apt-get build-dep package 安裝相關的編譯環境
apt-get source package 下載該套件的原始碼
apt-get clean && apt-get autoclean 清理沒用的套件
apt-get check 檢查是否有損壞的相依性
------------------------------------------------------------------
aptitude
套件管理程式,不喜歡打上述指令可以用這個。