Tk send

send is a Tk command used to execute a command in a different application. This send communication mechanism is limited to applications running on one display. Multiple screens on one workstation still count as the same display on X.

In order to use send in your program, you should

    1. use command winfo interps to find out all the names of Tk applications reachable with send.
    2. to get the real name of a spplicaiton, using tk appname <application>.
    3. run tcl command remotely by send [tk appname <application>] <command>.

------------------
Reference:

  1. send manual page: http://www.tcl.tk/man/tcl8.4/TkCmd/send.htm
  2. Practical Programming in Tcl and Tk(4th edition)

How to change the character case in ksh?

1. To change lower case characters to upper case, you can

echo abc | tr "[a-z]" "[A-Z]"

or 

echo abc | tr '[:lower:]' '[:upper:]'

2. To change upper case characters to lower case, you can

echo ABC | tr "[A-Z]" "[a-z]"

or

echo ABC | tr '[:upper:]' '[:lower:]'

rup:: RPC: Program not registered in RHEL6.1

I just installed Redhat Enterprise Linux 6.1 on one HP server. Following error met when rup it on other servers:

[sourcecode language="text"]
$rup coolnjmcl033
rup:coolnjmcl033: RPC: Program not registered
[/sourcecode]

SOLUTION:
1) check if all nfs related services are working:

[sourcecode language="text"]
[root@coolnjmcl033init.d]# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 875 rquotad
100011 2 udp 875 rquotad
100011 1 tcp 875 rquotad
100011 2 tcp 875 rquotad
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 2 tcp 2049 nfs_acl
100227 3 tcp 2049 nfs_acl
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100227 2 udp 2049 nfs_acl
100227 3 udp 2049 nfs_acl
100005 1 udp 51310 mountd
100005 1 tcp 60605 mountd
100005 2 udp 42799 mountd
100005 2 tcp 44201 mountd
100005 3 udp 49544 mountd
100005 3 tcp 49098 mountd
100024 1 udp 37035 status
100024 1 tcp 60898 status
100001 3 udp 1008 rstatd
100001 2 udp 1008 rstatd
100001 1 udp 1008 rstatd
[/sourcecode]

If there is no running rstatdservice , start it byservice rstatd start.
Accordingto RHEL 6 RUP manual:

[sourcecode language="text"]
rup: RPC: Program not registered
[/sourcecode]

The rpc.rstatd(8) daemon has not been started on the remote host.

2) check if package rusers-server-*and rusers-* are installed: rpm –qa|greprusers. If not, install it and then restart service rstatd.

PS:
Other userful commands:
[sourcecode language="text"]
rup localhost
service rstatd status
[/sourcecode]

C++filt

c++flit decodes(demangles) low-level names into user-level names so that the linker can keep these overloaded functions from clashing.

You may use c++filt to demangle the symbols.
[sourcecode language="text"]
$ c++filt _ZNSt8ios_base4InitD1Ev
std::ios_base::Init::~Init()
[/sourcecode]

You may try adding-lstdc++ to your link command to resolve the issue.

c++filt manual

What's the differences between virtualization and cloud computing?

Many people will be confused by the relations and differences between virtualization and cloud computing. Following essays will clarify the nature of the two technologies.
1. Cloud is an operations model, not technology: http://news.cnet.com/8301-19413_3-10249486-240.html
2. Difference Between Virtualization and Cloud Computing: http://data-centers.in/virtualization-and-cloud-computing/
3. The Difference Between Virtualization and Cloud Computing: http://www.erpsoftwareblog.com/2010/08/the-difference-between-virtualization-and-cloud-computing/

如何在Gmail中搜索特定时间段的邮件

由于众所周知的原因,在天朝登录Gmail时越来越困难了,但是很多以前的邮件都还在,时不时还需要翻一翻,如何搜索特定时间段的邮件呢?

答案就是在Gmail的搜索框中输入after:或者/和before:, 如 “after:2007/07/31 before:2007/12/31”就是搜索2007年7月31日之后12月31日之前的邮件。

Steve Jobs的家庭教育

从CBS对Walter
Isaacson的采访
来看,Steve Jobs小时候的家庭教育还是很成功的,虽然他的养父母都没有受过高等教育,但他们懂得如何教育一个(被收养的)小孩子,如何培养他正确的人生观和价值观。反观我们的童年,这些大多是缺失的。

1. 追求完美

ISAACSON BELIEVES THAT MUCH OF IT CAN BE TRACED TO THE EARLIEST YEARS OF HIS LIFE, AND TO THE TO THE FACT THAT JOBS BORN OUT OF WEDLOCK, GIVEN UP BY HIS BIRTH PARENTS, AND ADOPTED BY A WORKING CLASS COUPLE FROM MOUNTAIN VIEW, FROM MOUNTAIN VIEW, CALIFORNIA. 

WALTER ISAACSON: Paul Jobs was a salt-of-the-earth guy who was a great mechanic. And he taught his son Steve how to make great things  And he--once they were building a fence. And he said, "You got to make the back of the
fence that nobody will see just as good looking as the front of the fence." Even though nobody will see it, you will know, and that will show that you're dedicated to making something perfect." 

2. 培养自信

JOBS ALWAYS KNEW HE WAS ADOPTED, BUT IT STILL HAD A PROFOUND EFFECT ON HIM. HE TOLD ISAACSON THIS STORY FROM HIS EARLY CHILDHOOD DURING ONE OF THEIR MANY TAPED INTERVIEWS:

STEVE JOBS TAPES: I was, I remember right here on my lawn, telling Lisa McMoylar from across the street that I was adopted. And she said, “So does that mean your real parents didn't want you?” Ooooh, lightning bolts went off in my head. I remember running into
the house, I think I was like crying, asking my parents. And they sat me down and they said, “No, you don't understand. We specifically picked you out.

WALTER ISAACSON: He said, "From then on, I realized that I was not — just abandoned. I was chosen. I was special." And I think that's the key to understanding Steve Jobs.

Steve Jobs的英文版自传目前还没买到,我的iTunes帐号只能在中国大陆使用,期盼过些天能够有办法。由于Steve Jobs的语言十分生动灵活,Walter Isaacson 的文体严肃认真,估计直接阅读英文版还是会很有一些障碍的,但那应该是学习好的英语的一种不可多得的机会。

What's+the+difference+between+virtualization+and+cloud+computing?

在很多资料或文献中很难找到虚拟化和云计算的区别,甚至连云计算是什么都颇有争议。在网上找到几片论述这一问题的文章,摘录于下。

1. Cloud is an operations model, not technology: http://news.cnet.com/8301-19413_3-10249486-240.html

2. Difference Between Virtualization and Cloud Computing: http://data-centers.in/virtualization-and-cloud-computing/

3. The Difference Between Virtualization and Cloud Computing: http://www.erpsoftwareblog.com/2010/08/the-difference-between-virtualization-and-cloud-computing/

================================================================================================

1. Cloud is an operations model, not technology: http://news.cnet.com/8301-19413_3-10249486-240.html

One of the most common questions I get from those exploring cloud computing for the first time is "what is the difference between cloud computing and virtualization?" It is an excellent question, as most IT departments are currently exploring the ways in which virtualization enables
automation and provisioning agility. Given the fact that cloud is often touted for providing similar benefits, it can be confusing to understand why the two terms aren't equivalent.

My response to that question requires a bit of explanation, so let's step through the differences between the two concepts.

Virtualization is a technology.

(Credit:
CNET/James Urquhart)

When you run software in a virtual machine, the bits that represent the program's instructions run through a layer of software that "pretends" to be a dedicated server infrastructure, the hypervisor. The hypervisor is the heart and soul of server virtualization,
and is the enabler of the consolidation and agility values that virtualization brings to the data center.

It is because of the hypervisor that virtualization is the true disruptive technology that enables cloud computing on a massive scale. Hypervisors allow servers to be multi-tenant without rewriting applications to be multi-tenant. Hypervisors allow operating
systems and applications to install to a consistent hardware profile, even though they end up running on a variety of actual physical system implementations. Hypervisors also allow servers to be manipulated by software APIs, which greatly simplifies the act
of automating IT operations.

Cloud computing is an operations model, not a technology.

When you run an application in a public or private cloud, there is no "cloud layer" that your software must pass through in order to leverage the physical infrastructure available to it. In the vast majority of cases, there is probably some virtualization involved,
but the existence of hypervisors clearly does not make your data center resources into a cloud. Nor is the fact that Amazon
EC2
 uses Xen hypervisors the reason that they are a cloud.

What makes a cloud a cloud is the fact that the physical resources involved are operated to deliver abstracted IT resources on-demand, at scale, and (almost always) in a multi-tenant environment. It is how you use the technologies involved. For the most part,
cloud computing uses the same management tools, operating systems, middleware, databases, server platforms, network cabling, storage arrays, and so on, that we have come to know and love over the last several decades.

Specific technologies, of course, gain significant importance in a cloud computing environment, such as policy-driven automation, metering systems, and self-service provisioning portals. However, all of these technologies--with the possible exception of the
self-service portal--existed before cloud computing became a much hyped paradigm.

There is no doubt cloud borrows much from long established technologies. It is also true that cloud has borrowed from many long standing operations models, such as mainframe service bureaus. However, the combination of on-demand, at scale, in a multi-tenant
infrastructure is relatively unique for the post client-server era, and is the reason why cloud computing is disruptive, rather than just another operations fad.

----------------------------------------------------------------------------------
2. Difference Between Virtualization and Cloud Computing: http://data-centers.in/virtualization-and-cloud-computing/
Cloud Computing and Virtualization are completely two different technologies. Both of them are considered as future saving technologies and that is the only similarity between them.
In the process of Cloud Computing easily scalable and mostly virtualized data resources are provided to the users over the internet. Using Cloud computing colocation provider or Data Centers providers offer managed IT services via a hosted software as a service
model. In Cloud Computing a database can be physically located somewhere in secure remote location and data can be accessed through clients computer using the database server to analyze and recover the data. This eliminates the need of a costly in-house equipments
and department. Cloud Computing make use of virtualized resources such as servers, computing devices and networks. Cloud Computing provider own the hardware and the providing host manage all the services to the clients according to their usage basis. On the
other hand Virtualization is creating virtual versions of technologies like servers, operating system, network resources and storage devices. Virtualization basically enables a single user to access multiple physical devices. In virtualization, either its
one operating system using multiple computers to evaluate database or a single computer controlling several machines. Here we will learn how Cloud Computing and virtualization are different from each other.

Cloud
Computing

The easily availability of computers has opened new doors in the field of information technology. Instead of creating own Data Center all the Data Center services can be acquired from IT server providers with outstanding IT infrastructure which is strong, flexible
and safe. The cost which either wise would have been invested in building a Data Center can be avoided with acquiring related services on a usage basis. Fees for the managed IT services is similar to the operating costs of a Data Center. Cloud Computing seems
attractive option, since it cuts a lot costs and also remove operating costs. In a traditional IT department equipments and staff are occupied in the peak hours, however in off hours they sat idle. Most of the servers are not operable in off hours, even when
they are operational its not necessary that they are giving their 100% of their potential. Also a Data Center services provider also needs to upgrade latest technologies in order to keep the data safe and secure. On the other side these services are provided
by Cloud Computing provider.

Virtualization

There are many types of virtualization, but all of them focus on usage format and control that improves efficiency. What this efficiency means is a single task running over multiple computers through unoccupied computer or a single terminal running multiple
tasks. One more advanced advantage of virtualization is hosting an application to many users, thus preventing several needed software’s from being installed again and again. Data is combined into a central computer from databases, hard drives and USB drives.
This process increase security and accessibility by using replication. In an IT company physical resources can be divided into many virtual networks allowing the Central IT resources to be available to all the departments via local networks. Computer devices
which are allocated to individual staff members or which are only dedicated to a specific software application are highly efficient and they are much more cheaper.

-----------------------------------------------------------------------------------------------------------

3. The Difference Between Virtualization and Cloud Computing: http://www.erpsoftwareblog.com/2010/08/the-difference-between-virtualization-and-cloud-computing/

Brittany Meeks, Dynamics GP Sales and Marketing Assistant

As a newbie sales and marketing assistant at Custom
Information Services
, I kept getting thrown technical terms that I was unable to grasp.  That is until I did some research and discovered the easy way to understand and implement such terms or questions as, “What’s
the difference between virtualization and cloud computing?”
  Originally, I couldn’t even tell you the meaning of virtualization or cloud computing, let alone what the differences were.   Since we implement and support these technologies I had to understand
the definitions quickly!

Virtualization is a computing technology that enables a single user to access multiple physical devices.  Another way to look at it is a single computer controlling multiple machines, or one operating system utilizing multiple computers to analyze a database. 
Virtualization may also be used for running multiple applications on each server rather than just one; this in turn reduces the number of servers companies need to purchase and manage.  It enables you to consolidate your servers and do more with less hardware. It
also lets you support more users per piece of hardware, deliver applications, and run applications faster.  Follow this link for more detail on virtualization VirtualizationWhitePaper.pdf

Cloud computing offers scalable infrastructure and software off site, saving labor, hardware, and power costs.  Financially, the cloud’s virtual resources are typically cheaper than dedicated physical resources connected to a personal computer or network. 
With cloud computing, the software
programs
 you use aren’t run from your personal computer, but  rather are stored on servers housed elsewhere and accessed via the Internet.  If your computer crashes, the software is still available for others to use.  Simply, the cloud is a collection
of computers and servers that are publicly accessible via the Internet.  Here is something else I found online which may be helpful in better understanding cloud servicesMicrosoft
Cloud Services.pdf

One way to look at it is that virtualization is basically one physical computer pretending to be many computing environments whereas cloud computing is many different computers pretending to be the one computing environment (hence user scaling).  Virtualization
provides flexibility that is a great match for cloud computing.  Moreover, cloud computing can be defined based on the virtual machine containers created with virtualization.  Virtualization is not always necessary in cloud computing; however, you can use
it as the basis.  Cloud computing is an approach for the delivery of services while virtualization is one possible service that could be delivered.  Large corporations with little downtime tolerance and airtight security requirements may find that virtualization
fits them best.  Smaller businesses are more likely to profit more with cloud computing, allowing them to focus on their mission while leaving IT chores to those who can do more for less.

Plainly, virtualization provides more servers on the same hardware and cloud computing provides measured resources while paying for what you use.  While it is not uncommon to hear people discuss them interchangeably, they are very different approaches to solving
the problem of maximizing the use of available resources.  They differ in many ways and that also leads to some important considerations when selecting between the two.  Not only do we offer Dynamics
GP,
 but we also offer services for cloud and virtualization for your business applications.   Our new website set for a September go live will have more information on this subject.

帮主远行,智慧永生

1. 硅谷海盗

2006年年底我开始关注科技尤其是IT新闻,间或看到一些关于Apple的新闻,当时并没有太深的印象,甚至连iPod是神马都没搞特别清楚。

2007年1月初看到一些新闻风传Apple即将推出智能手机,当时仍然感到莫名其妙——手机都已经人手一部了,有什么特别的。那个月的月底,iPhone发布了,看到了iPhone的demo,很是吸引人,但仍然不清楚业界为何视其为划时代的产品。

2007年另一件记忆深刻的事情是第一次看到了《硅谷海盗》(The Pirates of
Silicon Valley)。其实当时是受《加勒比海盗》的影响,对海盗片非常感兴趣,在网上看到
《硅谷海盗》中有“海盗”两个字,就下了。下完一看这电影一开场就是比尔.盖茨和鲍尔默等人打牌泡妞的镜头,很黄很暴力,当时的我很喜欢。直到看完之后才明白,原来该片的主角不是比尔.盖茨,而是一个叫Jobs的人,这个人是Apple公司的创始人,心里有些失望。由于当时鄙人孤陋寡闻,只知道比尔.盖茨牛X的不得了,全然不知原来盖茨当初竟然是Jobs的小弟(后来看到2007年D5上Steve Jobs和Bill Gates两个人的采访,更加深了我的这种感觉——盖茨虽然比乔帮主年长两岁,但在帮助面前一副谦卑的姿态,而乔帮主尽显老大风范,即使是在1997年Apple濒临破产有求于微软的时候)。由于《硅谷海盗》中的Steve Jobs风流倜傥,我开始留心Apple的一些新闻。

后来偶然的机会在网上看到了apple4.us,看了一些关于Apple以及乔帮主的很有深度的文章,很长一段时间apple4us是我每日必上的网站,再后来我的Google
reader中添加的第一个网站就是它。正是apple4us,这个国内差不多资历最老的果粉网站,让我了解并接受了Apple或者说Steve Jobs的世界观和方法论。

2008年第一次看到Steve Jobs在Stanford毕业典礼上的演讲的中文版,很是震撼,但当时视野狭窄,理解不够深刻,花前月下,乔帮主引用的“Stay hungry. Stay foolish.”的箴言也仅止于思想层面的震撼而已,没有什么实际行动。

关于Apple和Steve Jobs的文章看多了,才逐渐明白现实中的Steve Jobs和《硅谷海盗》中所描述的相去甚远:他深谋远虑,绝非意气用事,即使是在年轻气盛的时候(参见Playboy1985年对Steve Jobs的采访);他笃信佛教,奉行鱼素主义,绝不自我放纵;他执着认真,勤奋努力,绝非像电影中描绘的纨绔子弟的形象…… 每次观看《Think Different》,每次重读《Thoughts on Flash》,每次分析Steve Jobs对Andoid平板电脑的批评,无不为帮主的才华所深深折服。

尤其是从去年起喜欢上了Daring Fireball,John Gruber的分析往往令人拍案叫绝。尽管仔细想来他的分析未必符合Apple或者Jobs的事实,但实在很难找出对Apple和Steve Jobs的很多决定的更好的解释。考虑到乔帮主素有“偷”别人idea的名声(参见《史蒂夫·乔布斯传》摘要首发:与伊夫二重唱),已经很难分辨哪些想法是他自己原创,哪些是和别人一起碰撞的火花,因此与其纠结于Steve Jobs是否原创了某个想法,毋宁把Steve Jobs和他的团队视为一个整体,而Jobs毋庸置疑是这个团队的灵魂。只有强大如斯、睿智如斯、固执如斯、挑剔如斯、努力如斯的人,才能掌控整个团队,激发出所有人的潜力,创造出最伟大的产品

今天上午又仔细看了一遍Jobs在D8(2010年5月份)上的采访,在身体极度虚弱之时反应仍如此迅速,对一些观点的反驳仍如此犀利,脾气仍如此火爆,着实令人叹服。从某些意义上讲,他无愧“硅谷海盗”的称号,他是硅谷的Jack
Sparrow。

2. 佛教徒

年轻时一次印度之行使他成为一名虔诚的佛教徒,而且信奉的是禅宗。至于他是如何禅修的,我们不得而知。记得1985年花花公子对他的采访中,他描述了在印度的一个遭遇:当地一个非常著名难得一见的大师见到他之后突然大笑,一把拉住他把他拖到山顶上给他剃头(参见:花花公子1985年采访乔布斯:相信电脑可改变世界)。如果这个故事是真的(对于早年Jobs讲的故事,还是应保持警惕),那位大师肯定看出他有佛缘。

Jobs参悟的应该是日本的禅宗,应该不是中国的,因为他一生不肯踏上中国的国土,而日本却去过多次,还在日本机场发生过不愉快而发誓再也不去日本。我至今仍无宗教信仰,对佛教也了解不多,但禅宗的思辨领教过一二,确实能开拓人的思路。

印度有一句老话:'生命中的前30年,你培养了习惯;后30年,习惯培养了你。'”1985年的Jobs如是说。——我后年也即将30,却还没有培养出好的习惯。

我认为禅给Jobs最大的帮助就是个人修为,不断的自我反省自我改造,不断的探求生命以及事物的本质。李开周(不是李开复的弟弟)在微博中说两年前我修过一段不净观,观想自己慢慢腐烂,从后脑勺烂到小命根儿,全身骨骼根根外露,白森森亮闪闪;也参过话头,咬住“腿疼的这个家伙到底是谁”不放。但效果都很差,因为缺恒心,更缺信心。唯一的收获是,发现打坐(修不净观和参话头都打坐,当然也可以不打坐)确实是最能让人“收放心”的动作。”,个人没研究过,但禅修的意义可见一斑。

其实Jobs最能让我联想起来的一个中国人是曾国藩。个人感觉他们有很多的共性,最大的共同点就是能够认识自己,改造自己。另外的共同点就是:坚持、努力、有领导魅力、有远见、工于心计、善于玩弄策略(曾的更像权术)、失败过、影响了几代人…… 还有一个有意思的共性就是他们小时候学习都不好:曾是出了名的笨小孩(参见南京师范大学郦波副教授在《百家讲坛》所讲的《曾国藩家训》);Jobs也是淘气鬼,直到小学四年级碰到了一位好老师才有所好转(具体故事不甚了解,期待Walter Isaacsson的Steve Jobs传记)。

随着年纪越来越大,越来越发现改变自己是何其困难,尤其是改掉多年的习惯。我崇拜任何能都改变自己的人。何况有些人能都修行一生。

3. 工心计

也许是受水果教一般信徒的影响,我对于那些几近阴谋论的Apple产品策略分析文章非常喜欢。最新的一篇大爱就是John Gruber的Thoughts
and Observations Regarding This Week’s iPhone 4S Event, Written Almost Entirely Before Wednesday’s Sad News, But Which the Time Has Come to Publish Because Life Goes On

纵观关于Jobs生命最后时光的报道(还是期待Walter Isaacsson的Steve Jobs传记),感觉Jobs直至生命的最后时刻,仍然牢牢掌控全局:2月份自感来日无多时便安排见诸多好友的最后一面,选择性接见,只有depend
on他的人才见,因为他不想浪费生命最后的时光去做对自己无意义的事情;2011年WWDC发布会前仍然在陪伴家人(参见
Universe
Dented, Grass Underfoot
, 我特地看了WWDC乔帮主的开场白,他的脚上的New Balance确实沾满草迹);重病期间请来保安护卫全家;去世前一天还在家蜷缩在一楼的角落里观看iPhone
4S的发布会,结束后嘴角露出一丝微笑(这么像小说?!);葬礼选择在死后的第二天匆匆举行……

一个重病缠身却能把自己生命的最后时光(很可能还包括身后好多年)安排的如此井井有条的人,是怎样的人啊?

估计唯一能与其匹敌的就是慈禧太后,死前22小时还毒死了光绪皇帝册立了溥仪。但Jobs所有的安排都是为了家人和朋友,而慈禧的安排纯粹为了自己,两相比较,高下立现。

4. 斯人已逝

我实在北京时间10月6日中午回北京的火车上听说Steve Jobs离世的。其实我个人这次并没有太大震动,不像年初看到他再度休病假的通知,不像看到他参加Obama的晚宴的照片,不像看到他辞去CEO后网上流传的那张瘦骨嶙峋的照片那般。对于一个罹患胰腺癌(方舟子坚称Jobs身患胰腺肿瘤而非胰腺癌,期待他的自传中能给出答案),经历过肝脏移植的人,饱受病魔侵扰7年的人而言,未尝不是一种解脱。

但他是Steve Jobs,Apple的灵魂。

其实硕士毕业工作3年多以后,作为一个程序员,作为一名普通员工,对于企业运营、资本运作之类的东西早已不感兴趣,哪些东西跟我实在太远。只有面向消费者推出的产品,才是我有可能买得起,享受的到的——如Apple的iPxd,Google的XXX等。Steve Jobs作为一名企业创始人和管理者,对于我这样的普通程序员,能够直接借鉴的技巧实在不明显,但是他的智慧,是留给全世界最有价值的遗产。

无论我明天做什么,Steve Jobs永远值得学习。

Struct sctp_event_subscribe Differs Between RHEL5 and RHEL6

Recently meet an SCTP issue: one product application running on MontaVista(kernel version 2.6.21) can't run on RedHat Enterprise Linux 5.5. After hours investion between millions lines  of  log file and source code, I finally noticed following error showed up: