Fedora 14于11月2号正式发布了,而我的Fedora 12已经用了1年多了,尽管仍然十分稳定,但还是想着赶赶潮流。
完全重装当然是舍不得的,于是Google了一下,发现了preupgrade这个Tool可以用来升级系统,详情参见:http://fedoraproject.org/wiki/PreUpgrade。
升级还是很傻瓜话的,惟一的问题就是由于我家网络不太好,下载升级包的过程中找不到mirror而终端过一次。重新开始之后,正好是凌晨5~6点,以平均600K的速度疯狂下载,很快就把1917个升级包下好了,然后就是安装,没什么好说的。
升级完之后检查了一下软件的兼容性,发现除极个别的软件之外,如aMule和Vim (vi可以),其它都可以正常工作。aMule又得重新编译了。
升级之后,用package-cleanup --orphans查了一下垃圾软件包,不是很多。看见这些垃圾我就很不爽,于是就准备手动删除它们。第一个要删的就是ModemManager,用的命令是yum remove XXX,由于没仔细看它的dependency,结果直接输入y之后把所有depend on它的NetworkManager们都给删了,于是乎我的网络中断了……
好在我为防不测,已经下好了Fedora14的DVD ISO文件,于是挂载上ISO之后到它的Packages里面找到ModemManager和NetworkManager们,统统装上,重启,网络又OK了!
由此可见,升级有风险,删包需谨慎。
总体而言,Fedora14和以前版本Gnome界面上变化不是很大,感觉稳定性资源利用率有所提高,某些软件的易用性有所增强——每次进步一点点,这就够了!
"China has replaced the United States as the maker of the world's fastest supercomputer. A Chinese research center has made the world's faster super computer — named as Tianhe-1A, which was released at a national conference on high-performance computers (HPC) in China. Made at a cost of over $88 million, Tianhe-1A is theoretically able to do more than 1 quadrillion calculations per second (one petaflop) at peak speed. Tianhe-1A 's peak performance reaches 1.206 petaflops, and it runs at 563.1 teraflops (1,000 teraflops is equal to one petaflop) on the Linpack benchmark."
其他外国网友们的回复,很有意思(【】中是我的点评):
What we really need to do is look at the state of research in this country.【这句话说到点子上了。】 Also, maybe if we had a more solid economic base, one in which we solve the trade imbalance by exporting real goods rather than copyrights, we could spend more money on science and supercomputing. Oh well, in your words, "who am I kidding?" 【这句话就说明上段评论是酸葡萄心理了。】
China is way different from Japan. For starters, it has resources, and it can play the game any way it wants to. Japan could only play hardball (采取强硬态度) economically. China can at any time choose to overrun Korea and Taiwan at any time if they choose to, and the only recourse would either be a hard fought conventional war, or a nuclear exchange.
China can fight dirty(下黑手). Japan cannot. And China is good at fighting dirty, because they "won" two wars (Korea and Vietnam) by proxy, sending in men and materials to do what the native population couldn't. If China chose to, they could easily turn up the heat in other areas hostile to the US by sending in troops and munitions. China could hand Iran the tools to seize control of the Strait of Hormuz and there would be nothing the US could do about it except engage in another theater of war which would be unwinnable. 【看来这哥们对景德镇政府的成见很深啊】
Would there be a benefit to putting the fastest computer in the fastest train?
Hmmm.... if the train was going fast enough for relativistic effects to kick in, then this would make the computer *even faster*. You, sir / ma'am, are brilliant! 【这哥们的回答很无厘头】
we went to the moon during a period of nationalist chest thumping, and when the nationalist chest thumping subsided, we haven't been back. countries that are interested in nationalist chest thumping: china, india, etc, are still pumping up their space programs
what i am saying is, for all the evils of nationalism, scientific advancement in the realm of large projects seems to be a positive byproduct【至理名言啊!自建镇以来,我景德镇的所有的重大科技成果,那个不是副产品?记得大学期间,一位东南大学的老教授去给我们做讲座,回忆起当年许世友主政南京军区时,逼着他们在极端恶劣的环境下没日没夜的搞永动机,老教授唏嘘不已……】
for example, if we were still in a cold war with the ussr in the 1990s, i will bet you anything that this would have been completed and would be producing amazing science at this point in time:http://en.wikipedia.org/wiki/Superconducting_Super_Collider [wikipedia.org] 【在我景德镇,这种例子俯拾皆是】
对于天河-1A是否是世界上最快的计算机,我不敢妄下结论,但可以肯定的是,天河-1A肯定是比上一代取得不小进步的,因此向工作在这个项目上的最底层的同志们致敬,道一声“你们辛苦了!” 活永远是你们这些基层人的来干,油水永远是领导们捞,功劳和荣耀永远是属于领导的,出了问题责任永远是你们的——这是景德镇的传统。
最近一直习惯用Chrome打开多个网页,时间一长,就发现硬盘一直在高速旋转。一开始以为是公司的监控软件的原因,就忍了。知道今天早上,电脑持续很长时间的没反应之后,弹出对话框说某个plug-in一直在运行……当时只有Chrome浏览器在工作,这个plugin只可能是Chrome的…… 关掉chrome后,硬盘还是高速旋转,打开任务管理器,发现还是有很多chrome进程在运行,很明显这些是跑飞了的chrome进程了。
杀死所有chrome残留进程之后,我重新打开chrome浏览器,打开几个tab,对比Windows任务管理器、chrome任务管理器,发现了一些有趣的现象:
Chrome运行时截图
Windows任务管理器中的Chrome进程
Chrome任务管理器中的Chrome进程
可以看出:
等将来有时间时,好好研究一下这些问题。
-----------------------------------------------------------------------------------------------------------
Update: 2010-100-26
Chrome 8 dev升级到8.0.552.11已经有一段时间了,虽说该升级版本已经修复了一些Chrome进程僵死的bug,但运行时间一长,该问题还是会出现的。
早晨你一睁眼,发现早已天光大亮,不禁疑惑为什么手机的闹钟没有响。爬起来打开手机一看,满屏八糟的英文字母——Oh, my god,你的手机怎么了?!凭着自己几年程序员的经验,匆匆瞥一眼最后一行的提示,按下<Home>键,满屏的英文字母变成了一个巨大的惊叹号,然后就无论你怎么操作都不再有反应了……病毒?系统崩溃?还是硬件错误?
你略加思索,然后打开手机后盖,拆掉电池然后重新装上,开机,终于等来了久违的“HTC”这三个字母。你沾沾自喜,大多数软件问题都可以通过重启系统解决……“HTC”这三个字母很快就变成了Sprint的开机动画——你的手机是水货,Sprint定制的HTC的EVDO Android手机——当你的信息更加坚定之时,突然手机左上角的提示等闪了两下,整个屏幕黑暗了……
你重新开机,重新看到HTC,重新看到Sprint,这次还看到了Android的小机器人,你开始紧张,左上角的红灯又闪了两下,屏幕再次变暗……反复几次,重启并没有解决问题……OMG,花几千块钱刚买了不到一年的手机竟然无法开机!你抓狂了……
中秋那天你陪你老婆去天安门看巨型牡丹,拍照时你那素有“破坏之王”美誉的老婆把你的手机摔了一下——一下摔倒了手机的右下角和右上角——感谢毛爷爷,你的手机捡起来还能继续用。是的,是能用的,因为昨天晚上你还用它给你妈妈打电话。但会不会是因为摔了那一下把某个芯片的焊点摔松了,尽管当时能work,时间一长就脱焊了?很有可能。
不管是不是硬件的问题,你都得先试试通过软件能不能修复——这也是你唯一有可能控制的东西。你想按一下<Reset>回复到出厂设置,但你又担心这样一来不仅删除了所有已经保存的信息,而且由于中美CDMA手机之间的差异,这手机必须得破解、写号之后才能用,而这,是非常恐怖的事情……好在你终于还是无法找到那个<Reset>小孔,否则你很难保证能战胜心中按下它的欲望。
看来这手机只能慢慢修了。可是你最近又非常忙,忙工作,忙自己的事情,根本没时间也没心情去搞一部坏了的手机。即使有了时间有了心情,你对于Android只有一个肤浅的认识,怎么进入debug模式都不知道,又谈何修复?于是你的头越来越大……
好在还有去年的一部旧手机可以用,虽说破了点,但能打电话,将就一下吧。你翻箱倒柜把它找出来,插上卡,开机,果然还能用。
你稍稍冷静了一下,边洗脸刷牙边考虑接下买什么手机……HTC的?算了,坏了的这个就是HTC质量的写照,本来去年就是本着支持国产(虽说HTC是台湾的企业,但你坚信台湾是中国不可分割的一部分,因此你对所有的台资企业和大陆企业一视同仁)品牌和Google去买的这款手机。Moto?高端的贵了点,低端的差了点。Nokia、三星直流不予考虑。iPhone?贵了点,还得换运营商,而且那两家运营商的资费都很不靠谱,还三天两头骗我们,算了……要不就还是先用这个能用破手机,然后等iPad2出来买个iPad吧,反正买智能机也不过就是为了能在漫长的等待的过程中看电子书,比如等班车的时候,等着下车的时候,等着上菜的时候……
吃早饭的时候,你决定边吃饭边再做一下最后的努力来看看那个HTC的手机能不能修复。你又重启了两次,还是那个样子。突然,你意识到,左上角红灯闪的时候,都是电池没电的征兆……可这手机是昨天晚上才充好电的啊……你试着插上电源,开机,你成功了!
于是你终于搞清楚了问题的所在:昨晚睡觉前,你的手机还可以正常工作,可是在夜里不知道某个时候,手机的某个程序崩溃了,这就是你今早第一次开机时看到的满屏英文字母要说的事情……这个问题应该是可以通过重启系统解决的,可由于昨夜系统崩溃后,手机的电源控制模块不能正常工作,很快就把手机电池的电耗光了,于是今天早晨你每次开机的时候,都只能开到一半,因为系统检测到剩余电量不足,就强行关机了。
本来是个非常简单的问题,而你的惯性思维斗了一个大大的圈子,才发现其本质所在。你应该庆幸,你也有了经验,不再是乳臭未干的小子。你应该悲哀,因为不知道什么时候,你就会为你的思维定势所累。
The meaning of $* and $@ is identical when not quoted or when used as a
parameter assignment value or as a file name.
However, when used as a command argument, "$*" is equivalent to "$1d$2d..." , where d is the first character of the IFS parameter, whereas "$@" is equivalent to "$1"
"$2" ....
1. Create a new VM (clone2) without a disk equipped.
2. Use the VM tool to clone the disk from
the existing VM to the new VM. Usually, you can find all the VMs in the /vmfs/volumes/datastore1/.
vmkfstools -i /vmfs/volumes/4c3b50b8-d57dc2fc-d2b7-00241d1852fa/Test_wjh/Test_wjh.vmdk /vmfs/volumes/4c3b50b8-d57dc2fc-d2b7-00241d1852fa/clone2/disk1.vmdk
3. On the client add the cloned disk to the
VM clone2
“edit settings… -> Harware -> add “hard disk” -> “using
existing virtual disk” -> find the “disk1.vmdk” and choose it.
4. Power on the VM.
[Warning]:
由于realplayer在Linux下只能通过realplay*.bin来安装,装好后不能通过yum或rpm卸载。现在的realplayer已然成为名副其实的垃圾软件,Linux下尤其如此。
卸载它的办法就是通过locate realplay命令找到所有realplay相关的文件,然后统统删除之!
realplayer=$(locate realplay)
echo $realplayer
rm -rf $realplayer
今天看到这样一篇博文:在iPad上也能用Windows下的应用?我能!
对于文中介绍的可以在iPad上也能用Windows软件的Splashtop Remote很感兴趣,因为传说Chrome OS也会用类似的机制来解决Windows软件的兼容问题,即“一部分运行在PC上,起daemon的作用,另外一个运行在iPad上,跟PC的软件进行通信,使用户能够控制或管理PC上的软件程序和数据。” 这应该和VNC起的作用类似。
估计iPad和即将发布的gPad(Chrome OS Tablet)乃至Android Pad们很快就会利用这种方式开拓市场,甚至蚕食PC市场了。试想如果将来有公司(比如这个DeviceVM)推出一项服务(可以免费,也可收费),为用户提供现成的Windows应用,而用户所需要做的就是在iPad或gPad上安装Splashtop Remote,打开这个应用就可以自动连接到DeviceVM的Windows PC/Server,利用现成的Windows程序了——省去了自己购买并维护PC的很多麻烦,节省了购买大量Windows软件的开支,何乐而不为呢?而且这也正契合了时下的云计算潮流。
我能想到的问题是,这种方式使用Windows软件的体验会不会大打折扣?因为在使用VNC登录到Mac OS X的时候,即使在局域网内,图像质量很差,操作很不流畅。也许像Splashtop Remote这样的应用可以保证图像的质量,但是网络本身也会成为一个瓶颈,尤其是3G网络。看来在LTE普及之前,这种应用只能使用WIFI了。
顺便到Apple App Store里看了一下,发现了几张官方的截图,可以看出,图像质量还是有一定的损失的:
Tcl/Expect中利用exec调用稍微复杂的shell命令时,经常会遇到一些小问题,常见的就是pipeline(|)和awk。
Tcl/Expect调用多个shell命令并使用|将其串接在一起时,需要注意的是必须在"|"前后加上空格" ",否则tcl/Expect会报奇怪的错。
Tcl/Expect调用awk命令时,需要把awk的' '中的命令改为用" ",并把$1, $2之类的变量改为/$1, /$2。
下面的ksh命令判断test_process是否在运行:
ps -fu bonny|grep -v ps|grep MMCAP|grep -v grep|awk '{print $2}'
改为Tcl/Expect后,为:
exec ps -fu $myname | grep -v ps | grep COOLrunMMCAP | grep -v grep | awk "{print /$2}"
另外, http://www.linuxquestions.org/questions/linux-software-2/ksh-tcl-173092/ 列出了一些ksh命令转换为tcl语句时经常遇到的问题(本人未曾验证过,请谨慎使用)。
Here's some conversion rules that I have proven, if anyone has any more info ( in any fashion ) , please advise.
-----------------------------------------------------------------
Rule: Remove "
-----------------------------------------------------------------
ksh: cat *.passwd 2>/dev/null | cut -d":" -f1 | sort | uniq
tcl: exec cat *.passwd 2>/dev/null | cut -d: -f1 | sort | uniq
-----------------------------------------------------------------
-----------------------------------------------------------------
Rule: Replace '(..$1..)' with "{../$1..}"
-----------------------------------------------------------------
ksh: ps -eaf | awk '(print $1}' | grep $1 2>&1
tcl: exec ps -eaf | awk "{print /$1}" | grep $user_login_to_test
-----------------------------------------------------------------
-----------------------------------------------------------------
Rule: Replace "..." with {...}
-----------------------------------------------------------------
ksh: grep "^$(user_login:" /etc/passwd /etc/shadow 2>&1
tcl: exec grep {^$user_login:} /etc/passwd /etc/shadow
-----------------------------------------------------------------
-----------------------------------------------------------------
Rule: Replace '...' with "..." or {...}
-----------------------------------------------------------------
ksh: grep 'Version' user.tcl
tcl: exec grep {Version} user.tcl
tcl: exec grep "Version" user.tcl
-----------------------------------------------------------------
还有就是http://wiki.tcl.tk/1039列出了使用exec的一些常见问题。
我一直以为在Expect中一旦执行send之后,expect_out(buffer)就会被清空,直到有新的数据被填入,而恰恰就是这些数据被用在expect语句中。而今天在调试时发现的问题却令我大吃一惊,原来expect_out(buffer)不会被自动清空,而expect到的数据很可能不是你真正想要的,非常有可能是历史数据。"expect_out(buffer) has the content of the previous send" 一文也指出了这个问题。
set prompt "#" set lockfile "/root/tmp/.cool.lock" send " if /[ -e $lockfile ]; then cat $lockfile else echo /"COOLID: $coolid/" > $lockfile echo DONE! fi /r" sleep 1 ;# necessary expect { timeout { puts stderr "WARNING: $ME: cannot verify if the Linux AP is locked by other COOL session!"; exit 2; } -re "COOLID: (/[1-9](/[0-9])*).*$prompt" { puts stdout "expect_out(buffer)=$expect_out(buffer)" puts stdout "expect_out(0,string)=$expect_out(0,string)" puts stdout "expect_out(1,string)=$expect_out(1,string)" puts stdout "expect_out(2,string)=$expect_out(2,string)" puts stdout "expect_out(3,string)=$expect_out(3,string)" } "DONE!" ;# do nothing }
[root@bjvsmcl05 ~]# expect_out(buffer)= Last login: Fri Jul 23 09:32:13 2010 from bjbldd [root@bjvsmcl05 ~]# [root@bjvsmcl05 ~]# if [ -e /root/tmp/.cool.lock ]; then > cat /root/tmp/.cool.lock > else > echo "COOLID: 68" > /root/tmp/.cool.lock > echo DONE! > fi COOLID: 1234 [root@bjvsmcl05 ~]# [root@bjvsmcl05 ~]# expect_out(0,string)=23 09:32:13 2010 from bjbldd [root@bjvsmcl05 ~]# [root@bjvsmcl05 ~]# if [ -e /root/tmp/.cool.lock ]; then > cat /root/tmp/.cool.lock > else > echo "COOLID: 68" > /root/tmp/.cool.lock > echo DONE! > fi COOLID: 1234
set lockfile "/root/tmp/.cool.lock" send "cat $lockfile/r" expect { -re "COOLID: (/[1-9](/[0-9])*)" { puts stdout "expect_out(buffer)=$expect_out(buffer)" puts stdout "expect_out(0,string)=$expect_out(0,string)" puts stdout "expect_out(1,string)=$expect_out(1,string)" if { [string compare $expect_out(1,string) $coolid] } { puts stdout "ERROR: $ME: $pcname has been reserverd by COOL session $expect_out(1,string), please choose another Linux PC instead./n" exit 2; } } "cat: $lockfile: No such file or directory*" { send "echo /"COOLID: $coolid/" > $lockfile/r" } }