A sample implementation.
The code is still being pupulated.
console.log 'started' | |
options = | |
viewportSize: | |
width: 1900 | |
height: 1000 | |
snapshot = (width, height, path)-> | |
clip = | |
top: 0 |
VERSION=`VBoxManage -v | sed 's/\(.*\)r\([0-9]*\)/\1/'` | |
if [ $RELEASE = "precise" ]; then | |
TEMPLATE="ubuntu-12.04.1-server-i386" | |
fi | |
if [ $RELEASE = "lucid" ]; then | |
TEMPLATE="ubuntu-10.04.4-server-i386" | |
fi | |
BOX_NAME="$RELEASE-vbox-$VERSION" | |
BOX_PATH="boxes/$RELEASE-vbox-$VERSION.box" | |
if [ `VBoxManage list runningvms | grep -c $BOX_NAME` -eq 1 ]; then |
var http = require('http'); | |
var exec = require("child_process").exec; | |
http.createServer(function (req, res) { | |
var duration = req.url.substr(1); | |
exec("sleep " + duration, function (error, stdout, stderr) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('I have slept for ' + duration + ' seconds!\n'); | |
}); | |
).listen(1337, "192.168.56.136"); |