Live data from Hacker News

Show HN: Share one-liner command snippets

snippets.shodan.io

21–26 of 26 posts

Re: Show HN: Share one-liner command snippets

#21
1. This confused me:

  $ shodan stats --facets state:50 country:US tag:ics
You might want to add an obvious link on the site explaining what this "shodan" command is and where to get it.

I have never heard of "shodan", and have been using Unix and Unix-like systems since Seventh Edition (or maybe Sixth Edition...). Brew doesn't know about it on my Mac, and apt-cache doesn't know about it on my Debian system.

Going to the top level of your site (which should also have a link on the snippets page), I see that Shodan is some kind of search engine for IoT networks?

From there, I got to the developer site, and found it:

https://cli.shodan.io/

Note: it appears that you have to have a shodan API key to actually use it.

2. Having each one-liner open in its own page seems vaguely unsettling, especially since the description of each on the first page starts with "»". That symbol will suggest to many that the line contains collapsed content, and clicking should expand it to show the snipped. I think that kind of interface would work a lot better (especially if there was an option to expand and collapse all).

Re: Show HN: Share one-liner command snippets

#23

Nice! One feature request. In snippets like these: https://snippets.shodan.io/c/BADsCL6DDfi4hSMM - can you add an input to modify the variables and copy the final one? It is umcofortable for me to copy it into the command line, edit the command with my values, and send it. It would be easier to just update DIR in the page and copy the final command. I hope I explained myself!

Ohhh, that's an interesting idea. Not yet sure how I would handle the syntax highlighting though if it becomes possible to edit the content.

Re: Show HN: Share one-liner command snippets

#25
post #9

A feature request: when you highlight the command line, do not include the shell prompt.

It works on Chrome and some other browsers that support the "user-select:none" CSS rule, though it's not part of the standard hence the lack of general support. I will look into doing a better cross-browser solution!

Re: Show HN: Share one-liner command snippets

#26
Since you are making tool argument syntax highlighting a challenging but nice feature would be to be able to switch between command separators. For example in sed you can make a dense one liner with semicolons or expand it to multiple lines. Would be nice to read it expanded and copy as a one liner
Post reply on HN