Convert XML to CSV using xml2

What you need

  • Red Hat Linux 4, 5
  • gcc
  • libxml2
  • libxml2-devel
  • xml2

Compiling xml2

1. Extract xml2 tar ball

 tar zxvf ./xml2-0.4.tar.gz

2. Modify compiling option in “configure” file

search line between 3428-3470, replace “libxml” with “libxml-2.0”

for example:


    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml\"") >&5
  ($PKG_CONFIG --exists --print-errors "libxml") 2>&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  pkg_cv_XML_CFLAGS=`$PKG_CONFIG --cflags "libxml" 2>/dev/null`


    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\"") >&5
  ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  pkg_cv_XML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`

3. Run configure


4. Modify the “Makefile”

Change the “XML_CFALGS” var to
Continue reading “Convert XML to CSV using xml2”

Ubuntu 10.10 Maverick with HP Elitebook 2540p – Updated


After thousand time try and errors with linux distribution, opensuse, fedora, ubtuntu… etc, finally get it work perfectly on ubtuntu 10.10 Alpha 2 installation.

There is some changes since 10.04, /etc/X11/xorg.conf is no more present after installation, Xorg now communicate with dbus to get best configure for your hardware.

You may experience blank screen, screen flicking, screen can’t turn on after system suspend, Xorg hang for few mins randomly. So here is the workaround for me to install ubuntu on this laptop.


1. Grab the Maverick CD image, ( Alpha 2 for my case)
2. During CD boot, hit any button to interrupt autoboot
3. Press [F6] to append boot parameters
Continue reading “Ubuntu 10.10 Maverick with HP Elitebook 2540p – Updated”

My Yahoo Auctions account Got Hacked!!!

Never imagine that my account will got hijacked, but here it is. My auction account pumped with item listing by someone without my authorization. The listing fee come up $2324 HKD, whoa….

When I notice there was few activities is happening on my account, I was going to change my password to a very complicated one, but it doesn’t help to stop the bumping. So I was questioned that, the login authentication wasn’t enforce the hijacked session to re-initiate the authentication.

In this situation, I was nothing to do to protect my account against the hackers. And I have to call Yahoo customer service to deal with it. Between the conversations, I thought Yahoo seems always handle such problem and asking myself to fill up a declaration form….. let’s see what’ll going to happen, will they withdraw the bill? no idea.

Pacemaker non-clones resource restart when clones stop/start on other nodes


Node alpha holds resource groups rg_vg01.

Node beta holds the corresponding resources as same as alpha

Both nodes hold instances of the CLVM DLM clone.

As beta is switched into standby mode, the clone
instance on beta correctly transition to the Stopped state.
However, the rg_vg01 resource groups are
restarted in-place on alpha needlessly.


It was caused by resource-stickness score INFINITY order was defined between clone and standalone resource.

order order-clvm-vg inf: clvm-dlm-clone rg_vg01

To solve that, you should change the score to 0 between standalone and clones.

order order-clvm-vg 0: clvm-dlm-clone rg_vg01

A related bug fix.

Connect with local sysdba failed when database start up by CRS

What happen?

A database started up by CRS successfully, but you can’t connect it by local sysdba “sqlplus / as sysdba”, however tnsping or connect with connection string “sqlplus system@prddb” works fine.
Later, you tried to start the database alone manually, it works fine with both connection method.

You inspected every crs log and alertlog but it look seems fine.

Oops, why it inconsistent?

When clusterware trying to startup your oracle, it’ll use $ORACLE_HOME/bin/racgwrap , so make sure your system environment setting is same as the ORACLE_HOME setting in racgwrap script.

WordPress post navigation with customized post loop using meta_key

What’s that?

I wrote this stupid navigation workout because I can’t found any of good practice on writing customized content unless I go for WordPress 3.0. When I create several content handling in a themes, such as photo post or video post, I was relied on the meta_key value to determine which style to be used.

For each single post or post loop, it’s no problem at all, however when i tried to do navigation on the single.php. I noticed that there is no way to treat them as typical blog post.

        $category = get_the_category();
        $catID = $category[0]->cat_ID;

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content();?>
        <?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
        <?php endif; ?>

<!-- Start navigation here -->
global $post;
$mypostlist = array();
$currentPID = $post->ID;
$myNav[] += $currentPID;  //insert the current post into first array position
$myposts = get_posts('exclude='.$post->ID.'&orderby=date&order=desc&numberposts=-1&meta_key=my_post_type&meta_value=1&offset=1&category='. $catID .'');
setup_postdata($post); // exclude current post from the loop
foreach ($myposts as $post) {
       $myNav[] += $post->ID; // insert the result into the loop
$current = array_search($post->ID, $myNav);
$prevID = $myNav[$current-1];
$nextID = $myNav[$current++];

<div class="navigation">
<?php if (!empty($prevID)) { ?>
<div class="alignleft"><a href="<?php echo get_permalink($prevID); ?>"
  title="<?php echo get_the_title($prevID); ?>">Previous</a>
<?php }
if (!empty($nextID)) { ?>
<div class="alignright"><a href="<?php echo get_permalink($nextID); ?>"
 title="<?php echo get_the_title($nextID); ?>">Next</a></div>
<?php } ?>
</div><!-- .navigation -->