[HN Gopher] Show HN: SharePad.io - A collaborative code editor a...
       ___________________________________________________________________
        
       Show HN: SharePad.io - A collaborative code editor and compiler
        
       Author : yufw
       Score  : 50 points
       Date   : 2021-01-01 03:15 UTC (19 hours ago)
        
 (HTM) web link (www.sharepad.io)
 (TXT) w3m dump (www.sharepad.io)
        
       | nulptr wrote:
       | Some starter code for each language that prints hello world would
       | be nice. ALso, you can look to coderpad.io for other features to
       | add for fun.
        
         | yufw wrote:
         | Yes, thanks for the feedback!
         | 
         | 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.
        
       | yufw wrote:
       | Happy New Year!
       | 
       | 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).
        
         | petters wrote:
         | Cool! What is the difference to e.g. repl.it?
         | 
         | Does it run Python locally in the browser or in the cloud?
        
           | yufw wrote:
           | It certainly has less feature than repl.it, for example, it
           | does not have interactive repl. It runs in the cloud, in
           | docker containers.
        
             | aol1306 wrote:
             | Do you have any abuse prevention mechanisms implemented?
             | For instance, preventing users from running infinite loops,
             | consuming too much resources and so on?
             | 
             | I built a similar service as a personal project and I am
             | interested how to properly handle situations like that.
        
               | yufw wrote:
               | Yes, currently the execution time is limited to 10s and
               | 10s compilation time for compiled languages. Memory limit
               | is 256M. It runs user code in docker container, I
               | leverage docker for restricting resources, more info at h
               | ttps://docs.docker.com/config/containers/resource_constra
               | in...
        
             | FrozenVoid wrote:
             | repl.it requires registration.
        
         | thenanyu wrote:
         | An engineer on my team years ago felt the same as you and built
         | his own solution for us to use during interview, eventually
         | spinning it into a very successful business. Check out
         | coderpad.io if you wanna get some inspiration. They took a
         | similar technical approach as you described, at least for the
         | first versions.
        
           | yufw wrote:
           | Thanks, this is really inspiring!
        
         | swimminginlove wrote:
         | Interesting project!
         | 
         | Any plans to make it open source?
        
           | yufw wrote:
           | No, I don't have plans to open source it currently. I am not
           | sure where open source will take this project to and the
           | source code is a bit messy. I may write about how I built it
           | in the future.
        
           | petterrasmussen wrote:
           | I just posted a Show HN for docker-run[1]. It can be used to
           | implement the code running part for a project like this.
           | 
           | [1] https://news.ycombinator.com/item?id=25602894
        
       | dailypeeker wrote:
       | Does something like this cost a lot? Do you know how much it
       | costs for, say , 10000 executions in each language?
        
         | yufw wrote:
         | The cost really depends on the scale. I started out to build
         | and use it as an interview tool and language playground for
         | myself, and I only have a single pretty standard cloud VM.
        
       | alex-wallish wrote:
       | How are you handling timeouts and forks? The following to
       | snippets have different results:
       | 
       | #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.
        
         | yufw wrote:
         | I have running time limit on the containers.
         | 
         | 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
        
       | alex-wallish wrote:
       | Pretty cool side project. Are you using Judge0 for code
       | execution?
        
         | yufw wrote:
         | No, the code is executed in docker containers hosted on Azure
         | VM.
        
           | mdaniel wrote:
           | Apologies for doing this "in public," but the About page has
           | no contact info, nor does your HN profile
           | 
           | 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
        
       | dmlerner wrote:
       | I'd love if it also showed the output collaboratively
        
         | yufw wrote:
         | Thanks, this is great feedback, will add this feature.
        
       | smallhands wrote:
       | this is a very neat tools thanks
        
         | yufw wrote:
         | I'm glad you like it.
        
       ___________________________________________________________________
       (page generated 2021-01-01 23:02 UTC)