Archive for the 'linux' Category

Gentoo Linux 查詢相依性

chenpc December 13th, 2008

裝了portage-utils之後會有”q”系列的工具可以用。
其中有一個工具是qdepend,他會去查詢該ebuild的相依性。
但是其實這不難,因為相依性寫在ebuild裡面,自己打開來看就好了。
常常我們不想安裝某一些東西,比方說xulrunner。
你想要知道到底哪些ebuild需要xulrunner,然後把那些ebuild解決掉。

你可以用qlist和qdepend合併。

qlist -I|qdepends -|grep xulrunner

這樣他會去找出和xulrunner有關的套件。

上次Linux開會提到要把world精簡化。
要把不需要的東西拿掉,用這個方法輔助的話可以節省很多時間。

“patch” a file use “diff”

chenpc May 2nd, 2008

diff -uN Makefile Makefile.new > patch.Makefile
then
patch -p1 < patch.Makefile

Gentoo Resource limit

admin March 18th, 2008

To make restrict on our linux* users , just put rules into
/etc/security/limits.conf  :

# For undergraduates and  master students : Max process  = 256
# No more  horrible fork()
@cs       hard      nproc    256
@gcs      hard      nproc    256

# For undergraduates and master students: Max cpu time = 4 mins
# Prevent buggy NP homework programs from eating all cpu time.
@cs       hard      cpu   256
@gcs      hard      cpu    256

# A little evil choice ( I haven’t used it in real life )
# Don’t be too serious on this! I’m just TALKING about it.
# Theoretically speaking, it forces every user start program from nice
value 19 and let
# simulate programs occupy less system resources. (XD)
@cs       hard     nice  19
@gcs       hard     nice  19

By the way, it’s usually give no restriction to @dcs group.

There are abound useful setting with description in the comments of
limits.conf ,
it worths to read!

ref : <a href=”http://help.cs.nctu.edu.tw/blog/categories/linux/”>http://help.cs.nctu.edu.tw/blog/categories/linux/</a>