Sun is to the end of life

As Euro Commi­ssion clears Oracle’s pro­po­sed acqui­si­tion of Sun Mic­ro­systems, this acqui­si­tion is much clo­ser to the end. And I don’t think Russia and China will place obsta­cles for this deal, and it will finish in seve­ral days.

It is so pity and sad to hear that bad news. As a stu­dent, I took the most memo­ra­ble inter­n­ship at Sun and dee­ply fell into love with Sun’s uni­que cur­ture. Without an open envio­r­n­ment and a technology-first ideo­logy, every engi­neer can obtain an immea­su­ra­ble free­dom around tech­no­logy, so Sun crea­ted a lot of new tech­ni­que. Java, Sola­ris, ZFS, DTrace, netBeans, JavaFX, Lesture, Sto­ra­ge­Tek, Clu­ster, Vir­tua­lBox, MySQL, Ult­ra­SPARC, xVM….. All of them is so great that can change our world. I wor­ked for Sun for 8 mon­ths, but I can­not reme­mber all of Sun’s mature pro­duct, because Sun owns such a lot of good pro­je­cts or products.

In my family, I deplo­yed a NAS (Network Atta­ched Sto­rage) Server under Open­So­la­ris. with ZFS suppo­r­ted, I can easily possess a good network server to store my per­so­nal and family data with a high relia­bi­lity and a good per­fo­r­mance. And I also deplo­yed subver­sion, SAMP (Solaris+Apache+MySQL+PHP), Dyna­mic domain bin­ding, remo­ting desktop and so on into my box, and I got a won­der­ful family system cen­ter with Sun’s pro­duct. I love it!

I will never for­get that time wor­king for Sun in my life. I love Sun forever.

Good luck to all the Sunners.

image

 

Sun­set.
1982–2010

  • Share/Bookmark
Posted on January 22, 2010 at 23:59 by paul · Permalink · Leave a comment
In: Sun · Tagged with: 

为cos-html-cache插件增加页面(Page)、标签(Tag)和分类(Category)的静态化功能

Wordpress的cos-html-cache插件为我们系统的静态化提供了非常好的解决方案,目前的版本是2.7.3。它可以将我们首页及文章(Post)进行静态化,使得访问速度大大提高,减少了服务器端的压力。不过对于页面、标签和分类,却似乎不太起作用,至少在我的服务器环境下(IIS7.0+FastCGI)是不行的。

为了能够实现它们,我分析了一下源代码,发现功能没有开启,但是可以实现的。具体修改方法及目的如下:

找到如下三行:

  1. if( substr_count($_SERVER[’REQUEST_URI’], ‘.htm’) || ( SCRIPT_URI == CosSiteHome) ){
  2. if(  substr_count($_SERVER[’REQUEST_URI’], ‘../’))  $is_buffer = false;
  3. if( !substr_count($buffer, ‘<!–cos-html-cache-safe-tag–>’) ) return  $buffer;

将他们分别做如下处理:

  1. 修改为:
    if( strpos($_SERVER[’REQUEST_URI’], ‘page’)==1 || strpos($_SERVER[’REQUEST_URI’], ‘tag’)==1 || strpos($_SERVER[’REQUEST_URI’], ‘category’)==1 || substr_count($_SERVER[’REQUEST_URI’], ‘.htm’) || ( SCRIPT_URI == CosSiteHome) ){
  2. 在本行下增加:
    if(  substr_count($_SERVER[’REQUEST_URI’], ‘comment’))  $is_buffer = false;
  3. 前面加上“//”注释掉本行

分别的原理及目的:

  1. 这个是在检测我们要静态化哪些文件,我为它增加了page、tag和category。当然,这个也和目录的模式有关,比如我的博客中,OpenSolaris的标签地址就是:http://www.priormind.com/tag/opensolaris。所以我就找到以tag开头的目录并静态化它们
  2. 防止评论内容被静态化
  3. 作者写了个函数,将singlepost(也就是单页页面)、首页都加上了一个安全标签(<!–cos-html-cache-safe-tag–>)。有这个标签的话将不被静态化。而我们需要它们静态化,所以就把这行注释掉好了

本人仅仅是尝试性修改,不保证其完全正确性。有兴趣的话大家可以试试看,呵呵。也欢迎一起交流。

  • Share/Bookmark
Posted on January 16, 2010 at 22:26 by paul · Permalink · Leave a comment
In: In My Opinion, WordPress · Tagged with: ,

How to configure Subversion in OpenSolaris

Recenly I am always thin­king about how to manage per­so­nal pro­g­rams, to save codes, to track chan­ges, and to ensure their safety. I combine two things toge­ther and get a solu­tion for my requi­re­ment, that is to use ZFS as per­si­stent sto­rage and use Subver­sion as a ver­sio­ning con­t­ro­ller, to ensure my codes can be safely saved and well mana­ged. So today I will talk some­thing about how to con­fi­gure subver­sion in OpenSolaris.

Read the rest of this post »

  • Share/Bookmark
Posted on January 13, 2010 at 22:47 by paul · Permalink · Leave a comment
In: Open Source · Tagged with: , , ,

转载:IIS FastCGI PHP 环境下搭建 WordPress

看到 Jerry Tao 在其博客上发表了一篇如何配置IIS7+FastCGI的文章,特转载过来学习。

Win­dows Server 2008 (SP2) + IIS 7
添加 Web 服务器角色,需要安装 CGI 扩展支持。

image

Read the rest of this post »

  • Share/Bookmark
Posted on January 12, 2010 at 20:04 by paul · Permalink · Leave a comment
In: Learn from Others, Web Back-end, WordPress · Tagged with: , ,

在OpenSolaris下动态绑定域名

在我前面的博客中,谈到了如何通过使用OpenSolaris和ZFS来实现家庭NAS(Network Atta­ched Sto­rage)网络数据中心的实现方法。对于我们很多人来说,仅仅在家中内部的局域网使用还是不够的,还希望家中的NAS能够发挥更大的作用,无论走到哪里,只要有网络,我们便能读取和存储数据到家中的NAS中。那样,我们最为重要数据就不必随身携带了。加上NAS系统的冗余性,我们就不必担心数据会丢失了。

今天想先来谈一谈实现这个想法其中比较关键的一步:绑定动态域名。在中国,我们的家用网络多半属于ADSL或小区宽带上网。这种上网的方式使得IP地址不是固定的,而是动态的。所以在家庭网络外部,我们是无法通过IP来识别并进入家用网络的。如果固定IP地址,花费的费用不菲,另外还要经历痛苦的备案过程。

其实现在已经有很好的解决方案了,比如花生壳Oray。前一阵子我也在使用oray来绑定自己的动态域名。特别是Oray和TP-LINK合作,在tp-link中已经内置了花生壳的程序,我们需要做的只是注册一个用户就好了。但花生壳不是很稳定,几次出现了断线无法连接的问题,而且一断就是好长时间(大于3小时)。这个让我无法忍受,所以我找到了另外的解决方法:使用ddclient和dyndns.com提供的动态域名解析服务。 Read the rest of this post »

  • Share/Bookmark
Posted on January 8, 2010 at 22:17 by paul · Permalink · Leave a comment
In: In My Opinion, Open Source · Tagged with: , ,

Goodbye 2009, Hello 2010

This is the end of year 2009, and it is rea­lly an ama­zing one in my life.

At the begin­ning of the year, I said goo­dbye to Sun, and all my life in Sun was so memo­ra­ble that I can­not for­get about it. Then I took a 7-day-travel around Hong­Kong with my friends, and enjo­yed the best time in the winter.

After coming back, I sta­r­ted my new inter­n­ship at Mic­ro­soft. During those three mon­ths, I lea­rnt a lot about MS’s culture, work envi­ron­ment, and the latest deve­lop and test tech­ni­que around .NET 3.5 fra­me­work. I also lea­r­ned Open­XML docu­ment for­mat, and it is rea­lly cool. But unfo­r­tu­na­tely, I am not a lucky dog to be a regu­lar MSer. My mana­ger told me they had no hc and all the interns may not get a posi­tion in the group. So I had to say goo­dbye to MS, and fini­shed my inter­n­ship in my campus stage.

Then I plan­ned to go to Tibet for a won­der­ful travel with my best friend. With our great effort on the cir­cuit, culture, lodging, docu­ment colle­cting and so on around Tibet, we rea­lly did a per­fect pre­pa­ra­tion. Mean­while, we did a lot of pra­ctice to enhance our body ski­lls, and to ensure we can adapt the worst con­di­tion in the world about pla­teau problems.

We took the most sig­ni­fi­cant time in this year in Tibet in July, and rea­lly got sho­cked from Tibet’s sight-seeing and its culture about Tibe­tan Buddhism. We saw the most beau­ti­ful sky and cloud in Tibet that we had ever seen before, and went far from the pollu­ted cities. We felt so hea­lthy, so happy in those 7 days, and both of us were so enjo­ying ourselves.

After coming back from Tibet, I sta­r­ted to pre­pare my final the­sis and the pro­ject for my the­sis. I did a lot inve­sti­ga­tion around den­tal cli­nics, made seve­ral discu­ssions with doctors, nur­ses and their lea­ders. Then I sta­r­ted to design the archi­te­cture, then imple­men­ted it. I am happy it runs well on their cli­nics and it is use­ful and bene­fi­cial for their workflow.

Then I sta­r­ted to write down my pro­cess of software deve­lo­pment as the con­tent of my final the­sis. And thanks for my tutor to give me gui­des on how to write a good postg­ra­dua­tion the­sis. With mon­ths’ exer­tion, I succe­ssfu­lly fini­shed my the­sis and got my master’s deg­ree, and will gra­duate from PKU in the coming month.

Then I sta­r­ted my job hun­ting career, which is the tou­g­hest phrase in my life. There are so many paper tests, interviews or discu­ssions through these mon­ths, with striving, sad­ness, ten­sion, happi­ness and hope. It is for­tu­nate that I got 3 offers at the end of the year, and 2 of them I feel sati­sfied. In 2010, I will become an emplo­yee of a great company, and I am loo­king for­ward to putting my wit and my energy to con­t­ri­bute to my company! I see a bri­g­hter future in front of myself, and I will keep on going to reach the summit of my life. :-)

Hello 2010!

  • Share/Bookmark
Posted on December 31, 2009 at 17:06 by paul · Permalink · Leave a comment
In: In My Opinion

This Is It

image

Get the Flash Pla­yer to see this pla­yer.
Earth Song

Read the rest of this post »

  • Share/Bookmark
Posted on November 16, 2009 at 10:58 by paul · Permalink · One Comment
In: Entertainment, In My Opinion · Tagged with: ,

A Morse Code Exchanger

  • Share/Bookmark
Posted on November 8, 2009 at 20:55 by paul · Permalink · Leave a comment
In: Software · Tagged with: 

使用ZFS打造家庭廉价数据中心

在Sun公司实习了8个月,让我学到了很多东西;特别是OpenSolaris和ZFS,学会了如何使用它们,更知道了如何利用它们。

如今这个信息化高度发达的年代,信息爆炸,数据资源越来越多。五年前,20G的硬盘还显得非常充裕;而如今,没有100G200G,是无法存下家庭中所有数据资源的了。对于我们家来说,几年间添置了数码摄像机和数码照相机,加之几次旅行和游玩,家中的两块160G大硬盘已然无法满足存储所有信息的需求。

总是刻盘、刻盘、再刻盘,并不是最好的解决方案,因为一来找起数据来非常不方面;二来读取速度也非常慢,还要担心光盘质量和保存的问题;三来光盘刻一次基本上不再修改了,非常不灵活。加上对于视频编辑的时候对于大容量数据存储、高速度数据访问的要求,我们家在半年前添置了一块1TBSATA大硬盘(1TB=1000GB)。

Read the rest of this post »

  • Share/Bookmark
Posted on November 6, 2009 at 20:45 by paul · Permalink · 3 Comments
In: In My Opinion, Operating System · Tagged with: , ,

ZFS RAID-Z 技术解析

最近在使用ZFS文件系统构造廉价而稳定的家用文件冗余服务器,特转载学习一篇关于ZFSRAID-Z技术的文章。转载自:http://www.ixpub.net/viewthread.php?tid=896494

RAID(廉价磁盘冗余阵列)最初的承诺是它将使用廉价磁盘提供快速、可靠的存储。重点在于廉价,但不知为何我们最终却得到这种结果。为什么呢?
RAID-5(以及其他数据/奇偶校验方案,比如 RAID-4RAID-6、奇偶和行对角奇偶校验)从未完全履行过 RAID的承诺,并且也无法履行,这是因为存在一种称为 RAID-5 写漏洞的致命缺陷。不管何时更新 RAID存储条,还必须更新校验,以便所有磁盘异或为 0,正是这个等式使您能在磁盘故障时重构数据。问题在于无法以原子方式更新两个或多个磁盘,所以RAID 存储条可能在崩溃或电源断电时被损坏。
为了认清这个问题,假设您在写入数据块之后、但在写入相应校验块之前断电。现在,此存储条的数据和奇偶校验就不一致,而且它们将永远保持不一致(除非在某个时候使用一个全存储条写操作覆盖了旧数据)。因此,如果磁盘故障,RAID重构过程将在您下一次读取此存储条上的任何块时生成垃圾。更糟的是,它这样做使没有任何提示,它根本不知道提供给您的是损坏的数据。
为解决此问题,出现过一些仅用于软件的应急方案,但它们的速度非常慢,所以软件 RAID 已经在市场中消亡。当前的 RAID 产品全部在硬件中执行 RAID 逻辑,这样它们可以使用 NVRAM 来应对断电。这确实有用,但成本很高。
现有 RAID 方案还存在一个糟糕的性能问题。当执行部分存储条写操作时,也就是说,当更新的数据少于单个 RAID 存储条包含的数据时,RAID系统必须读取旧数据和奇偶校验来计算新奇偶校验。这是一个巨大的性能损失。全存储条写操作异步执行所有写操作,而部分存储条写操作必须在同步读操作之后才能启动写操作。
又一次,昂贵的硬件提供了一种解决方案:RAID 阵列可以在等待磁盘读操作完成时,在 NVRAM中缓冲部分存储条写操作,这样读延迟就可以对用户隐藏。当然,这种方法只在 NVRAM缓冲器用完之前有效。没问题!您的存储供应商会说。只要再多掏些现金,多买些 NVRAM 就好了。没有您的钱包不能解决的问题。
部分存储条写操作在事务文件系统(比如ZFS)中又提出了另一个问题。部分存储条写操作必然会修改有效数据,这违反了确保事务语义这一规则。(如果在完全存储条写时断电,则没什么问题,同理,如果您在 ZFS 中的其他任何写操作期间断电也没什么问题:但您正在写入的块没有一个是有效的。)
但愿我们不用执行这些烦人的部分存储条写操作……

Read the rest of this post »

  • Share/Bookmark
Posted on November 3, 2009 at 21:31 by paul · Permalink · Leave a comment
In: Operating System · Tagged with: ,