Ubuntu Seems Hangs After Reboot

Please refer to the post at this link: http://www.statusq.org/archives/2012/11/16/4613/

In short:

  • After a power failure or whatever recent, the machine shutdown abruptly.
  • Upon reboot, it seems to the sysop that the machine can never come back.
  • You google a bit but find no resolution. Keyword: Ubuntu, GRUB.


  • The grub script has a default timeout = -1, which makes the menu does not have timeout.


  • For Ubuntu 12.04 and later, there is a option in /etc/default/grub to disable this type of timeout called GRUB_RECORDFAIL_TIMEOUT.
  • To solve this, set GRUB_RECORDFAIL_TIMEOUT  = 0 to disable the timeout, or a positive value for a delay in seconds. If set to -1, the menu will never timeout.
  • After changing the configuration, please run update-grub to make the change in effect.

External links:

  1. http://ubuntuforums.org/showthread.php?t=2069267
  2. http://www.hamiltonpdx.com/blogs/index.php/ubuntu-12-04-server-restoring

How To Solve “Problem running post install step…the Database Cluster Initialisation failed” on PostgreSQL Windows Installation

One day, when I install PostgreSQL on Windows, it always report the following error:

Problem running the post-install step. Installation may not complete correctly.

… when the installation progress bar reached the end.

Continue reading

How to Make Mailbox Style Multiple Checkboxes and Pre-select

Form bean:

public class MyForm {
  private String[] selectedIds;

  public String[] getSelectedIds() {
    return this.selectedIds;
  public void setSelectedIds(String[] ids) {
    this.selectedIds = ids;


public class MyAction extends ActionSupport {
  MyForm form;
  List<String> completeList;

  public String getForm() {
    return this.form;

  public List<String> getCompleteList() {
    return this.completeList;


<s:iterator value="completeList" var="id">
  <td><s:checkbox name="form.selectedIds" fieldValue="%{id}" id="id-%{id}" value="%{id in form.selectedIds}" /></td>

How to Create a Struts 2 Component with Freemarker

For quick starter, you can use tag file to create a reusable component for your JSP application. However, if you wants a more serious tag, or need to use Struts’ value stack ability to lookup action variable, it is better to create  a Struts component.

The steps are simple:

That’s all! This is tested on Struts 2.3.x. Continue reading