从前有一只小猪

Jan 发表于 2006-03-05 20:58:44

一只体型像花的小猪。有一只蜜蜂飞过来,上当了,喜欢上了这只花小猪。被围绕的感觉真好,花小猪想。可是我不是花,花小猪想。我要让蜜蜂幸福,花小猪想。花小猪要逃走。ta翻过一做又一做大山,ta淌过一条又一条河流,ta飞过一座又一座村庄,ta在这个世界漫游。蜜蜂不知疲倦呢,一直跟着ta。

然后呢? 然后花小猪就逃走了,蜜蜂终于不见了。那是花小猪一生中所做过的,最残忍的事。

关键词(Tag): 幸福,是用来失去的
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

在Gentoo上重新编译所有关于Java的包

Jan 发表于 2006-03-02 13:53:55

If you've got 'eix' installed, this should re-emerge everything that's got 'java' in it and is installed on your system:
Code:

# eix -cIS java --format-compact "<category>/<name>" | grep -v Found | xargs emerge -pv
关键词(Tag): java gentoo recompile
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Gentoo一些有用技巧

Jan 发表于 2006-03-01 11:41:04

作者:penny
出处http://linuxsir.com/bbs/showthread.php?s=652034ecf6e733e12a71e6f993ee90a7&threadid=49598
==================================================================
这个FUQ=Gentoo Frequently Unanswered Questions(FUQ)

主要是受到这个页面的启发
http://gentoo.zhware.net/fuq.html
这里说得很杂,我只结合自己的使用说说portage系统的一些技巧。

0. 定位ebuild
基础知识,比如
$emerge -s gcal
* app-misc/gcal
Latest version available: 3.01
Latest version installed: [ Not Installed ]
Size of downloaded files: 2,315 kB
Homepage: http://www.gnu.org/software/gcal/gcal.html
Description: The GNU Calendar - a replacement for cal

那么gcal这个软件的ebuild就在/usr/portage/app-misc/gcal/下面
在这个目录下,一般能看到很多ebuild文件,分别对应不同版本号

1. 怎么继续前次的ebuild操作?
比如,emerge到一半,发现一个错误,你google/去论坛搜了一圈,找出了解决办法,难道非要从头开始么? 解决办法其实很多了,说几个最常用的
a. 使用ccache
每个人都应该把它打开
emerge ccache之后,在/etc/make.conf里面
找到FEATURES设置,加上
FEATURES="ccache"
以及CCACHE_SIZE="2G"
默认好像是2G,我觉得如果硬盘空间足够,多多益善。
下次emerge的时候,你会发现编译的速度快了很多。这样间接起到了中断继续的效果。个人推荐这个方法,最简单。

b.继续make
emerge也就是一个用源码编译/安装的过程,而gnu make系统也保证了它实际上是可以"断点续传"的。而gentoo的portage系统在每次开始新的emerge的时候,会自己删掉以前的临时目录,重新生成,造成中断的emerge过程不可恢复。
你只要进入到临时目录,一般是
/var/tmp/portage/ebuild名称/work/ebuild名称/
下继续make,然后make install就行
不用怀疑,这样已经装好了。。但是,这样安装的软件包不会被记载在portage的world file里面。。所以,更优雅的办法是
0. 找到ebuild文件,比如abc-1.0.1.ebuild
1. ebuild abc-1.0.1.ebuild compile
2. ebuild abc-1.0.1.ebuild install
3. ebuild abc-1.0.1.ebuild qmerge
2. 作自己的ebuild
ebuild文件只是按照一定规律写的shell script而已,一般来说,它们是非常简单的(只限于100行以内条理清晰的 xfree的ebuild就是个很好的例外 ) 可以看看gentoo的ebuild guide,
http://www.gentoo.org/doc/en/gentoo-howto.xml
大概而言,只要知道
$A/$P等几个变量的含义就可以了。
从头写ebuild还是有点麻烦的,对于一个普通用户来说也没必要,但是
对于大多数软件的版本升级,你只要复制+改名+做digest就可以了
比如stardict最近出了2.2.1,但是ebuild只到2.2.0

代码:
fancyworld stardict # cp stardict-2.2.0.ebuild stardict-2.2.1.ebuild
fancyworld stardict # ebuild stardict-2.2.1.ebuild digest
>>> Downloading ftp://ftp.ussg.iu.edu/pub/linux/gentoo/distfiles/stardict-2.2.1.tar.bz2
--22:26:57--  ftp://ftp.ussg.iu.edu/pub/linux/gentoo/distfiles/stardict-2.2.1.tar.bz2
           => `/usr/portage/distfiles/stardict-2.2.1.tar.bz2'
Resolving ftp.ussg.iu.edu... done.
Connecting to ftp.ussg.iu.edu[129.79.6.12]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/linux/gentoo/distfiles ... done.
==> PASV ... done.    ==> RETR stardict-2.2.1.tar.bz2 ...
No such file `stardict-2.2.1.tar.bz2'.

>>> Downloading http://aleron.dl.sourceforge.net/sourceforge/stardict/stardict-2.2.1.tar.bz2
--22:26:58--  http://aleron.dl.sourceforge.net/sourceforge/stardict/stardict-2.2.1.tar.bz2
           => `/usr/portage/distfiles/stardict-2.2.1.tar.bz2'
Resolving aleron.dl.sourceforge.net... done.
Connecting to aleron.dl.sourceforge.net[204.157.3.229]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 608,829 [application/x-bzip2]

100%[====================================>] 608,829      144.56K/s    ETA 00:00

22:28:02 (144.56 KB/s) - `/usr/portage/distfiles/stardict-2.2.1.tar.bz2' saved [608829/608829]

>>> Generating digest file...
<<< stardict-2.2.1.tar.bz2
>>> Generating manifest file...
<<< stardict-2.0.0.ebuild
<<< stardict-2.2.1.ebuild
<<< stardict-2.2.0.ebuild
<<< ChangeLog
<<< files/stardict-gentoo.patch
<<< files/stardict-config.sh
<<< files/digest-stardict-2.0.0
<<< files/digest-stardict-2.2.0
<<< files/digest-stardict-2.2.1
>>> Computed message digests.


然后试着emerge stardict-2.2.1.ebuild看看?

当然大多数时候,没有这么简单,可能会做一些小修改。我的标准步骤是
cp xxx.1.ebuild xxx.2.ebuild
ebuild xxx.2.ebuild digest
ebuild xxx.2.ebuild unpack
如果到这里一帆风顺,那么估计后面也没问题了,否则,仔细检查,看看是哪里出错了。出错的原因很多,但是一般都是因为几个变量的写法,或者是下载地址变更,再就是老的ebuild里的patch,在新版本上无法使用。总之,看看ebuild guide,自己多熟悉一下,升级软件真的很简单。

3. 加patch
做法有两种,参考前面提到的介绍
a. 在临时目录里面修改

从1.知道,临时文件在/var/tmp/portage/下面
以fontconfig 2.2.1+firefly的patch为例

代码:
fancyworld superkaramba # emerge -p fontconfig

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild    N ] media-libs/fontconfig-2.2.0-r2

fancyworld superkaramba # cd /usr/portage/media-libs/fontconfig/
fancyworld fontconfig # ebuild fontconfig-2.2.1.ebuild unpack
fancyworld fontconfig # ebuild fontconfig-2.2.1.ebuild unpack
>>> md5 src_uri ;-) fontconfig-2.2.1.tar.gz
>>> Unpacking source...
>>> Unpacking fontconfig-2.2.1.tar.gz to /var/tmp/portage/fontconfig-2.2.1/work
 * Applying fontconfig-2.1-slighthint.patch...                            [ ok ]
 * Applying fontconfig-2.2-local_fontdir-r1.patch...                      [ ok ]
 * Applying fontconfig-2.2-blacklist.patch...                             [ ok ]
 * Applying fontconfig-2.2-remove_subpixel_test.patch...                  [ ok ]
>>> Source unpacked.
fancyworld fontconfig # cd /var/tmp/portage/fontconfig-2.2.1/work/fontconfig-2.2.1/
fancyworld fontconfig-2.2.1 # wget http://firefly.idv.tw/setfont-xft/p...-20030618.patch http://firefly.idv.tw/setfont-xft/p...030626.patch.gz http://firefly.idv.tw/setfont-xft/p...-20030617.patch

fancyworld fontconfig-2.2.1 # patch -p1 < fontconfig-2.2.1-fclang-miss_1_percent-20030617.patch
patching file src/fclang.c

.............



然后
fancyworld fontconfig-2.2.1 # ebuild /usr/portage/media-libs/fontconfig/fontconfig-2.2.1.ebuild merge

这个merge操作会保留临时目录,在这个基础上进行./configure, make, make install的动作

b. 修改ebuild

gentoo的portage系统恐怕是最适合patch 的包管理系统了
还是以上为例
fancyworld fontconfig-2.2.1 # cd /usr/portage/media-libs/fontconfig/files/
下载patch
fancyworld files # wget http://firefly.idv.tw/setfont-xft/p...-20030618.patch http://firefly.idv.tw/setfont-xft/p...030626.patch.gz http://firefly.idv.tw/setfont-xft/p...-20030617.patch
解压.gz(特例,因为这个patch太大了,所以firefly把它打包了一下)
gunzip fontconfig-2.2.1-include_CJK_charmaps-20030626.patch.gz
得到fontconfig-2.2.1-include_CJK_charmaps-20030626.patch
回到上一级,修改ebuild
fancyworld files # cd ..
fancyworld fontconfig # vi fontconfig-2.2.1.ebuild
可以看到

代码:
src_unpack() {
    unpack ${A}
    cd ${S}

    local PPREFIX="${FILESDIR}/patch/${PN}"

    # Some patches from Redhat
    epatch ${PPREFIX}-2.1-slighthint.patch
    # Add our local fontpaths (duh dont forget!)
    epatch ${PPREFIX}-2.2-local_fontdir-r1.patch
    # Blacklist some fonts that break fontconfig
    epatch ${PPREFIX}-2.2-blacklist.patch
    # Remove the subpixel test from local.conf (#12757)
    epatch ${PPREFIX}-2.2-remove_subpixel_test.patch

    # The date can be troublesome
    sed -i "s:\`date\`::" configure
}



这里的${FILESDIR}就等于 /usr/portage/media-libs/fontconfig/files/目录
${P}表示的是完整软件名+版本号,这里是fontconfig-2.2.1
${PN}就只是单纯的软件名,这里是fontconfig
注意 epatch ${PPREFIX}-2.2-local_fontdir-r1.patch
和 firefly的patch部分冲突,把它去掉。
为了避免不必要的困扰,你的ebuild没有必要写的那么漂亮,所以,修改如下

代码:
src_unpack() {
unpack ${A}
cd ${S}

local PPREFIX="${FILESDIR}/patch/${PN}"

# Some patches from Redhat
epatch ${PPREFIX}-2.1-slighthint.patch
# Add our local fontpaths (duh dont forget!)
# epatch ${PPREFIX}-2.2-local_fontdir-r1.patch
# Blacklist some fonts that break fontconfig
epatch ${PPREFIX}-2.2-blacklist.patch
# Remove the subpixel test from local.conf (#12757)
epatch ${PPREFIX}-2.2-remove_subpixel_test.patch


[color=green]# CJK font patch by firefly
epatch ${FILESDIR}/fontconfig-2.2.1-fclang-miss_1_percent-20030617.patch
epatch ${FILESDIR}/fontconfig-2.2.1-include_CJK_charmaps-20030626.patch
epatch ${FILESDIR}/fontconfig-2.2.1-multifamily-20030618.patch[/color]

# The date can be troublesome
sed -i "s:\`date\`::" configure
}


epatch是个eclass,它的特点就是屏蔽了patch的细节,让你无需考虑patch的参数问题。
最后直接emerge这个修改过的ebuild文件就行了。

这一部分说起来有点长,自己做一次就知道其实非常简单了。
4. 其他要注意的。。

a. emerge gentoolkit
我不知道为什么没把它作为基本系统的一部分,但是里面的qpkg工具绝对是gentoo必备的,它提供了各种对已安装package的查询,列表等功能,具体的自己man一下

b. 尽量减小编译带来的影响
新的portage系统已经引入优先级设置了,在
/etc/make.conf里面,
PORTAGE_NICENESS=10
我一般用10,这样在emerge 的时候基本没什么感觉了。这个比较适合基本系统已经完成的情况,否则可以把这个数值设成0甚至-10,然后看看滚屏,也很有成就感。

c. 只编译需要的部分
比如koffice里面包括kword, kspread, kexi, kchat等等,我不需要kword kchat,可以这样
export DO_NOT_COMPILE="kword kchat"
emerge koffice

d. 善用sudo
用visudo,我把下面的一些命令都加到/etc/sudoers里面了

lucida fancyworld=NOPASSWD: /usr/bin/emerge
lucida fancyworld=NOPASSWD: /usr/bin/ebuild
lucida fancyworld=NOPASSWD: /usr/bin/make
lucida fancyworld=NOPASSWD: /usr/bin/vi

要装软件,直接sudo emerge xxx就行,或者make, sudo make install。。。在日常操作中避免用root而又不损失方便性,sudo是个很好的解决办法。

e. 查看use变量
emerge -pv xxx

顺便说一下,ebuild被mask其实是有两个可能的
一个是ebuild文件本身
如果里面有KEYWORDS="~x86"
那么ACCEPT_KEYWORDS="~x86" emerge xxx就行
另外一个是/usr/portage/profiles/package.mask文件
这个列表里面的东东只能
emerge xxx.ebuild才行,或者直接修改文件,去掉黑名单

f. 多看看info
info提供的内容比man丰富的多,可以emerge pinfo,然后pinfo xxx, 它支持彩色,看起来更加舒服。或者用konqueror,试试在地址栏输入
info:/gcc

5. 一些有用的站点
http://www.breakmygentoo.net/
这里有很多软件的非官方ebuild
http://cvs.gentoo.org/~danarmak/kde-cvs.html
kde的cvs版ebuild(我一直在用的)
大概来说,在/etc/make.conf里面加上
PORTDIR_OVERLAY=/usr/local/portage
然后把下载的ebuild解压到这个目录下面就可以了
它会和正常的portage tree整合在一起,唯一的区别是emerge sync的时候,这个目录下面的内容会得以保留。

关键词(Tag): linux gentoo
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Google hires: Who is Who

Jan 发表于 2006-03-01 10:42:38

关键词(Tag): google hire whoiswho
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

姐姐来杭州了

Jan 发表于 2006-02-27 13:36:09

又走了,临走塞给我一红包,说一定要给的,虽然你已经工作了,我说不要不要,我今年在家都给ddmm们发红包了,怎么能要。姐说在他们那里只要没结婚就要收红包(他们叫利是),姐让我觉得自己还是个小孩... 但是我还是不收,嘿嘿。姐没辙收了回去,路上拿了打包的饭菜给我说晚上回家热热吃了吧,姐回去了,我说嗯。

回到家收到姐的短信,利是压在饭盒下面了,顿时无语。居然还是被姐摆了一道,难道在姐面前,我真的就是个小孩么。千万不要相信女人,尤其是漂亮的女人,就像张无忌他妈说的一样。姐姐是陪姐夫去上海培训顺便来杭州玩的,两个人游山玩水好不惬意。坐在车里看着前面座位的姐姐姐夫有一搭没一搭的说话,突然感觉姐姐很幸福。男人果然是要有事业,要有钱,才能让一个女人幸福的吧,当然女人并不是需要钱才能幸福的。或许以前我是错了。吃饭的时候姐给我夹菜,我也觉得很幸福。

姐回去了。下午跑到stg去平花,玩了四个小时,暴有成就感。两大进步是后单轮奇迹般的过了五个桩,不过的确是奇迹,因为后来再也没重现过;还有就是小天鹅居然能转一圈了... 昨天是第一次认真的练习啊,虽然我想了很久... 看来基础训练真的很重要,基础扎实了后面的动作会水到渠成的。大风车似乎也有了一点感觉,不过划的圆大了点,应该是刃没压够的缘故。

练完了去大头家包饺子吃,几个人磨几到了10点才吃完,我只吃了三个,太难吃了,sigh啊。
关键词(Tag): 包饺子 平花
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

ASUS的书架型PC

Jan 发表于 2006-02-27 11:24:20

猛啊,虽然说华硕在大陆的生产基地口碑一塌糊涂,他还是相当有核心竞争力的一家公司,不得不服。

用电磁感应提供电力供组件工作,数据传输用USB Wireless, 所有组件可以随意更换,插在书架上面就可以用了,这个设计得到了微软那个什么什么的大奖。详细介绍看这里


asus green pc concept system


asus green pc concept system

asus green pc concept system

关键词(Tag): pc asus 书架型
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

用两台Dell 3007WFP....

Jan 发表于 2006-02-27 11:13:49

来上BBS... 世界上顶级的30寸LCD啊,我为你们哭泣...

关键词(Tag): bbs lcd
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

IE7的试用报告

Jan 发表于 2006-02-27 10:51:08

http://blogs.zdnet.com/Burnette/?p=15

几个问题:

1. 不兼容。不仅不兼容为ff打造的网站,也不兼容ie6的网站。至于到底有多么不兼容我就不知道了。
2. 扭曲了CSS的解释(M$的惯用手法),导致浏览某些网站的时候有问题。
3. 缩放,据说不仅仅文字会变化大小,在你缩放网页的同时整个布局都会变化大小... 其实听起来不错啊,挺人性化的... 不过具体效果貌似很恼人,详情见原文...
4. 插件缺乏
5. 过于注重安全性,有的时候让人烦(其实这也不算缺点... 作者是ff fans,毫无疑问)
6. 没有开源社区支持 (汗一下,作者疯了)

无论如何,总是说了点东西的,虽然作者有点傻。
关键词(Tag): 试用 ie7
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Gentoo 2006.0发布了

Jan 发表于 2006-02-27 10:26:32

发布详情看这里。这是包括Gentoo Installer的第一个发布,liveCD还带了一个完整的Gnome,随后会发布一个liveDVD,上面会有一个KDE,hoho, 准备刻盘吧。
关键词(Tag): gentoo 2006.0 release
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

转自mop...

Jan 发表于 2006-02-23 16:59:35

笑死我了...


















关键词(Tag): mop driver
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Google Launched Homepage

Jan 发表于 2006-02-23 14:30:26

关键词(Tag): google homepage
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Faster than Fiber

Jan 发表于 2006-02-23 10:48:00

比光纤还要快的无线传输技术... 传输速度1Gb/s,传输距离可以超过1英里。同样使用光信号,波段在可见光附近,这个选择是的传输在天气恶劣的时候照样可以畅通无阻(下雨的时候你还是能看见路,对吧? 不过晚上怎么办? 可能就是可见光附近和可见光的区别吧)

Wednesday, February 22, 2006

Faster than Fiber

A new wireless technology could beat fiber optics for speed in some applications.

By Kate Greene

Atop each of the Trump towers in New York City, there's a new type of wireless transmitter and receiver that can send and receive data at rates of more than one gigabit per second -- fast enough to stream 90 minutes of video from one tower to the next, more than one mile apart, in less than six seconds. By comparison, the same video sent over a DSL or cable Internet connection would take almost an hour to download.

This system is dubbed "WiFiber" by its creator, GigaBeam, a Virginia-based telecommunications startup. Although the technology is wireless, the company's approach -- high-speed data transferring across a point-to-point network -- is more of an alternative to fiber optics, than to Wi-Fi or Wi-Max, says John Krzywicki, the company's vice president of marketing. And it's best suited for highly specific data delivery situations.

This kind of point-to-point wireless technology could be used in situations where digging fiber-optic trenches would disrupt an environment, their cost be prohibitive, or the installation process take too long, as in extending communications networks in cities, on battlefields, or after a disaster.

Blasting beams of data through free space is not a new idea. LightPointe and Proxim Wireless also provide such services. What makes GigaBeam's technology different is that it exploits a different part of the electromagnetic spectrum. Their systems use a region of the spectrum near visible light, at terahertz frequencies. Because of this, weather conditions in which visibility is limited, such as fog or light rain, can hamper data transmission.

GigaBeam, however, transmits at 71-76, 81-86, and 92-95 gigahertz frequencies, where these conditions generally do not cause problems. Additionally, by using this region of the spectrum, GigaBeam can outpace traditional wireless data delivery used for most wireless networks.

Because so many devices, from Wi-Fi base stations to baby monitors, use the frequencies of 2.4 and 5 gigahertz, those spectrum bands are crowded, and therefore require complex algorithms to sort and route traffic -- both data-consuming endeavors, says Jonathan Wells, GigaBeam's director of product development. With less traffic in the region between 70 to 95 gigahertz, GigaBeam can spend less time routing data, and more time delivering it. And because of the directional nature of the beam, problems of interference, which plague more spread-out signals at the traditional frequencies, are not likely; because the tight beams of data will rarely, if ever, cross each other's paths, data transmission can flow without interference, Wells says.

Until a few years ago, the use of these electromagnetic frequencies that have enabled Gigabeam to build a higher-speed network, were off-limits for two reasons. First, the Federal Communication Commission (FCC) approved public use of these high frequencies only in 2003, says Wells. When the FCC finalized the agreement in 2005, GigaBeam began to ship prototypes.

Second, there was no cost-effective material for making transmitters at such frequencies. Wireless transmitters that send traditional signals are made of silicon, which can't operate at frequencies in GigaBeam's range. Within the past few years, Wells says, manufacturing techniques for making high-frequency radio transmitters out of gallium arsenide have improved significantly, making the technology less cost prohibitive.

While working at these frequencies permits high-speed data rates, there's an intrinsic physical challenge: molecules in the atmosphere absorb energy at certain frequencies. To deal with this, GigaBeam exploits those frequencies that are less susceptible to absorption by air and water molecules.

But the technology is still susceptible to heavy rains. In arid conditions, Gigabeam's signal can travel about 10 miles, but in areas where heavy rains occur, says Wells, the company's radios are only guaranteed to push a signal for about a mile, with the transmission will be down for a maximum of only five minutes per year.

Even with its advances, though, Gigabeam faces the same problem as other point-to-point technologies: creating a network with an unbroken sight line. Still, it could offer some businesses an alternative to fiber optics. Currently, a GigaBeam link, which consists of a set of transmitting and receiving radios, costs around ,000. But Krzywicki says that improving technology is driving down costs. In addition to outfitting the Trump towers, the company has deployed a link on the campuses of Dartmouth College and Boston University, and two links for San Francisco's Public Utility Commission.

关键词(Tag): wireless transfer fiber
收藏: QQ书签 del.icio.us 订阅: Google 抓虾