Sunday, October 14, 2012

Simple Linux VPN server configuration on CentOS 6

Installation

I consider install from yum is the best way.

rpm --import http://poptop.sourceforge.net/yum/RPM-GPG-KEY-PPTPrpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpmyum install ppp pptpd -y

Thursday, September 27, 2012

Glassfish stream mp3 for HTML5 audio to IE 9

By default, Glasshfish handle the MIME-TYPE as audio/x-mpeg for mp3 file, thus IE 9 can not play the mp3 with HTML5 audio object.

The solution is:

Open the Glassfish/domain/domain1/config/default-web.xml

Find

    mp3    audio/x-mpeg

and alter it to

    mp3    audio/mpeg

Restart the glassfish & now IE 9 should be able to play mp3 file without problem.

Don’t forget to define following tag in your HTML file

<!DOCTYPE html>

Tuesday, September 25, 2012

Launch RDP from Web Browser

This script allows you create a link that can open a RDP session by passing a server address parameter

eg.

Open RDP

function rdp(address){	try{		var rdpexe = 'C:\\WINDOWS\\system32\\mstsc.exe';		var ws = new ActiveXObject('WScript.Shell');		ws.Exec(rdpexe + " /v:" + address);	}	catch(e){		alert("This link will try to launch RDP session from web browser\n"+			  "1. Please use Internet Explorer 7.0+\n"+ 			  "2. Go to Tools > Internet options > Security > Trusted Sites & click \"sites\" button.\n"+			  "3. Add *.your_domain to trusted site\n"+			  "4. Click Custom Level & find the section \"ActiveX controls & plug-ins\"\n"+			  "5. Select Enable for \"Initializing & Script ActiveX controls not marked as safe\"");	}}

Wednesday, July 18, 2012

Setup visual style for WPF applications

Maybe you’re facing the same problem with me: WPF applications cannot use Windows Visual Style by default.
If you want a solution, follow these steps:

  1. Download this & unpack: Link.
  2. Add the “application.manifest” file to your wpf project in VisualStudio.
  3. Right click on the project in “Solution Explorer”, select “Properties”.
  4. Choose “Application” tab, in the “Resource” groupbox, select “Icon & manifest”, then select “application.manifest” on manifest combobox.
  5. Save all & build application, run it!

 

Wednesday, June 13, 2012

Make Chameleon wowpc.iso boot OSX86 by default

This article introduce a simple way to alter the chameleon boot in Mac OS by default, this method suit for any one installed Chameleon on Windows drive to make dual boot.

1. Open a terminal window & mkdir bootmedia

2. open wowpc.iso in Finder, & copy all files to bootmedia folder.

3. Edit bootmedia/Extra/com.apple.Boot.plist file with text editor, add

<key>Default Partition</key>

<string>hd(x,y)</string>

then save it.

4. Now rebuild the wowpc.iso file & replace the one in your windows partition.

sudo hdiutil makehybrid -o wowpc.iso bootmedia/ -iso -hfs -joliet -eltorito-boot bootmedia/usr/standalone/i386/cdboot -no-emul-boot -hfs-volume-name "Chameleon" -joliet-volume-name "Chameleo" -iso-volume-name "Chameleo"

5. Replace the original wowpc.iso file in your windows drive.