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.
}
else
{
//This is triggered by events other than check-in action.
}

Ref: http://www.sharepointdevwiki.com/display/public/Event+Receivers?focusedCommentId=8519834

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. http://support.microsoft.com/kb/934838/en-us
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
Description:
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 :
openvpn-how-to

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)

– http://openvpn.se/files/binary/openvpn-gui-1.0.3.exe

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 10.8.0.0/24 -o eth0 -j MASQUERADE

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

push “dhcp-option DNS 10.8.0.1”

* Remarks: HKBN DNS Server: 203.186.94.20

No Comments