LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-22-2012, 04:01 PM   #1
alfa64
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
Question How to limit a compile-run-respond cycle? (pretty much like ideone/web sandboxes)


This is my first post so be gentle

What i want to achieve is something like codepad/ideone to run an online open source community, a lot is already programmed but i just want to include this functionality.

I want users to post sourcecode, run it through the correct compiler/interpreter, add the STDIN with the script, compile, run, and then show the response.
Of course, there's some theoretical problems but all sites solve this with constraings:
For example:
Compilation time is very limited, from 5 to 15 seconds.
Program size is limited to 32-64kb
Running time is limited to 20 seconds.
ETC

Also they can only read from STDIN and write to STDOUT. In my case database fields.

How can i set up a sandbox environment or some sort of slave compiler to to do this stuff?

I'm managing everything with perl and a mysql database, and possibly (like you could live without those) shell scripts.

Thanks in advance.
 
Old 02-18-2012, 04:54 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,610
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
Quote:
Originally Posted by alfa64 View Post
How can i set up a sandbox environment or some sort of slave compiler to to do this stuff?
What you could do, and I would strongly suggest you run it on a host that only has a LAN connection, is to confine the process to a virtualization guest. QEmu, VMware and other virtualization software allow you to start, suspend, stop, resume and snapshot virtualization guests so they will be accessible in near real time, stopped after a period of time and their contents can be reverted without more than a single command.


//NTLB
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Android, Airplanes, and Assembler: IDEOne LXer Syndicated Linux News 0 03-29-2011 06:40 AM
Jails/Sandboxes/Operating system-level virtualization Mellar Slackware 4 04-03-2008 11:27 AM
LXer: Examine the Ajax into J2EE web app life cycle LXer Syndicated Linux News 0 08-06-2006 12:54 AM
How do you run a print-head cleaning cycle?? Huddlebum Linux - Newbie 1 04-02-2004 03:44 PM
Pretty neat web admin piece for my website.... Whitehat General 5 12-14-2003 02:44 PM


All times are GMT -5. The time now is 03:28 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration