Tag Archive for 'programming'

Remote Execution of Windows Desktop Applications Using Apache and PHP

Install Apache.

Install PHP.

Install PsTools.

Use PHP’s exec() function to launch a windows program. The following is an example:

<?php
exec(’C:\PsTools\psexec.exe -d -accepteula “C:\Program Files\VideoLAN\VLC\vlc.exe” -f http://movies.apple.com/movies/lionsgate/the_spirit/the_spirit_h.320.mov 2>&1′,$output);
var_dump($output);
?>

Take note of the flags. “-d” means don’t wait for the child process to terminate before continuing PHP execution. “-accepteula” is required in order for PsTools to run properly. VLC note: the “-f” flag tells VLC to play the movie fullscreen.

Start Apache, but don’t run it as a service. Instead run Apache from the desktop as the local user.
From a remote computer, point a web browser at the PHP page that implements the exec() function.

Flapjax = AJAX Dataflow Programming

Wikipedia defines Dataflow as:

Dataflow is a software architecture based on the idea that changing the value of a variable should automatically force recalculation of the values of other variables.

Wikipedia defines Flapjax as:

Flapjax is a new programming language built atop JavaScript. It provides a spreadsheet-like dataflow computation style, making it easy to create reactive Web pages without the burden of callbacks and potentially inconsistent mutation. Flapjax can be thought of in two ways: either as a library, for use in regular JavaScript programs, or as a new language that the compiler converts into generic JavaScript. In either case, the resulting programs can be run in a regular Web browser. In addition, Flapjax comes with persistent storage and a simple API that masks the complexity of using AJAX, along with sharing and access-control for server data.

Yet another new thing to learn.