Settings

Theme

Show HN: Curl lama.sh – sh to start a web server anywhere

lama.sh

7 points by csweichel 7 years ago · 8 comments

Reader

cujic9 7 years ago

So, this just downloads a web server written in Go and runs it? Why isn't this more explicit?

  • csweichelOP 7 years ago

    That's exactly right.

    However, it does the downloading/starting in a really convenient manner. I wanted something I could just quickly type into a terminal without having to browse some GitHub release page.

caspervonb 7 years ago

Fair warning to users, you should never ever pipe something from the web directly into a shell.

I'm sure the author here has good intentions but, this is aimed at beginners (I'll assume, doubt anyone reasonably experienced would humor this) and teaching them a terrible idea.

  • csweichelOP 7 years ago

    Not sure this statements holds in this general form - it's a very good idea to be cautious what you execute, but curl | sh is not much different from running npx for example. It's difficult to know know what will actually be executed on your machine, but at least shell scripts can be inspected/audited (as compared to packages with 100 dependencies).

    That said, prior to piping anything to a shell it's advisable to inspect what is about to be executed. That's why the lama.sh script is super simple, as is the code of the web server it downloads and executes.

caspervonb 7 years ago

When are you dropping a cryptominer into it? ;-)

OceanKing 7 years ago

Why not `python3 -m http.server`?

  • csweichelOP 7 years ago

    Just in case you don't have Python :)

    I got a tad fed up with having to remember the line for Python, Node and Ruby. This one works as long as you have bash and curl.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection