Sun is to the end of life
As Euro Commission clears Oracle’s proposed acquisition of Sun Microsystems, this acquisition is much closer to the end. And I don’t think Russia and China will place obstacles for this deal, and it will finish in several days.
It is so pity and sad to hear that bad news. As a student, I took the most memorable internship at Sun and deeply fell into love with Sun’s unique curture. Without an open enviornment and a technology-first ideology, every engineer can obtain an immeasurable freedom around technology, so Sun created a lot of new technique. Java, Solaris, ZFS, DTrace, netBeans, JavaFX, Lesture, StorageTek, Cluster, VirtualBox, MySQL, UltraSPARC, xVM….. All of them is so great that can change our world. I worked for Sun for 8 months, but I cannot remember all of Sun’s mature product, because Sun owns such a lot of good projects or products.
In my family, I deployed a NAS (Network Attached Storage) Server under OpenSolaris. with ZFS supported, I can easily possess a good network server to store my personal and family data with a high reliability and a good performance. And I also deployed subversion, SAMP (Solaris+Apache+MySQL+PHP), Dynamic domain binding, remoting desktop and so on into my box, and I got a wonderful family system center with Sun’s product. I love it!
I will never forget that time working for Sun in my life. I love Sun forever.
Good luck to all the Sunners.
Sunset.
1982–2010
In: Sun · Tagged with: SUN
为cos-html-cache插件增加页面(Page)、标签(Tag)和分类(Category)的静态化功能
Wordpress的cos-html-cache插件为我们系统的静态化提供了非常好的解决方案,目前的版本是2.7.3。它可以将我们首页及文章(Post)进行静态化,使得访问速度大大提高,减少了服务器端的压力。不过对于页面、标签和分类,却似乎不太起作用,至少在我的服务器环境下(IIS7.0+FastCGI)是不行的。
为了能够实现它们,我分析了一下源代码,发现功能没有开启,但是可以实现的。具体修改方法及目的如下:
找到如下三行:
- if( substr_count($_SERVER[’REQUEST_URI’], ‘.htm’) || ( SCRIPT_URI == CosSiteHome) ){
- if( substr_count($_SERVER[’REQUEST_URI’], ‘../’)) $is_buffer = false;
- if( !substr_count($buffer, ‘<!–cos-html-cache-safe-tag–>’) ) return $buffer;
将他们分别做如下处理:
- 修改为:
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) ){ - 在本行下增加:
if( substr_count($_SERVER[’REQUEST_URI’], ‘comment’)) $is_buffer = false; - 前面加上“//”注释掉本行
分别的原理及目的:
- 这个是在检测我们要静态化哪些文件,我为它增加了page、tag和category。当然,这个也和目录的模式有关,比如我的博客中,OpenSolaris的标签地址就是:http://www.priormind.com/tag/opensolaris。所以我就找到以tag开头的目录并静态化它们
- 防止评论内容被静态化
- 作者写了个函数,将singlepost(也就是单页页面)、首页都加上了一个安全标签(<!–cos-html-cache-safe-tag–>)。有这个标签的话将不被静态化。而我们需要它们静态化,所以就把这行注释掉好了
本人仅仅是尝试性修改,不保证其完全正确性。有兴趣的话大家可以试试看,呵呵。也欢迎一起交流。
In: In My Opinion, WordPress · Tagged with: php, WordPress
How to configure Subversion in OpenSolaris
Recenly I am always thinking about how to manage personal programs, to save codes, to track changes, and to ensure their safety. I combine two things together and get a solution for my requirement, that is to use ZFS as persistent storage and use Subversion as a versioning controller, to ensure my codes can be safely saved and well managed. So today I will talk something about how to configure subversion in OpenSolaris.
In: Open Source · Tagged with: Apache, Family Information Center, OpenSolaris, Subversion
转载:IIS FastCGI PHP 环境下搭建 WordPress
看到 Jerry Tao 在其博客上发表了一篇如何配置IIS7+FastCGI的文章,特转载过来学习。
Windows Server 2008 (SP2) + IIS 7
添加 Web 服务器角色,需要安装 CGI 扩展支持。
In: Learn from Others, Web Back-end, WordPress · Tagged with: IIS, php, WordPress
在OpenSolaris下动态绑定域名
在我前面的博客中,谈到了如何通过使用OpenSolaris和ZFS来实现家庭NAS(Network Attached Storage)网络数据中心的实现方法。对于我们很多人来说,仅仅在家中内部的局域网使用还是不够的,还希望家中的NAS能够发挥更大的作用,无论走到哪里,只要有网络,我们便能读取和存储数据到家中的NAS中。那样,我们最为重要数据就不必随身携带了。加上NAS系统的冗余性,我们就不必担心数据会丢失了。
今天想先来谈一谈实现这个想法其中比较关键的一步:绑定动态域名。在中国,我们的家用网络多半属于ADSL或小区宽带上网。这种上网的方式使得IP地址不是固定的,而是动态的。所以在家庭网络外部,我们是无法通过IP来识别并进入家用网络的。如果固定IP地址,花费的费用不菲,另外还要经历痛苦的备案过程。
其实现在已经有很好的解决方案了,比如花生壳Oray。前一阵子我也在使用oray来绑定自己的动态域名。特别是Oray和TP-LINK合作,在tp-link中已经内置了花生壳的程序,我们需要做的只是注册一个用户就好了。但花生壳不是很稳定,几次出现了断线无法连接的问题,而且一断就是好长时间(大于3小时)。这个让我无法忍受,所以我找到了另外的解决方法:使用ddclient和dyndns.com提供的动态域名解析服务。 Read the rest of this post »
In: In My Opinion, Open Source · Tagged with: NAS, OpenSolaris, zfs
Goodbye 2009, Hello 2010
This is the end of year 2009, and it is really an amazing one in my life.
At the beginning of the year, I said goodbye to Sun, and all my life in Sun was so memorable that I cannot forget about it. Then I took a 7-day-travel around HongKong with my friends, and enjoyed the best time in the winter.
After coming back, I started my new internship at Microsoft. During those three months, I learnt a lot about MS’s culture, work environment, and the latest develop and test technique around .NET 3.5 framework. I also learned OpenXML document format, and it is really cool. But unfortunately, I am not a lucky dog to be a regular MSer. My manager told me they had no hc and all the interns may not get a position in the group. So I had to say goodbye to MS, and finished my internship in my campus stage.
Then I planned to go to Tibet for a wonderful travel with my best friend. With our great effort on the circuit, culture, lodging, document collecting and so on around Tibet, we really did a perfect preparation. Meanwhile, we did a lot of practice to enhance our body skills, and to ensure we can adapt the worst condition in the world about plateau problems.
We took the most significant time in this year in Tibet in July, and really got shocked from Tibet’s sight-seeing and its culture about Tibetan Buddhism. We saw the most beautiful sky and cloud in Tibet that we had ever seen before, and went far from the polluted cities. We felt so healthy, so happy in those 7 days, and both of us were so enjoying ourselves.
After coming back from Tibet, I started to prepare my final thesis and the project for my thesis. I did a lot investigation around dental clinics, made several discussions with doctors, nurses and their leaders. Then I started to design the architecture, then implemented it. I am happy it runs well on their clinics and it is useful and beneficial for their workflow.
Then I started to write down my process of software development as the content of my final thesis. And thanks for my tutor to give me guides on how to write a good postgraduation thesis. With months’ exertion, I successfully finished my thesis and got my master’s degree, and will graduate from PKU in the coming month.
Then I started my job hunting career, which is the toughest phrase in my life. There are so many paper tests, interviews or discussions through these months, with striving, sadness, tension, happiness and hope. It is fortunate that I got 3 offers at the end of the year, and 2 of them I feel satisfied. In 2010, I will become an employee of a great company, and I am looking forward to putting my wit and my energy to contribute to my company! I see a brighter future in front of myself, and I will keep on going to reach the summit of my life.
Hello 2010!
This Is It

Get the Flash Player to see this player.
Earth Song
In: Entertainment, In My Opinion · Tagged with: Michael Jackson, music
A Morse Code Exchanger
In: Software · Tagged with: morse code
使用ZFS打造家庭廉价数据中心
在Sun公司实习了8个月,让我学到了很多东西;特别是OpenSolaris和ZFS,学会了如何使用它们,更知道了如何利用它们。
如今这个信息化高度发达的年代,信息爆炸,数据资源越来越多。五年前,20G的硬盘还显得非常充裕;而如今,没有100G到200G,是无法存下家庭中所有数据资源的了。对于我们家来说,几年间添置了数码摄像机和数码照相机,加之几次旅行和游玩,家中的两块160G大硬盘已然无法满足存储所有信息的需求。
总是刻盘、刻盘、再刻盘,并不是最好的解决方案,因为一来找起数据来非常不方面;二来读取速度也非常慢,还要担心光盘质量和保存的问题;三来光盘刻一次基本上不再修改了,非常不灵活。加上对于视频编辑的时候对于大容量数据存储、高速度数据访问的要求,我们家在半年前添置了一块1TB的SATA大硬盘(1TB=1000GB)。
In: In My Opinion, Operating System · Tagged with: OpenSolaris, Samba, zfs
ZFS RAID-Z 技术解析
最近在使用ZFS文件系统构造廉价而稳定的家用文件冗余服务器,特转载学习一篇关于ZFS的RAID-Z技术的文章。转载自:http://www.ixpub.net/viewthread.php?tid=896494
RAID(廉价磁盘冗余阵列)最初的承诺是它将使用廉价磁盘提供快速、可靠的存储。重点在于廉价,但不知为何我们最终却得到这种结果。为什么呢?
RAID-5(以及其他数据/奇偶校验方案,比如 RAID-4、RAID-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 »
In: Operating System · Tagged with: OpenSolaris, zfs
