Thursday, February 17, 2011

Start Ruby 1.8.7 without setting system path on Windows

I installed cygwin and cygwin-ruby on my Windows 7. If I put Ruby-1.8.7-win32 path in my system path, the path also appears in cygwin path. Although cygwin-ruby (/usr/bin/ruby) appears before Ruby-win32 in PATH, I'm still want to avoid any confusion, so I don't add Ruby-Win32 into my system path.

When I want to run Ruby-1.8.7-Win32, I can do like this:

C:\Windows\System32\cmd.exe /E:ON /K C:\workplace\apps\Ruby187\bin\setrbvars.bat

You can create a shortcut and pin this on the task bar.

Wednesday, February 9, 2011

Identify the Physical Host of a Virtual Server using PowerShell

Found this page by googling:

http://portal.sivarajan.com/2010/01/identify-physical-host-of-virtual.html

$regPath= "HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters"
$regValue = get-itemproperty -path $regPath
$regValue | fl "VirtualMachineName","PhysicalHostNameFullyQualified"