2008年5月27日 星期二
MSNTBUP.exe
MSNTBUP.exe是必爾該死微軟的Live search toolbar自動更新檢查程式, 不過有可能該程式會被木馬或病毒給感染.
禁止他運行:
開始-運行-gpedit.msc,打開組策略,用戶配置下面,展開管理模版,雙擊系統文件夾,在右面的窗口中,有一項"不要運行指定的windows應用程序",雙擊,然後選擇-已啟用-顯示,把要禁止運行的程序添進去,比如MSNTBUP.exe
實作解決svchost狂吃CPU資源~(感謝JAS . Taipei 分享)
我的家用筆電是七八年前買的Compaq,Intell P4-1G的CPU上跑的是Win2K的老舊系統,然而,使用起來的感覺,卻經常比目前公司使用的Intell P4-2.8G CPU + XP快且順暢得多。
由於公司電腦使用單純,幾乎可確定沒有中毒或被駭的可能,然而為求慎重起見,還是仔細檢查了一下。一開始發現是svchost.exe在作祟,正常開機操作使用情況下,開機後每隔一小段時間就跳出來狂吃CPU資源,風扇聲大作而執行中的應用軟體則龜速進展。每次svchost發作,吃個70%~80%是很稀鬆平常的事,有時過份起來甚至可以吃到97%以上,甚至滿百,幾乎是瀕臨當機無法做正事。
由於XP內建的工作管理員所提供的效能資訊極有限,所以到微軟官網下載了Process Explorer for Windows v10.21來檢查svchost.exe到底都在忙什麼。下載解壓並執行Process Explorer之後,視窗上可一目瞭然發現原來是Windwos Update讓它忙得不可開交,每隔一段時間就Automatic Updates來狂吃CPU資源。
這種現象當然不是XP正常運作時會出現的,所以需要動點手腳幫已經後天失調的相關設定重新調校一下,步驟分為三大項整理如下:
(一)確認兩項系統服務。
(1)Automatic Updates
依序選取左下的「開始」->「執行」,輸入「services.msc」並按「確定」。(這個步驟主要是叫出服務視窗)
找到「Automatic Updates」這項服務,連點二下滑鼠左鍵開啟內容設定。
點選「登入」這個頁籤,先確認目前登入身分為「本機系統帳戶(L)」,而且不勾選底下的「允許服務與桌面互動(W)」。接著再確認「Automatic Updates」這項服務已在目前的「硬體設定檔」中被啟用,若未啟用,則按下「啟用」鍵。
(2)Background Intelligent Transfer Service (BITS)
在相同服務視窗找到「Background Intelligent Transfer Service」這項服務,連點二下滑鼠左鍵開啟內容設定。
點選「登入」這個頁籤,先確認目前登入身分為「本機系統帳戶(L)」,而且不勾選底下的「允許服務與桌面互動(W)」。接著再確認「Background Intelligent Transfer Service」這項服務已在目前的「硬體設定檔」中被啟用,若未啟用,則按下「啟用」鍵。
(二)修復 Windwos Update 執行元件。
依序選取左下的「開始」->「執行」,輸入「REGSVR32 WUAPI.DLL」並按「確定」。接著視窗會跳出「DllRegisterServer 在 WUAPI.DLL 成功」的訊息,按「確定」完成動作並關閉視窗。接著,依照上述步驟逐一執行以下Windwos Update 元件:
REGSVR32 WUAUENG.DLL
REGSVR32 WUAUENG1.DLL
REGSVR32 ATL.DLL
REGSVR32 WUCLTUI.DLL
REGSVR32 WUPS.DLL
REGSVR32 WUPS2.DLL
REGSVR32 WUWEB.DLL
(三)清除舊有 Windows Update 暫存目錄。
依序選取左下的「開始」->「執行」,輸入「cmd」並按「確定」以開啟命令提示視窗。
在命令提示視窗裡的命令提示字元右方輸入指令「net stop WuAuServ」暫停Automatic Updates服務。
依序選取左下的「開始」->「執行」,輸入「%windir%」並按「確定」以開啟系統資料夾。
在系統資料夾裡找到「SoftwareDistribution」這個目錄,並且把它更名為「SDbak」。
依序選取左下的「開始」->「執行」,輸入「cmd」並按「確定」以開啟命令提示視窗。
在命令提示視窗裡的命令提示字元右方輸入指令「net start WuAuServ」重新啟動Automatic Updates服務。
這樣整過一次骨之後,svchost.exe就沒再出來亂了,果然是欠修理。
2008年5月26日 星期一
愛我~歌詞
作詞:姚謙 作曲:游鴻明 編曲:屠穎
你的手指你的眸 你的眼神你的口
我總忍不住徘徊逗留 怕一生愛都挪不走
你的笑容你的愁 你的心情你的夢
我總忍不住窺探追究 在生命的旅途中我想隨你甘甜與共
愛我 因為你我變的好富有 擁你懷中被愛佔有
那種滿足是一切都比不過
愛我 沒有你我變的好貧窮 在人世中少你左右
我想我連什麼價值也沒有 好好愛我
尤其在人海沙漠 人的心愈來愈難懂
在我心中 有個你寄托
12.愛我(Yes版)
作詞:姚謙 作曲:游鴻明 編曲:陳飛午 男聲:林志炫
(女)你的手指你的眸 你的喉結你的口
我總忍不住徘徊逗留 怕一生愛都挪不走
(男)妳的笑容妳的愁 妳的心情妳的夢 我總忍不住窺探追究
在生命的旅途中 我想隨妳甘甜與共
(女)愛我 因為你我變得好富有
在你懷中被愛佔有 那種滿足是一切都比不過
(男)愛我 沒有妳我變得好貧窮
在人世中少妳左右 我想我連什麼價值也沒有
(合)好好愛我
(男)妳的過去妳的憂
(女)你的未來你的路
(合)我都很願意分享共有 在每一個晨昏中 我亦步亦趨陪你走
(女)愛我 因為你我變得好富有
轉載來自 ※Mojim.com 魔鏡歌詞網
在你懷中被愛佔有 那種滿足是一切都比不過
(男)愛我 沒有妳我變得好貧窮
在人世中少妳左右 我想我連什麼價值也沒有
(合)好好愛我
(男)尤其在人海沙漠
(女)人的心越來越難懂
(男)至少心中有個你寄託
(女)愛我 因為你我變得好富有
在你懷中被愛佔有 那種滿足是一切都比不過
(男)愛我 沒有妳我變得好貧窮
在人世中少妳左右 我想我連什麼價值也沒有
(合)好好愛我
2008年5月22日 星期四
file I/O
ifstream data_file;
if(data_file.bad()){
exit(8);
}
data_file.open("numbers.dat");
for(i=0; i<100; ++i)
data_file >> data_array[i];
data_file.close();
ps:
istream &getline(char *buffer, int len, char delim = '\n')
file output
ofstream out_file("out.dat", ios::app);
out_file << "abc";
out_file.close();
<< 會收集到buff,然後滿了才印
如果要強制印出,要用flush
out_file << "abc" << flush
開啟無緩衝的檔案
file_descriptor = open(name, flags); //現存檔案
file_descriptor = open(name, flags, mode); //新檔案
read_size = read(file_descriptor, buffer, size);
write_size = write(file_descriptor, buffer, size);
main ( int argc, char *argv[ ] ) { }
argc = 5
argv[0] = "this"
argv[1] = "is"
argv[2] = "a"
argv[3] = "test"
位元欄位 unsigned int list:1
sturct itdm{
unsigned int list:1; //1 bit
unsigned int seen:1; //1 bit
unsigned int number:14; //14 bits
};
2008年5月21日 星期三
更改提示字元
PS1='\u@\h:\w # '
\d :代表日期,格式為 Weekday Month Date,例如 "Mon Aug 1"
\H :完整的主機名稱。舉例來說,鳥哥的練習機 linux.dmtsai.tw ,那麼這個主機名稱就是 linux.dmtsai.tw
\h :僅取主機名稱的第一個名字。以上述來講,就是 linux 而已, .dmtsai.tw 被省略。
\t :顯示時間,為 24 小時格式,如: HH:MM:SS
\T :顯示時間,12 小時的時間格式!
\A :顯示時間,24 小時格式, HH:MM
\u :目前使用者的帳號名稱;
\v :BASH 的版本資訊;
\w :完整的工作目錄名稱。家目錄會以 ~ 取代;
\W :利用 basename 取得工作目錄名稱,所以僅會列出最後一個目錄名。
\# :下達的第幾個指令。
\$ :提示字元,如果是 root 時,提示字元為 # ,否則就是 $ 囉~
長尾理論 ~ 摘錄
Q10:前篩選器式微,編輯,製作人,星探,採購經理。
Q11:不要在想要征服大眾市場,找到自己的利基,照顧好一群小眾的消費者。
生產大眾化:(panos 註解:讓專家做的事情變成大家做的事情。) 數位攝影機、影像編輯程式、部落格工具、音樂創作程式、數位單眼相機
配銷大眾化:(panos 註解:提供買到非暢銷商品的管道。) 亞馬遜、eBay、iTunes、Netflix
連結供給和需求:(panos 註解:提供找到東西的管道。) Google、Blog、狂想曲推薦
Ohmynews:南韓公民新聞網站。iilight?
原創者、重組者、熱心者、平常人,這四者之間的關係?前兩者為生產者,後兩者為消費者。
aggregator:整合者。
Interloc (interlocutor,中間人)二手書商資料庫。後來變成Alibris網路書店,整合二手書長尾。
Google、Craigslist:整合廣告長尾(廣告商和廣告出版業者)。
狂想曲、iTunes:整合音樂長尾。
Netflix:整合電影長尾。
eBay:整合實體商品長尾,整合不要的禮物的長尾。
五大類商品:
實體商品:亞馬遜、eBay
數位商品:iTune、iFilm
廣告/服務:Google、Craigslist
資訊:Google、Wiki
社群:MySpace、Bloglines
篩選器(filter):複雜的推薦引擎、分類演算法
iTune只能做流行音樂,碰到其他類型的音樂就窒礙難行,因為搜尋條件的關係。誰是表演者?作曲者?指揮?
Technorati:十大blog。
每一個產品銷售都是 exponential,所以全部疊起來還是exponential。
稀少性思維方式的心理陷阱:
人人都想成名
人人都是為了錢
不暢銷的東西就是冷門
只有征服大眾才叫成功
直接發行影帶 = 劣等品
獨立 = 沒人要和他們簽約
業餘 = 不專業
銷路差 = 品質差
好東西一定廣受歡迎
長尾成功兩要件:
1.讓我能取得所有的東西。
2.幫我找到它。
長尾原則:
(降低成本)
1.存貨集中,甚至不要存貨。(Amazon, iTune, eBay)
2.讓顧客自己動手。這不是外包(outsourcing),而是運用群眾資源(crowdsourcing)。(同好生產:eBay, wiki, MySpace, Craigslist, Google)
尋找利基:
3.單一配銷方式不適用於所有人。(iTune, VoD, NetFlix, TiVo)
4.單一商品不適合所有人。
5.單一價格不適合所有人。
釋出控制權:
6.分享資訊。(利用排行榜幫助使用者選擇)
7.給其各種選項,而不幫其選擇。
8.讓市場替你做事。(不要前篩選,而要後篩選,前篩選是商人選擇,後篩選是市場大眾的選擇)
9.瞭解免費的威力。(免費是一種廣告,在網路上免費提供節目,廣告放節目前後,或是置入性行銷)
2008年5月18日 星期日
./configure 會重新產生一個 Makefile
所以原來的 Makefile 會不見
這是NS2出現 Command not found 的原因
configure; make; make install 的道理~感謝Willy分享
reference from http://tldp.org/LDP/LG/current/smith.html
configure; make; make install
Submitted by Willy on Saturday, November 22, 2003 - 12:55
Over and over I have heard people say that you just use the usual configure, make, make install sequence to get a program running. Unfortunately, most people using computers today have never used a compiler or written a line of program code. With the advent of graphical user interfaces and applications builders, there are lots of serious programmers who have never done this.
What you have are three steps, each of which will use a whole host of programs to get a new program up and running. Running configure is relatively new compared with the use of make. But, each step has a very distinct purpose. I am going to explain the second and third steps first, then come back to configure.
The make utility is embedded in UNIX history. It is designed to decrease a programmer's need to remember things. I guess that is actually the nice way of saying it decreases a programmer's need to document. In any case, the idea is that if you establish a set of rules to create a program in a format make understands, you don't have to remember them again.
To make this even easier, the make utility has a set of built-in rules so you only need to tell it what new things it needs to know to build your particular utility. For example, if you typed in make love, make would first look for some new rules from you. If you didn't supply it any then it would look at its built-in rules. One of those built-in rules tells make that it can run the linker (ld) on a program name ending in .o to produce the executable program.
So, make would look for a file named love.o. But, it wouldn't stop there. Even if it found the .o file, it has some other rules that tell it to make sure the .o file is up to date. In other words, newer than the source program. The most common source program on Linux systems is written in C and its file name ends in .c.
If make finds the .c file (love.c in our example) as well as the .o file, it would check their timestamps to make sure the .o was newer. If it was not newer or did not exist, it would use another built-in rule to build a new .o from the .c (using the C compiler). This same type of situation exists for other programming languages. The end result, in any case, is that when make is done, assuming it can find the right pieces, the executable program will be built and up to date.
The old UNIX joke, by the way, is what early versions of make said when it could not find the necessary files. In the example above, if there was no love.o, love.c or any other source format, the program would have said:
make: don't know how to make love. Stop.
Getting back to the task at hand, the default file for additional rules in Makefile in the current directory. If you have some source files for a program and there is a Makefile file there, take a look. It is just text. The lines that have a word followed by a colon are targets. That is, these are words you can type following the make command name to do various things. If you just type make with no target, the first target will be executed.
What you will likely see at the beginning of most Makefile files are what look like some assignment statements. That is, lines with a couple of fields with an equal sign between them. Surprise, that is what they are. They set internal variables in make. Common things to set are the location of the C compiler (yes, there is a default), version numbers of the program and such.
This now beings up back to configure. On different systems, the C compiler might be in a different place, you might be using ZSH instead of BASH as your shell, the program might need to know your host name, it might use a dbm library and need to know if the system had gdbm or ndbm and a whole bunch of other things. You used to do this configuring by editing Makefile. Another pain for the programmer and it also meant that any time you wanted to install software on a new system you needed to do a complete inventory of what was where.
As more and more software became available and more and more POSIX-compliant platforms appeared, this got harder and harder. This is where configure comes in. It is a shell script (generally written by GNU Autoconf) that goes up and looks for software and even tries various things to see what works. It then takes its instructions from Makefile.in and builds Makefile (and possibly some other files) that work on the current system.
Background work done, let me put the pieces together.
You run configure (you usually have to type ./configure as most people don't have the current directory in their search path). This builds a new Makefile.
Type make This builds the program. That is, make would be executed, it would look for the first target in Makefile and do what the instructions said. The expected end result would be to build an executable program.
Now, as root, type make install. This again invokes make, make finds the target install in Makefile and files the directions to install the program.
This is a very simplified explanation but, in most cases, this is what you need to know. With most programs, there will be a file named INSTALL that contains installation instructions that will fill you in on other considerations. For example, it is common to supply some options to the configure command to change the final location of the executable program. There are also other make targets such as clean that remove unneeded files after an install and, in some cases test which allows you to test the software between the make and make install steps.
2008年5月17日 星期六
2008年5月16日 星期五
panos tdma 改了那些檔
../mac/mac-panos_tdma.cc
../mac/panos_wireless-phy.h
../mac/panos_wireless-phy.cc
../mobile/panos_tworayground.h
../mobile/panos_tworayground.cc
../mobile/panos_propagation.h
../mobile/panos_propagation.cc
../mobile/panos_channel.h
../mobile/panos_channel.cc
//using queue
../queue/queue.h
../queue/queue.cc
../queue/drop_tail.cc
../queue/panos_drop_tail.cc
//using noah module
../tcl/mobility/noah.tcl
../noah/noah.h
../noah/noah.cc
../tcl/lib/ns-lib.tcl
//panos_Channel
../tcl/lan/ns-mac.tcl
../common/mobilenode.h
../common/mobilenode.cc
../mac/mac.h
../mac/mac.cc
../mac/phy.h
../mac/phy.cc
../queue/drop-tail.cc
../tcl/mobile/noah.tcl
../tcl/lib/ns-default.tcl
../tcl/lib/ns-mobilenode.tcl
NO Ad-Hoc Routing Agent (NOAH)
NOAH is a wireless routing agent that (in contrast to DSDV, DSR, ...) only supports direct communication between wireless nodes or between base stations and mobile nodes in case Mobile IP is used. This allows to simulate scenarios where multi-hop wireless routing is undesired. NOAH does not send any routing related packets.
It has been updated to work with ns-2.26 - ns-2.30 and with non-Mobile IP scenarios. (For older versions of ns-2, take a look at http://www.informatik.uni-mannheim.de/informatik/pi4/projects/MobileIP/ns-extension/ but this version does not contain the bugfixes for non-Mobile IP scenarios.)
Further update to allow static multi-hop routes. The routes can be set up using the routing command which takes as parameters the number of destinations and then as many tuples of destination and next hop address. The following example sets up static routing for a line of nodes:
# setup static routing for line of nodes
for {set i 0} {$i < $val(nn) } {incr i} {
set cmd "[$node_($i) set ragent_] routing $val(nn)"
for {set to 0} {$to < $val(nn) } {incr to} {
if {$to < $i} {
set hop [expr $i - 1]
} elseif {$to > $i} {
set hop [expr $i + 1]
} else {
set hop $i
}
set cmd "$cmd $to $hop"
}
eval $cmd
}
Step-by-step installation instructions for ns-2.26 (and ns-2.30)
Makefile.in add noah/noah.o \ to OBJ_CC and tcl/mobility/noah.tcl \ to NS_TCL_LIB
noah/noah.{h,cc} add noah.h and noah.cc to a new subdirectory noah/
tcl/mobility/noah.tcl add noah.tcl to tcl/mobility/
tcl/lib/ns-lib.tcl line 191 (for v2.29 line 197): add source ../mobility/noah.tcl
line 603ff (for v2.29 line 649ff): add
NOAH {
set ragent [$self create-noah-agent $node]
}
line 768ff (for v2.29 line 839ff): add
Simulator instproc create-noah-agent { node } {
# Create a noah routing agent for this node
set ragent [new Agent/NOAH]
## setup address (supports hier-addr) for noah agent
## and mobilenode
set addr [$node node-addr]
$ragent addr $addr
$ragent node $node
if [Simulator set mobile_ip_] {
$ragent port-dmux [$node demux]
}
$node addr $addr
$node set ragent_ $ragent
return $ragent
}
ubuntu 8.04 上安裝 ns2.33 ~ 感謝梅林分享
在 ubuntu 上安裝還算簡單,首先需要安裝的是:
# sudo apt-get install build-essential
# sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
# sduo apt-get install libxmu-dev libxmu-headers
接著到 ns2 的 SourceForge 去下載檔案,這邊我下載的最新版是 2.33。
可以把解壓縮後的資料夾,搬到你想安裝的位置去。例如:
# tar xvfz ns-allinone-2.33.tar.gz
# sudo mv ns-allinone-2.33 /usr/local/ns2
# cd /usr/local/ns2
# ./install
經過一些時間的等待,就會看到他顯示一串要你修改 .bashrc 或 .cshrc 的訊息,依照訊息加入。
例如我的 .cshrc 就動到或加上這幾行:
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin
$HOME/bin /usr/local/ns2/bin /usr/local/ns2/tcl8.4.14/unix /usr/local/ns2/tk8.4.14/unix)
setenv LD_LIBRARY_PATH /usr/local/ns2/otcl-1.13:/usr/local/ns2/lib
setenv TCL_LIBRARY /usr/local/ns2/tcl8.4.14/library
如果是 .bashrc 的話就會是:
export PATH=$PATH:/usr/local/ns2/bin:/usr/local/ns2/tcl8.4.14/unix:/usr/local/ns2/tk8.4.14/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ns2/otcl-1.13:/usr/local/ns2/lib
export TCL_LIBRARY=$TCL_LIBRARY:/usr/local/ns2/tcl8.4.14/library
接著,依照最後幾行的訊息,去做驗證,例如:
# cd ns-2.33; ./validate
等他跑完後重開,就可以工作了。
聽說愛情回來過~歌詞
曲︰李偲菘 詞︰李偲菘
在朋友那兒聽說 知心的你曾回來過
想請他替我向你問候
只為了怕見了說不出口
你對以往的感觸還多不多
曾讓我心碎的你 我依然深愛著
*在朋友那兒聽說 知心的你曾找過我
我要他幫我對你隱瞞
只是怕見了面會更難過
我對以往的感觸還那麼多
曾給我幸福的你 我依然深深愛著
#有一種想見不敢見的傷痛
有一種愛還埋藏在我心中
我只能把你放在我的心中
這一種想見不能見的傷痛
讓我對你的思念越來越濃
我卻只能把你 把你放在我心中
重唱 *,#
對你的聲音 你的影 你的手
我發誓說我沒有忘記過
而關於你選擇了現在的他
我只能說我有些難過
我也真心真意的等過
重唱 #,#
楊宗緯 演唱
蔡依林 演唱
彩虹~歌詞
哪裡有彩虹告訴我 能不能把我的願望還給我
為什麼天這麼安靜 所有的雲都跑到我這裡
有沒有口罩一個給我 釋懷說了太多就成真不了
也許時間是一種解藥 也是我現在正服下的毒藥
看不見你的笑我怎麼睡得著
你的身影這麼近我卻抱不到
沒有地球 太陽還是會繞
沒有理由 我也能自己走
你要離開 我知道很簡單
你說依賴 是我們的阻礙
就算放開 但能不能別沒收我的愛
當作我最後才明白
有沒有口罩一個給我 釋懷說了太多就成真不了
也許時間是一種解藥 也是我現在正服下的毒藥
看不見你的笑我怎麼睡得著
你的身影這麼近我卻抱不到
沒有地球 太陽還是會繞
沒有理由 我也能自己走
你要離開 我知道很簡單
你說依賴 是我們的阻礙
就算放開 但能不能別沒收我的愛
當作我最後才明白
看不見你的笑 要我怎麼睡得著
你的身影這麼近 我卻抱不到
沒有地球 太陽開始環繞環繞
沒有理由 我也能自己走掉
是我說了太多 就承受不了
也許時間是一種解藥 解藥
也是我選擇整瓶服下的毒藥
你要離開 我知道很簡單
你說依賴 是我們的阻礙
就算放開 但能不能別沒收我的愛
當作我最後才明白
周杰倫 演唱
歌詞~愛愛愛
作詞:周耀輝 作曲:方大同 編曲:方大同
在 哪裡記載 第一個桃花賊
誰在 哪裡典賣 第一支紫玉釵
我在 這裡見怪更怪 見過電影裡面人家的海 更想去看海
唱過人家的愛 更想找愛
你哭起來 我笑起來 都為了 愛愛愛
有一天翻開辭海 找不到愛 花不開 樹不擺 還是更暢快
愛 還是會期待 還是覺得孤單太失敗 我愛故我在
找到愛 幸福的人 肯不肯 躲起來
正在 寂寞的人 能不能 站起來
我在 這裡陪你無奈 讀過小說裡面人家等待 更習慣等待
唱過人家的愛 更想找愛
你喊出來 我靜下來 都為了 愛愛愛
有一天翻開辭海找不到愛 花不開 樹不擺 還是更暢快
愛 還是會期待 還是覺得孤單太失敗 我愛故我在
揮不出滿天滿地的塵埃 買不起滿街口袋的品牌
你悶起來 我傻起來 可以愛
會不會整個時代 只有一個告白 誰不愛過不存在
不明不白 不分好歹 都為了 愛愛愛
有一天翻開辭海 找不到愛 花不開 樹不擺 還是更暢快
愛 還是會期待 還是覺得孤單太失敗 我愛故我在
方大同 演唱
2008年5月7日 星期三
增加開機時需要的程式 (ubuntu)
以VNC為例子。
# cd /etc/rc3.d
# sudo ln -s /etc/init.d/vncserver S99vncserver
If you just want vncserver to start at system startup, you can just add it to the correct runlevel: this will probably be /etc/rc3.d/ (console login, not graphical, with networkin support). To make vncserver startup automatically just add a symlink here to /etc/init.d/vncserver
The number S99 just means it will be executed as the last program. (numbering goes to 100). This way just makes vncserver start automatically...
ubuntu 7.10 samba 安裝 (感謝 smalldd 分享)
在ubuntu中可以直接開啟 系統->管理->共享的資料夾 就會裝好Samba
不過還是得設定 samba 的帳號密碼
sudo smbpasswd -a <帳號>
=================================================================
ubuntu 7.10 samba 安裝 by smalldd 8 November, 2007 7:39
1.安裝 sambasudo apt-get install samba
2.先停止服務,設定設定檔sudo /etc/init.d/samba stop
3.設定 samba 設定檔sudo vim /etc/samba/smb.conf
4.設定分享資料夾在 smb.conf
在尾端加入
[SHARE]
path = /var/lib/share ;分享路徑
browseable = yes ;是否可瀏覽
read only = no ;唯讀
create mask = 0644 ;檔案遮罩
directory mask = 0755 ;資料夾遮罩
5.啟動 samba 服務sudo /etc/init.d/samba start
6.建立帳號密碼sudo smbpasswd -a <帳號>
※若想直接分享,不需帳號密碼在 smb.conf 中 security 設定更改成security = share
2008年5月6日 星期二
apt-get 的server
在ubuntu 裡面,
apt-get 每個server維護的不太一樣,有些比較多。
目前用的是 http://ftp.twaren.net/Linux/Ubuntu/ubuntu
這個可以抓到NS2需要的tcl 跟tk。
# sudo apt-get install build-essential
# sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
# sduo apt-get install libxmu-dev libxmu-headers
不過沒必要這麼做。
直接抓 all in one, 安裝即可。
ps: 安裝ns2的時候,要記得 sudo ./install
APT 的安裝、使用 (感謝 楊錦昌先生的整理)
APT 的安裝、使用
Since 2003-12-18 by 楊錦昌
前言
您使用什麼方法在管理你的 RPM,從光碟片安裝,從網路下載安裝、還是使用 Red Hat 的 up2date(Red Hat Network)在維護,這些都是解決問題的方法,可是你可以有更好的選擇 -- APT
APT 的安裝、使用
1-1. 什麼是 APT
APT(Advanced Package Tool)是 Debian GNU/Linux 用來管理套件的工具,Conectiva 這家巴西的 Linux 套件公司將它移植到使用 RPM 系統的 Linux 套件上,所以現在我們才可以在 Red Hat Linux(或 Fedora) 上使用 APT 來管理我們的 RPM
1-2. APT 能做什麼
我們可以用 APT 來管理我們的 RPM ,不管是安裝、移除、或是升級,APT 都做的到,可是我們選用 APT 最大的理由是:它能夠自動處理 RPM 相依性的問題,例如:當我們要安裝 A rpm,而 A rpm 和 B rpm 又有相依關係的時候,傳統作法是先下載 B rpm 安裝之後,再下載 A rpm 安裝之;可是我們若有安裝 APT,則只要下一行「apt-get install A」指令就可以了,這樣 APT 就會幫我們下載 A rpm,且會自動下載相依性檔案(B rpm)幫我們安裝,如此一來我們對於 RPM 的安裝、移除、或是升級都可以不用去管煩人的相依性問題了
1-3. APT 簡易運作原理
我們的機器安裝了 APT 套件之後就成了 APT 的使用者端,當我們在安裝、升級 RPM 的時候,事實上,都是透過網路連到遠端的 APT 伺服器去下載 RPM 回來安裝的,APT 伺服器我們是可以自己指定的,而 APT 使用者端也可以同時成為 APT 伺服器
當我們安裝了 APT套件之後就會有 apt-get 指令,下 apt-get update 指令的時候會同步使用者端和 APT 伺服器的 RPM 索引清單(package list),APT 伺服器的 RPM 索引清單置於 base 資料夾內,使用者端電腦取得 base 資料夾內的 bz2 RPM 索引清單壓縮檔後,會將其解壓置放於 /var/state/apt/lists/,而當使用者使用 apt-get install 或 apt-get dist-upgrade 指令的時候,就會將這個資料夾內的資料和使用者端電腦內的 RPM 資料庫比對,如此一來就可以知道那些 RPM 已安裝、未安裝、或是可以升級的,然後 APT 就會自動透過網路下載需要的 rpm 回來安裝了
1-4. 安裝 Fedora Core 2、Fedora Core 1、freshrpms 的 GPG KEY :
rpm --import /usr/share/doc/fedora-release-2/RPM-GPG-KEY
rpm --import /usr/share/doc/fedora-release-1/RPM-GPG-KEY
rpm --import ftp://apt.nc.hcc.edu.tw/pub/freshrpms/RPM-GPG-KEY
註:
裝了 Fedora Core2、Fedora Core 1、freshrpms 的 GPG key 之後,在安裝他們維護的 rpm 的時候才不會出現警告訊息,若不在乎這些訊息,沒有安裝也是沒有關係的
1-5. APT 的安裝
以下的範例都是以 http://freshrpms.net/ 網站所維護的 apt rpm 為例
(若是對 CLE 所維護的 APT 有興趣,請參考:http://cle.linux.org.tw/~candyz/APT-HOWTO_CLE.txt)
for Fedora Core 2
線上安裝:rpm -ivh ftp://apt.nc.hcc.edu.tw/pub/apt/fedora/linux/2/i386/RPMS.extra/apt-0.5.15cnc6-1.1.hcc.i386.rpm
for Fedora Core 1
線上安裝:rpm -ivh ftp://apt.nc.hcc.edu.tw/pub/apt/fedora/linux/1/i386/RPMS.extra/apt-0.5.15cnc3-0.1.hcc.i386.rpm
for Red Hat Linux 9
線上安裝:rpm -ivh ftp://apt.nc.hcc.edu.tw/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc6-fr1.i386.rpm
1-6. 修改 APT 伺服器來源
freshrpms 維護的 apt rpm 預設的 APT 伺服器是 http://ayo.freshrpms.net/,遠在國外,速度較慢,底下將其改為 新竹縣教育研究發展暨網路中心 維護的 APT 伺服器
vi /etc/apt/sources.list
#rpm http://ayo.freshrpms.net fedora/linux/1/i386 core updates freshrpms
↑找到這一行在最前面加上 # 註解符號,然後加入適合您的系統版本的 apt 伺服器來源設定
for Fecora Core 2
rpm ftp://apt.nc.hcc.edu.tw/pub/apt/fedora/linux/2 i386 os updates freshrpms firefly extra
for Fecora Core 1
rpm ftp://apt.nc.hcc.edu.tw/pub/apt/fedora/linux/1 i386 os updates freshrpms firefly extra
for Red Hat linux 9
rpm ftp://apt.nc.hcc.edu.tw/pub/apt/redhat/9 i386 os updates freshrpms firefly extra
注意:若您是按照上面網址線上安裝 for Fedora Core 2、Fedora Core 1 的 apt rpm 的話,就不用修改 sources.list 了,因為 apt-0.5.15cnc3-0.1.hcc.i386.rpm 的 sources.list 已經修改過了。
1-7. APT 的使用 -- 底下列出幾個常用的指令
apt-get update
更新:這指令是用來取得記錄在 /etc/apt/sources.list 內的遠端伺服器的套件檔案清單, 在使用 「apt-get dist-upgrade」指令升級套件前,一定要記得先用這指令將套件檔案清單更新
apt-get dist-upgrade
升級:這裡的升級,並不是指由 Red Hat Linux 8.0 變成 9 這樣的升級,而是當 Red Hat 有出升級的 rpm 的時候,我們就可以透過這個指令,升級我們已經安裝的 rpm
Fedora Core 2 有出那些升級套件,由此網站可以得知:http://download.fedora.redhat.com/pub/fedora/linux/core/updates/2/i386/
Fedora Core 1 有出那些升級套件,由此網站可以得知:http://download.fedora.redhat.com/pub/fedora/linux/core/updates/1/i386/
Red Hat Linux 9 有出那些升級套件,由此網站可以得知:https://rhn.redhat.com/errata/rh9-errata.html
註:
APT 源自 Debian GNU/Linux,Debian 在同一個版本編號下,依套件成熟度又分 stable、testing、unstable。若我們現在用的是 Debina 3.0r2 stable,使用 apt-get upgrade 就可以升級 for stable 的軟體,而使用 apt-get dist-upgrade 則可以選擇將系統由 stable 升級到 testing 或是 unstable,可是在 Red Hat linux 中並沒有這樣分,所以,使用 apt-get upgrade 和 apt-get dist-upgrade 的結果,基本上是一樣的,不過 apt-get dist-upgrade 在升級的同時會為了解決相依性而安裝新套件,而 apt-get upgrade 並不會,因此要升級的話,建議還是用 apt-get dist-upgrade 較佳
apt-cache search
搜尋:我們可以用這個指令來搜尋 rpm,例如:apt-cache search httpd,這樣檔名內有 httpd 字眼的 rpm 都會出現了
apt-cache depends
相依性:我們可以用這個指令來看到某個 rpm 的所有相依性檔案,例如:apt-cache depends httpd,這樣 httpd 的所有相依性檔案就會出現了,有時候不確定某個相依性檔案是屬於那個 rpm 時,這個指令就很有用
apt-get install
安裝:當我們知道 rpm 名稱的時候,就可以用這指令安裝套件,例如:apt-get install httpd,這樣 apt 就會自動上網下載 httpd rpm 回來安裝,若 httpd 有相依性套件的時候,apt 也會自動下載安裝
apt-get clean
清除:當使用 apt-get install 指令安裝套件,下載下來的 rpm 會放置於 /var/cache/apt/archives,使用 apt-get clean 指令可以將之清除,避免佔用硬碟空間
apt-get remove
移除:假如我們想要移除某個 rpm 的時候就可以使用此指令,例如:apt-get remove httpd,就會移除 httpd 了,假如這個 rpm 有相依性套件的時候,apt 也會一併移除
以上這幾個指令應該就夠用了,若想要得到更進一步的指令,請善用 man:)
1-8. 定期更新:
vi /etc/cron.daily/upgrade
#!/bin/sh
apt-get update
apt-get -y dist-upgrade
apt-get clean
chmod 755 /etc/cron.daily/upgrade
啟動 crond:chkconfig crond on
這樣電腦就會每天定時 upgrade了(要結束前請執行 /etc/cron.daily/upgrade,檢查看看有沒有錯誤)
FAQ
1.如何為 apt 設定 proxy?
答:vi /etc/apt/apt.conf 找到
Proxy ""; // http://user:pass@host:port/
加進你可用的 proxy,底下是以 交通大學 的 proxy 為範例
Proxy "http://proxy.nctu.edu.tw:3128"; // http://user:pass@host:port/
2.如何讓 apt 自動升級 kernel,不需要用手動升級?
答: vi /etc/apt/apt.conf
找到這一行
Allow-Duplicated { "^kernel$"; "^kernel-"; "^kmodule-"; "^gpg-pubkey$" };
刪掉紅字部分即可
3.X Window 相關
Mozilla 如何看 flash:apt-get install flash-plugin
XMMS 如何聽 MP3:apt-get install xmms-mp3
apt 的圖形介面:apt-get install synaptic
影音相關:apt-get install mplayer xine totem
4.使用 apt 將 Red Hat Linux 9 升級到 Fedora Core 1
不負責任聲明:此操作過程,完全針對本人的軟硬體環境,請仔細評估操作所需承擔的風險,若因操作造成任何損失,本人概不負責:P
1.安裝 for RHL9 的 apt
rpm -ivh ftp://apt.nc.hcc.edu.tw/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc6-fr1.i386.rpm
2.修改 apt 伺服器來源
vi /etc/apt/sources.list
rpm ftp://apt.nc.hcc.edu.tw/pub/apt/fedora/linux/1 i386 os updates freshrpms firefly extra
3.升級
apt-get update;apt-get -y dist-upgrade;apt-get install fedora-release;apt-get clean;reboot
過程要是順利的話,升級完會自動重新開機,就可以看到 Fedora Core 1 的登入畫面了
註:
1.中間若出現套件重複安裝的訊息,請先移除較小版本的套件,然後再執行上面的步驟
2.升級的 RHL9 是採用最小安裝,只安裝 apache、sendmail、vsftpd 等伺服器,升級過程需下載一百多個套件,共一百多MB(詳細數字忘了:P)
3.RHL8 「應該」也可以這樣升級,RHL7.3以下版本(含RHL7.3)因為套件差異甚大,不建議用這種方式升級,還是用光碟片升級較保險
