Archive for July, 2009

Virtual Server 2005 R2 Server 500 Error

There’s probably a KB article about this, but I know the first time I ran into the problem above, it took me forever to find the solution, so I thought I would share it with you.

If you install Virtual Server 2005 R2 (or SP1), and then Remote-Desktop to the Host Server, and pull up the Virtual Server Administration Website, you may see the error from the picture above;

HTTP 500 Internal Server Error
The website cannot display the page
Most likely causes:

* The website is under maintenance.
* The website has a programming error.

The solution? When you connect to the remote Host Server, you need to actually connect to the Console session. You would do this by clicking:

Start –> Run –> mstsc /console

No Comments

Configuring SSL in Tomcat

Configuring SSL in Tomcat

No Comments

短歌行 (曹操)


No Comments

ItemUpdating & ItemUpdated running twice

The ItemUpdating event or the ItemUpdated event occurs two times when you enable the Require Check Out option for Document Library. That’s inefficient, as it increases the database requests that we were doing in the ItemUpdated event!
So, Here is THE Solution if you dont want the ItemUpdating and ItemUpdated event get called twice from Microsoft!
To work around this behavior, examine the vti_sourcecontrolcheckedoutby property inside an event receiver. If the vti_sourcecontrolcheckedoutby property exits in the BeforeProperties property but not in the AfterProperties property, the event was caused by checking in a document. The following sample code shows you how to do this.

if (properties.AfterProperties[“vti_sourcecontrolcheckedoutby”] == null &&

properties.BeforeProperties[“vti_sourcecontrolcheckedoutby”] != null)
//This is when the update event is triggered by check-in.
//This is triggered by events other than check-in action.


No Comments


話到左sms 我…
攪到我擔心左成日= =”

不過好彩都有搵我jei~~ 如果唔係仲擔心 = =~

1 Comment

Truncate / Purge SQL 2005 database log files

There are 2-3 methods but the method which I used is as follows:

1) Detach the database from the SQL Server Management Studio.

2) Go to the location of transaction log and rename it (don’t delete the file yet!!)

3) Attach the database without the log file. When you do this step make sure you highlight the log file entry in the wizard and remove it. (Final attach would happen only with one file i.e. with the MDF file).

At this point there would be a new log file created by the SQL Server.

4) Delete the log file once the database is attached and you have verified it.

No Comments

SharePoint 27745 Error

Event Id 27745

This error message usually occurs with others such as Event Id 5586, Event Id 5586 and Event Id 27745. There are probably many ways to fix it, but this is what worked for me.
First try the easy way out:
1. Reboot your SQL Server
2. Reboot the remaining servers in the SharePoint farm
3. Run these scripts exactly as instructed, even if you did not change the passwords, just run it to remind SharePoint what the passwords were in teh first place.
That might do the trick. If not:
1. Install WSS 3.0 SP1 and MOSS 2007 SP1
2. Repeat steps 1-4 above.
Details of the error:

Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: General
Event ID: 27745

Date:  1/9/2008
Time:  10:56:45 AM
User:  N/A
Computer: xxxx
The description for Event ID ( 27745 ) in Source ( Windows SharePoint Services 3 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: #50071: Unable to connect to the database SharePoint_Config on xxxx.  Check the database connection information and make sure that the database server is running..

No Comments

OpenVPN Installation

Server Side Installation and Key Generation

1. Install OpenVPN referencing this guide :

2. Install NEWEST RC Client OpenVPN 2.1_rc18
(Only this version support Vista 64 bits!!!)

3. Get the keys from server (supposing is using secure way, but… I just use insecure way for demo)

  • in /etc/openvpn
  • . ./vars
  • build-key username
  • the keys are stored in $KEY_DIR (usually the /etc/openvpn/keys)

Configure Client

4.Configure the client configuration

– copy ca.crt, client.crt, client.key to C:\Program Files (x86)\OpenVPN\config

5. Copy C:\Program Files (x86)\OpenVPN\sample-config\client.ovpn (in windows, client.conf if using Linux) to C:\Program Files (x86)\OpenVPN\config

– Edit the port, ca.crt, client.crt, client.key configuration values

6. Install OpenVPN GUI ( I assume that you want to use GUI)


6. run!

** To redirect all traffic to VPN Server

1. Add following line in server.conf

push “redirect-gateway def1”

2. Run “echo 1 > /proc/sys/net/ipv4/ip_forward” in server (thanks wallace)

3. iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE

4. Add following line in client.conf (client.ovpn in Windows)

push “dhcp-option DNS”

* Remarks: HKBN DNS Server:

No Comments