TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: bash.rocks – A bash interpreter in the browser

58 点作者 wsxiaoys将近 8 年前

10 条评论

wsxiaoys将近 8 年前
Hey HN, bash.rock is my latest side project, a bash interpreter in cloud, it comes with many utilities like curl, Python, ImageMagick, jq, etc.<p>Below are some snippet I created:<p>Generate random corporate bullshit: <a href="https:&#x2F;&#x2F;bash.rocks&#x2F;w3nEB9" rel="nofollow">https:&#x2F;&#x2F;bash.rocks&#x2F;w3nEB9</a><p>Compress png to webp: <a href="https:&#x2F;&#x2F;bash.rocks&#x2F;YBbaJG" rel="nofollow">https:&#x2F;&#x2F;bash.rocks&#x2F;YBbaJG</a><p>Generate gif with curl, jq and ImageMagick: <a href="https:&#x2F;&#x2F;bash.rocks&#x2F;NBXQ3w" rel="nofollow">https:&#x2F;&#x2F;bash.rocks&#x2F;NBXQ3w</a><p>Any suggestions &#x2F; feedback welcome! :)<p>---<p>A more interesting feature I haven&#x27;t fully finished is to turn your random bash snippet into an HTTP web service, like <a href="https:&#x2F;&#x2F;bash.rocks&#x2F;Gxlg31&#x2F;3&#x2F;api?url=i.imgur.com&#x2F;1uYroRF.gif" rel="nofollow">https:&#x2F;&#x2F;bash.rocks&#x2F;Gxlg31&#x2F;3&#x2F;api?url=i.imgur.com&#x2F;1uYroRF.gif</a><p>which makes an obvious <i>premium</i> feature in future :p
评论 #14580717 未加载
评论 #14580523 未加载
评论 #14578536 未加载
TylerJewell将近 8 年前
Hey - founder &amp; CEO of Codenvy, also project lead for Eclipse Che - a workspace server and cloud IDE. We have learned a little bit about what it takes to run environments in the cloud and then present development experiences for languages in the browser.<p>Congrats to @wsxiaoys for launching a new project. Anyone who takes the time to launch projects are doing a labor of love and commitment, so that deserves credit and recognition!<p>Some observations that you may want to think about: a) The time to execute a simple bash command &quot;echo &#x27;hi&#x27;&quot; was a few seconds. This tells me that you are probably spinning up a new Docker container on-demand after the user says &quot;run&quot;. This will not really make the product usable over time. You&#x27;ll eventually find that people will expect their environment to be loaded and running the moment their end user session has started. This way you can use Docker exec or other mechanisms (in Che we replaced Docker exec with a custom agent that runs inside the container that gives us fine-grained control over how processes are executed within the container). When a user says &quot;run&quot; you can then guarantee instant execution and then control how results are streamed.<p>b) I wrote most of the CLI for Eclipse Che and Codenvy (in bash!!). So learned that a few project &#x2F; framework concepts are essential. In particular a project structure that allows you to source different files &#x2F; or libraries will become important. Also, BATS for unit testing is essential to anyone maintaining bash scripts. Few people use BATS, but it&#x27;s a life saver, so having automatic structuring of BATS tests as users creates bash files would be awesome.<p>c) Have you seen the language server protocol? No one has built a language server yet for Bash. It would be awesome to have symbol lookup, referencing, and auto-complete services within your editor. You could use a Monaco editor with a bash language server to give contextualized intelligence to your bash program for the developer. You could even go so far as to offer line by line debugging with it :)<p>Thanks for your contributions to the community!
polygot将近 8 年前
Seems like a cool idea, but clicking on this link will immediately download a file to your computer: <a href="https:&#x2F;&#x2F;bash.rocks&#x2F;KJKEk3" rel="nofollow">https:&#x2F;&#x2F;bash.rocks&#x2F;KJKEk3</a><p>(it&#x27;s just a snippet from &#x2F;dev&#x2F;urandom, but it looks like it could be any arbitrary file that&#x27;s within the size limits)<p>For example, <a href="https:&#x2F;&#x2F;bash.rocks&#x2F;jJg193" rel="nofollow">https:&#x2F;&#x2F;bash.rocks&#x2F;jJg193</a> shows that it is possible to download any arbitrary data with no prompt (here it&#x27;s the eicar test file)<p>EDIT: where can I contact the author? I found a very bad security bug; I can see what commands other users are running
评论 #14581547 未加载
fiatjaf将近 8 年前
So it&#x27;s not bash, but a full Linux (?) environment with bash as the shell and some programs installed by default.
tannhaeuser将近 8 年前
For node.js, there&#x27;s also cash [1], shelljs [2], and an initial bash syntax parser [3], which actually implement POSIX shell subsets in Javascript (unlike this project, which I understand calls out to a server-side bash process). Though cash and shelljs work synchronously only, which make them usable for build scripts etc. but not web services.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;dthree&#x2F;cash" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dthree&#x2F;cash</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;shelljs&#x2F;shelljs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;shelljs&#x2F;shelljs</a><p>[3]: <a href="https:&#x2F;&#x2F;github.com&#x2F;dthree&#x2F;vorpal" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dthree&#x2F;vorpal</a>
comex将近 8 年前
I was hoping for WebAssembly - that is, a bash interpreter really running in the browser. Of course, that would be a lot more ambitious, since unless you wanted to be limited to bash builtins, you’d also need some kind of kernel and the ability to run other processes…<p>(Yes, I’ve seen jslinux.)
ams6110将近 8 年前
Neat, but what is the practical use? I already have a shell on my computer.
评论 #14581849 未加载
fimdomeio将近 8 年前
can someone explain me how can this exist without being a security nightmare? From what I saw it&#x27;s on a read only filesystem which looks like a great idea but what else?
评论 #14581825 未加载
e79将近 8 年前
Does each session run in an isolated container? Because I wonder, what&#x27;s stopping an attacker from exhausting system resources, messing with other users stuff, etc.?
评论 #14581618 未加载
评论 #14580677 未加载
fiatjaf将近 8 年前
Can we get fish instead of bash?