09 November, 2008

Great profiling tools VisualVM bundled with JDK6

Whenever encounter memory leak or performance problem, profiler will be your great friend.

Sometimes before, I have used some well known profiling tools like YourKit or hprof, jmap, tools, but recently, I discover JDK 6 has bundled with a new tools called VisualVM.

Indeed, the VisualVM is itself a self contained project, it provides some common monitoring features like thread/heap monitoring, as well as cpu / memory profiling features. It also allows you taking snapshots and compare memory snapshot.

IMO, it should deserve much more attention than its currently have. And it is really a perfect tools for most performance monitoring / tunning needs.

27 September, 2008

Happy Vimming again!

Vim has been my favorite editor for years. However, for Java related development I've switched to Eclipse. Vim is then only been used for general text editing (writing notes, scripts, etc).

Recently, I have to do fairly amount of coding in PL/SQL. After struggling for weeks to writing code in SQLDeveloper, I remember the lovely Vim.

Vim already bundled the syntax file for PLSQL and Oracle SQL,. However, Vim doesn't bundled with a good PL/SQL indentation setup, which can be found in here.

Another important setup is connecting sqlplus and vim and it is can be done by adding the line below into glogin.sql (sqlplus init file):

 DEFINE _EDITOR='vim -c "set filetype=plsql"'

Finally, to make the sqlplus usable, it is better to use rlwrap (which bring basic readline features like command history and hot key to the sqlplus).

09 August, 2008

Olympic, China, Microsoft

I'm originally going to blog about the amazing opening ceremony of the 2008 Olympic games on last night. But I just changed my mind as my good feeling is substituted with big anger!

Today is the second day of the Olympic games, I'm just going to checkout for the official means on watching the games via Internet. After all, I found that, i-cable is the only authorized company to provide the Olympic video online in Hong Kong. Hence, I visit the site and well, fail to watch any video clips.

The site shown that, Microsoft Windows Media Player 9 is required. Currently, I'm using Mac OSX as my primary desktop and I'm already installed the official WMV codec from MS website. And the sad fact is that, clearly MS Windows is prerequisite for watching the games. But hey, Olympic is the event of anyone on the earth, it seems now, Olympic is game for Microsoft users.

Nowadays, we can watch TV and listen to radio as long as you have working TV set or radio. But on the Internet, you must pay to one vendor: MS. Sorry I believe there is something wrong, what do you think?

06 August, 2008

What happens during power outage

Just skimming through Slashdot and enjoyed an well-written article by Halfgaar.

What's make me think interesting is the following two points:

  • Different components on the system response slightly different during power outage
  • Another point is how aged disk will died after power failure

01 July, 2008

My /first/ Mac

Last Friday, I finally bought my /first/ Mac (yup, theoretically, it is the second as I iPhone is counted Mac also:).

Hardware design is just really and I have also very happy with the design as well as the performance so far.

By the way, usability of OS X is really excellent.

21 June, 2008

Recover the data on iPhone

Recently, I bricked my iPhone again (the third times). I've some photo which haven't yet uploaded to my album, hence I really want to find a way to recover my photos.

As I don't get any good solution, I managed to restore it and use a simple tricks to dump the iphone disk image, then, use some common data recovery tools to help the process.

To dump the image into a disk file (in your desktop), run the following in the iphone:

root@my-iphone> dd if=/dev/disk0 | ssh username@mydesktop 'dd of=iphone-dump.img'

When this is finished, you can use some tools to recover the file on the disk image.

18 June, 2008

Firefox 3.0

After months of beta and rc releases, Firefox 3.0 is ready. I've switched to 3.0 since beta 5, it is really very fast and much more responsive, especially on the Linux. You can download it from here.

01 June, 2008

The decline of Gentoo

Recently I am considering the aluminum iMac as my next workstation. After all I don't make the decision on 20" or 24" yet. The hardware design is excellent.

Hence, I have to do some studies on how well such machine is supported by Linux. And yet, I found one excellent writeup on Ubuntu wiki.

During the googling, I realized one thing: Ubuntu has a vibrant user community.

Sometimes (quite a few years) ago, Gentoo is my only OS in my box.

In my memory it have the best quality documentation and the most vibrant user communities. But this situation is changed. The notable trend is that, recently, whenever I'd like to search for some hardware / kernel related info, the page is hosted ubuntu wiki.

18 May, 2008

ProgrammableWeb: Directory for public web (web2.0) service API

ProgrammableWeb is an index for publicly available web API and mashup.

This is really a nice website, when you need to quick reference for all those API.

By the way, I find that, a kind of "scheduler" web service is lacking. Does it existed already?

Google App Engine

Google had released the Google App Engine on April. This service will be an perfect choice for SME, Open Source community, and individuals who doesn't want to maintain its own server environment / infrastructure.

It is a complete app hosting service /plus/ Python-based API. Currently, it provide a persistence API, url fetch API, and it support the django framework.

As a Python fan, I'd definitely try it out, though, I'm now on the waiting list only:(

10 May, 2008

Marriage of Web 2.0 and next generation mobile device

While web 2.0 application is a norm and more app / website has released iPhone specific or optimized version, this lead to a question in my mind: What's next?

Back to days when J2ME and smart phone hit the ground, I still don't buy any of these platform as they screen are so small and the UI is still very less convenient. Now with iPhone and Android coming next, I'm really expecting to see some new innovative app released.

23 April, 2008

Oracle 11g on Gentoo Part 2. dbstart, dbshut and emctl

On Gentoo Wiki, there is a page dedicated for Oracle on Gentoo. You should found a set of rc script to start / stop Oracle instance, Listener, the EM DB console and isqlplus. For 11g, however, those scripts need some adjustment. This post will shows you how.

  1. 11g no longer provide isqlplus, hence the script should not start/stop isqlplus.
  2. Secondly, dbstart and dbshut will manage the start and stop of listener, hence, the rc script should not deal with the listener directly (let dbstart do it).
  3. For dbstart/dbshut in 11g, you need to supply ORACLE_HOME as the 1st argument, just like the following shows:
     oracle> dbstart /u01/app/oracle/product/11.1.0/db_1
    
  4. For emctl, you should pass ORACLE_SID to emctl via environment variable, just like:
     oracle> ORACLE_SID=mydb emctl start dbconsole
    

Finally, you can use my init script for 11g. The files can be downloaded from here.

To use the script,

 root> tar -C / -zxf oracle-11g-gentoo-rc-scripts.tgz
 root> chmod +x /etc/init.d/oracle
 root> vim /etc/conf.d/oracle # edit the ORACLE_HOME, ORACLE_SID

21 April, 2008

Installing Oracle 11g on Gentoo

This weekend, I managed to setup Oracle 11g r1 on my little Gentoo box. Basically, installation is roughly the same as other distros (like RHEL). However, the following extra steps is needed:
  1. Before the installation (pre-install prep), create a symlink for libstc++.so.6
      root> ln -s `gcc-config -L`/libstdc++.so.6 /usr/lib
    
  2. During installation, at the 'Linking executable' steps, you will encounter an error which is something like "Failed to link sqlplus binary". At this moment, update a make file included config:
      root> cd $ORACLE_HOME
      root> sed -ie 's/$/ -lrt/' lib/sysliblist
    
    After edited the file, click 'Retry' the installation should completed without any other problem.
    When installation completed successfully, you should remove the libstdc++ symlink.
  3. After the installation, create the rc scripts to manage the Oracle instance (as well as the listener and EM as well).
    While the rc scripts from Oracle administrator guide is not usable on Gentoo (as Gentoo has its own rc system), some Gentoo users have contributed their rc script which can be found on Gentoo Wiki.
NOTE: The step 1 and 2 is found from Gentoo Forum. However, the thread have some non-mandatory information, which is not relevant IMO.

11 April, 2008

Rescue mode for my iPhone

My iPhone bricked again! This is the second times I bricked my iphone.

Contrary to experience of most other iphone users, the brick is caused by installing / uninstalling 3rd party app, but not by improper jailbreak / unlock methods.

While my only way to go is using ziphone to recover the iphone from scratch, I start thinking the possibility of booting the iphone with a rescue ramdisk. Such image will be very helpful, as you can boot the iphone in rescue mode just like the way in every Linux distro. We can then create full backup by simply tar up the whole root filesystem or just fix the broken thing and restart the iphone.

Anyway, it is just a idea. Hope it will comes true later.

06 April, 2008

From pyblosxom to blogger

I've once setup pyblosxom on my own server as my personal blog. During this weekend, I start migrating my post to blogger.

So, I need some good ways to do the import task and I finally come across with the official gdata python library. With a few line of code, the import is done.

During the process, I found Bash Blogger, which is a cli blogger interface. This looks interesting as one of my next task is to look for an cli interface for posting notes.

However, the most trouble part is not solved, which is the content of the post. When using pyblosxom, I define a small set of tag and CSS classes, but when imported into blogger, my post looks strange...