Optimizing OpenOffice.org for Speed

Have you ever tried OpenOffice.org? OO.o is a multiplatform and open-source office suite. It could replace MS Office someday, not today, due to lacking of some features and its default performance. Current version of OO.o is only suitable for geek because of its highly configurable options. Yes, the problem is its options being too configurable and defaults suck! I have just tried OO.o 2.0.2 for a week without impression according to its very slow response time. For example, I have to wait more than 30 seconds to start Impress.

Renew SSL certificate in RedHat 9

Most services should run in secure mode by adding SSL on top of them. The most popular services in RedHat 9 are imapd, pop3d, and sendmail. Anyway, default configuration of RedHat 9 will generate certificates with 365 days valid period. So that means you have to renew them once a year. The default certificate directory in RedHat 9 is /usr/share/ssl/certs. The first thing you need to do is to confirm that it has expired by using below command.

# openssl x509 -in sendmail.pem -text | grep Not  

Patch for LDAP Integration module in Drupal 4.7

According to the previous post, the patch is not complete for all functions. I found a problem according to attributes mapping. The attributes changed in Drupal are not synchronized to LDAP because of missing some options in administer interface. So below is the new patch.

Convert TIS-620 to UTF-8 in PHP

In case you don’t have iconv and mbstring, you might use below function to convert TIS-620 to UTF-8.

function tis620_to_utf8($text) {
  $utf8 = "";
  for ($i = 0; $i < strlen($text); $i++) {
    $a = substr($text, $i, 1);
    $val = ord($a);
 
    if ($val < 0x80) {
      $utf8 .= $a;
    } elseif ((0xA1 <= $val && $val < 0xDA) || (0xDF <= $val && $val <= 0xFB)) {  

Convert UTF-8 to TIS-620 in PHP

In case you don’t have iconv and mbstring, you might use below function to convert UTF-8 to TIS-620.

function utf8_to_tis620($string) {
  $str = $string;
  $res = "";
  for ($i = 0; $i < strlen($str); $i++) {
    if (ord($str[$i]) == 224) {
      $unicode = ord($str[$i+2]) & 0x3F;
      $unicode |= (ord($str[$i+1]) & 0x3F) << 6;
      $unicode |= (ord($str[$i]) & 0x0F) << 12;  

Graphical vi/vim Cheat Sheet and Tutorial

http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html It is a very nice tutorial for newbies in vim. The full vi/vim input model, the function of all keys, and all major features are described in a single page. http://www.viemu.com/cheatsheet256.gif