News for hackers. Stuff that matters.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by wyldfire on Thursday August 10, 2017 @03:49PM (#14983446)
> Our platform uses Docker images to run the code

Hopefully you've already thought this through and you left out all of the copious complex security details of the sandboxing out of this announcement.

But just in case you haven't:

- containers don't provide the best sandboxing on their own

- if I get sufficient privilege in your container, I can read/write directly to the device nodes inside the container to impact the host

- you should also fear cryptocurrency miners burning your cycles

But, kudos to you -- this looks like a really neat feature. A quick skim of your homepage seems to suggest that sandboxing should be core to your product's success, so I'll just hope for the best. :)

Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by rewrew on Thursday August 10, 2017 @04:11PM (#14983664)
I love this, but I worry about longevity -- if we convert all our code snippets to this, and then this dies, all the older blog posts become useless. You'd be surprised how many reads even 5+ year old blog posts can get.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by tolmasky on Thursday August 10, 2017 @04:38PM (#14983990)
One of the nice things about the way we do things with RunKit embeds (https://runkit.com/docs/embed) is that the code lives in your site, not on ours. The API generates the embed the same way something like highlight.js generates syntax-colored code on your site. That means if we're ever down, your site gracefully degrades to a not-runnable snippet, as opposed to merely disappearing like this seems to or with embedded gists.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by peternicky on Friday August 11, 2017 @12:36PM (#14991587)
RunKit is awesome, highly recommend it.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by ktRolster on Thursday August 10, 2017 @02:42PM (#14982788)
Given that every OS, even OpenBSD is frequently vulnerable to privilege escalation exploits, it always makes me nervous to run someone else's code.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by RMarcus on Thursday August 10, 2017 @03:46PM (#14983414)
repl.it has had this capability for a while, although the embedded environment can be a little heavy.

https://repl.it/site/docs/embed

Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by mikeash on Thursday August 10, 2017 @01:08PM (#14981792)
The code running part seems to have been hugged to death, but I like the idea. Any chance the snippets could be made to run locally, either on my own server, or better yet within the user's browser itself?
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by Myztiq on Thursday August 10, 2017 @02:40PM (#14982766)
Well, there is http://code.runnable.com/ which does something similar. I don't remember if it outputted a dockerfile, but I do know it runs everything inside docker. I used to work at the company.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by lotyrin on Thursday August 10, 2017 @01:09PM (#14981808)
https://github.com/viebel/klipse but afaict it only supports certain languages and doesn't emulate a server environment.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by tbrock on Thursday August 10, 2017 @08:39PM (#14985714)
How would one build something like this securely and ensure fairness to all those who wish to execute (avoid DOS)?

Surely there is more to it than just running the code in a Docker container, right?

Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by throwaway2016a on Thursday August 10, 2017 @01:19PM (#14981893)
Edit: I skimmed the article but I missed part. Apologies.
Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by jsjohnst on Thursday August 10, 2017 @01:41PM (#14982148)
Did you read the linked article?

> Our platform uses Docker images to run the code, so you can use code snippets in virtually any technology. A lot of contributors have already made the most of our technology and have crafted playgrounds of impressive quality.

Emphasis added by me.

Re:Show HN: Run Code Snippets in Any Language Inside Your Blog by throwaway2016a on Thursday August 10, 2017 @02:24PM (#14982625)
I did read that part but I also went to the website and tried the service and could only find out how to do it via the pre-made templates.