Skip to content
Permalink
be453b573c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
98 lines (73 sloc) 2.76 KB
<head>
<title>SSH Tunnel Setup</title>
<HTA:APPLICATION
ID="tunnelpluto"
APPLICATIONNAME="SSH Tunnel Setup"
SCROLL="no"
SINGLEINSTANCE="yes"
>
</head>
<script language="VBScript">
Dim dtmStartTime
Sub window_onload
window.resizeTo 400,320
strUser = CreateObject("WScript.Network").UserName
document.getElementById(2).Value = strUser
End Sub
Sub sleep (Timesec)
Set objwsh = CreateObject("WScript.Shell")
objwsh.Run "Timeout /T " & Timesec & " /nobreak" ,0 ,true
Set objwsh = Nothing
End Sub
function go_green(id)
document.getElementById(id).style.background = "green"
end function
Sub Submit
document.getElementById(1).disabled = true
document.getElementById(1).Value = "Please Wait!"
FullName = replace(tunnelpluto.commandLine,chr(34),"")
arrFN=split(FullName,"\")
FileName = arrFN(ubound(arrFN))
SourceDir=replace(FullName,FileName,"")
middleman="pluto"
nLow = 51
nHigh = 99
Randomize
myport=Int((nHigh - nLow + 1) * Rnd + nLow)
middleport=myport+5900
port=5900+vnc.Value
'cmd=SourceDir & "..\tools\plink.exe -batch -pw " & pass.Value & " -t -L localhost:" & middleport & ":localhost:" & middleport & " " & login.Value & "@" & middleman & ".coventry.ac.uk ssh -L " & middleport & ":localhost:" & port & " " & host.Value
cmd="..\tools\plink.exe -batch -pw " & pass.Value & " -t -L localhost:" & middleport & ":localhost:" & middleport & " " & login.Value & "@" & middleman & ".coventry.ac.uk ssh -L " & middleport & ":localhost:" & port & " " & host.Value
Set objShell = CreateObject("Wscript.Shell")
'
objShell.Run cmd,1
sleep 3
msgbox("This is your ssh-tunnel, do not close this terminal! Press OK to launch VNC viewer.")
sleep 2
objShell.Run "..\tools\vncviewer64.exe localhost:" & myport
Window.Close
sleep 5
End Sub
</script>
<body>
<center><h3>Pluto Tunnel Setup</h3></center>
<br />
<table border=0>
<tr>
<td>Input Your HPC Username: </td><td> <input id=2 type="text" name="login" size="10"><br /></td>
<tr>
<td>Input Your HPC Password: </td><td> <input type="password" if="pass" name="pass" size="10" style="background-color:pink;" onChange="go_green('pass')"><br /></td>
</tr>
</tr>
<tr>
<td>Input target node name: </td><td> <input type="text" name="host" id="host" size="10" value="compute-0-" style="background-color:pink;" onChange="go_green('host')"><br /></td>
</tr><tr>
<td>VNC display Nr (default 1): </br><font size=-2>You need to start VNC server on the target node in advance.</font></td><td> <input disabled type="text" name="vnc" value="1" size="5"></td>
</tr></table>
<br />
<center>
<font size=-2>You will be prompted to enter your VNC password when you click Connect</font>
</br>
<input id=1 class="button" type="button" name="btnSubmit" value="Connect" onClick="Submit">
</center>
</body>