Listing 1. RemoteDebugging.html

<html><head>
<!--
  Copyright (c) 2006 Anatoly S. Krivitsky, PhD. 
  All rights reserved.
  Conditional permission for free use of the code. As soon as above copyright notes are mentioned, the author grants a
  permission to any person or organization to use, distribute and publish this code for free.  Questions and comments
  may be directed to the author at akrivitsky@yahoo.com and akrivitsky@gmail.com.

  Disclaimer of Liability
  The user assumes all responsibility and risk for the use of this code "as is". There is no  warranty of any kind
  associated with the code. Under no circumstances, including negligence, shall the author be liable for any DIRECT,
  INDIRECT, INCIDENTAL, SPECIAL or CONSEQUENTIAL DAMAGES, or LOST PROFITS that result from the use or inability to use
  the code. Nor shall the author be liable for any such damages including, but not limited to, reliance by any person
   on any information obtained with the code
-->

<title>Remote compilation of the code</title>
</head>
<body>

<h2>Remote compilation of the code</h2>
<form method="post" action="/cgi-bin/RemoteCompilation.pl" 
        enctype="multipart/form-data">
        Code for uploading will go here: <p>
        <input type="file" name="code" size=40><br>
        A file name to be sent will go here: <br>   
        <input type="text" name="filename"><br>
        <input type="submit" value="If this button is clicked, the code will be remotely compiled">
        </form>

</body>
</html>


Listing 2. RemoteCompilation.pl

#!/usr/bin/perl -w

# Please see listing 1 for copyright notes and disclaimer of liability
use CGI qw(:standard);
use Fcntl qw(:flock);
use strict;

print header;
print start_html("Remote compilation");
print h2("Remote compilation");
if(-e "a.out") {
system("rm a.out");
}
system("rm err.txt");
my $file_name = param('filename');
my $code = param('code');
    print "Code: $code<br>\n";
    open( CODE_ON_THE_SERVER, ">\./$file_name" )
      or &dispaly_error(" The $file_name in current directory was not opened for the following reason: $!");
    flock( CODE_ON_THE_SERVER, LOCK_EX );
    while ( read( $code, my $chunk_512, 512 ) ) {
        print CODE_ON_THE_SERVER $chunk_512;
   }
    close(CODE_ON_THE_SERVER);
    print "$file_name has been created on the server from $code <p>\n";


print "<H2>Remote Compilation Results </h2>";
# 2 is used for Linux std.err redirection
system("ifort -O $file_name 2>err.txt");
my $compilation_ok = "no";
my @lines = `ls -l | grep "a.out"`;
foreach my $line (@lines) {
$compilation_ok = "yes";
print "Compilation Ok <br>";
}
if ($compilation_ok == "no") {
open(ERRORFILE, "err.txt");
while(my $record = <ERRORFILE>) {
print $record."<br>";
}
close(ERRORFILE);
}


print end_html;

sub dispaly_error {
    my ($error_message) = @_;
    print "<h2>The following error occurs</h2>\n";
    print "$error_message<p>\n";
    exit;
}


Listing 3. Source code of the application

' Please see listing 1 for copyright notes and disclaimer of liability
Imports System.Windows.Forms
Imports System.Threading

Module Module1

    Sub Main()
        Dim arguments As [String]() = Environment.GetCommandLineArgs()
        Dim FileName As String = arguments(1)
        Dim pathToDirectory As String = arguments(2)
        ' delete possible \ at the end of pathToDirectory 
        If (pathToDirectory.EndsWith("\")) Then
            pathToDirectory = pathToDirectory.Substring(0, pathToDirectory.Length - 1)
        End If
        Console.WriteLine("File Name = " & FileName)
        Console.WriteLine("pathToDirectory = " & pathToDirectory)
        Dim FileNameAndPath As String = pathToDirectory & "\" & FileName
        Dim FireForID As Integer
        FireForID = Shell("C:\Program Files\Mozilla Firefox\firefox.exe http://192.168.227.129/RemoteDebugging.html",
		 AppWinStyle.NormalNoFocus)
        Threading.Thread.Sleep(2000)
        AppActivate(FireForID)
        SendingKeys("{TAB}")
        SendingKeys(FileNameAndPath)
        SendingKeys("{TAB}")
        SendingKeys("{TAB}")
        SendingKeys(FileName)
        SendingKeys("{TAB}")
        SendingKeys("{ENTER}")
    End Sub
    Sub SendingKeys(ByVal s As String)
        Threading.Thread.Sleep(100)
        SendKeys.SendWait(s)
        Threading.Thread.Sleep(100)
    End Sub

End Module