Thursday, September 26, 2013

How to change Grails default port

If we run : grails run-app
By default the grails will listen at port : 8080

We can change by default port by run this command :
grails run-app -Dserver.port=9000
This command will make the grails listen to the port 9000

Another way is by editing the BuildConfig.groovy
Add the following line :
grails.server.port.http = 9000

NB: I use grails 2.2.4

Monday, September 2, 2013

Friday, August 30, 2013

Enable .NET 4 on IIS 6

After installing .NET Framework 4, IIS 6 is not directly enable the .NET 4. Run this command to check : 

cd \windows\system32\
iisext.vbs /ListFile


I got a problem when enable .NET 2 and .NET 4 simultaneously. So, I disable the .NET 2 and enable the .NET 4, by run this command :

C:\WINDOWS\system32>iisext.vbs /disfile C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll



C:\WINDOWS\system32>iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

Restart IIS and the .NET 4 should be work.

Tuesday, August 20, 2013

Thursday, August 1, 2013

How to enter WebBIOS on IBM server

My machine : IBM X3850 (maybe same with X3650, etc)

On first time use we can enter to WebBIOS by pressing <ctrl><h>, like this :


But if we already configure the RAID Controller, we can not see this screen again, we only will see this screen :

So, if we want to reconfigure the RAID Controller (accessing WebBIOS), we can press F1 to enter to the setup menu, like this :










Monday, June 17, 2013

Converting date in PostgreSQL

Get current date, month, and year (return type is DOUBLE PRECISION) :
                     
select EXTRACT(DAY FROM now());

select EXTRACT(MONTH FROM now());

select EXTRACT(YEAR FROM now());


Get current date, month, and year (return type is TEXT) :
select to_char(now(), 'YYYY'); -- year (4 and more digits)

select to_char(now(), 'MM');  -- month number (01-12) with leading zero

select to_char(now(), 'DD');  -- day of month (01-31) with leading zero


For complete complete documentation : to_char

Create a loading image in Java desktop application

This code are equals with
Application.ProcessMessages
in Delphi or
Application.DoEvents
in VB

                     lblLoading.setVisible(true);  
                     new Thread(new Runnable() {  
                          private boolean done = false;  
                          @Override  
                          public void run() {  
                               // time consuming algorithm.  

                               done = true;  
                               if (done) {  
                                    SwingUtilities.invokeLater(new Runnable() {  
                                         @Override  
                                         public void run() {  
                                              lblLoading.setVisible(false);  
                                         }  
                                    });  
                               }  
                          }  
                     }).start();