2012年5月31日 星期四

name resolving issue under vpn connection

relate to dns search order.

http://support.microsoft.com/kb/311218

Const HKLM = &H80000002
sComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& sComputer & "\root\default:StdRegProv") 

sKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Linkage"
sValueName = "Bind"

oReg.GetMultiStringValue HKLM, sKeyPath, sValueName, arValues
arValuesNew = Array()

'patch registry
If UCase(arValues(0)) <> UCase("\device\ndiswanip") Then
ReDim Preserve arValuesNew(0)
arValuesNew(0) = "\Device\NdisWanIp"
For Each objarValues in arValues
If UCase(objarValues) <> UCase("\device\ndiswanip") Then
ReDim Preserve arValuesNew(UBound(arValuesNew)+1)
arValuesNew(UBound(arValuesNew)) = objarValues
End If
Next
End If
If UBound(arValuesNew) <> -1 Then
oReg.SetMultiStringValue HKLM, sKeyPath, sValueName, arValuesNew
End If

2012年5月23日 星期三

grant power control authority to users

GPO registry control
HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\CONTROLS FOLDER\POWERCFG
HKLM\SYSTEM\CURRENTCONTROLSET\CONTROL\SESSION MANAGER\POWER

2012年5月16日 星期三

nfsv4

exports option "fsid=0"
https://wiki.archlinux.org/index.php/NFSv4

亦即此share為nfsv4的root
所有其他nfsv4的share必須依賴於此mount point之下
注意:/etc/idmapd.conf設定

2012年5月14日 星期一

run shell command and then display the result on web through asp.net via vb.net


       Dim psi As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo

        psi.FileName = "ipconfig.exe"
        psi.Arguments = " /all"
        psi.UseShellExecute = False
        psi.RedirectStandardInput = True
        psi.RedirectStandardOutput = True

        Dim ps As System.Diagnostics.Process = New System.Diagnostics.Process
        ps.StartInfo = psi
        ps.Start()
        Dim sr As StreamReader = ps.StandardOutput
        Dim aa As String
        While (Not sr.EndOfStream)
            aa = sr.ReadLine
            Response.Write(aa)
            Response.Write("
")
        End While
       ps.Dispose()