News for hackers. Stuff that matters.
Re:Show HN: SharePad.io – A collaborative code editor and co... by maxmcd on Friday January 01, 2021 @08:42PM (#25609380)
The service can call itself, forever

    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()
Re:Show HN: SharePad.io – A collaborative code editor and co... by yufw on Friday January 01, 2021 @09:35PM (#25609761)
Oh, I was not aware of this, definitely need to fix this, thanks!
Re:Show HN: SharePad.io – A collaborative code editor and co... by yufw on Friday January 01, 2021 @10:57PM (#25610259)
I disabled access to the VM's public IP from the host. I may eventually need to completely disable the network stack for the containers in the future.