Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Share one-liner command snippets (shodan.io)
145 points by achillean on Nov 19, 2018 | hide | past | favorite | 25 comments


Interesting, but https://www.commandlinefu.com/ is there for quite a long time. What are the benefits over it?


Primarily, I wanted something with better syntax highlighting. Especially for tools that I feel are common/ popular but aren't part of Bash so they're not usually highlighted as they're not part of the language.

With this, I was trying to create a set of highlighting rules that would make arguments more obvious to read. For example:

https://snippets.shodan.io/c/KicwlhJFezcAAhWe

I wrote the website because I wanted to have that sort of syntax highlighting for the commands I share in our docs to make it easier to read/ understand. Btw the description field supports Markdown so you can also explain the commands in further detail, see:

https://snippets.shodan.io/c/GhFfOh2r0mOSLrcJ

And the commands can be embedded as images by appending ".png" to the end of the URL:

https://snippets.shodan.io/c/GhFfOh2r0mOSLrcJ.png


This one is neat!

    $ curl wttr.in/
Not sure if I'd use it much, but it is nifty!


Another good one is "curl parrot.live" (shows a party parrot animation)


I guess it is based on https://github.com/schachmat/wego


Nifty list of snippets. Would love it if the snippets could be expanded inline on the homepage instead of opening a new page for every snippet.

The carets on the left also give me the impression that the card will expand and reveal the snippet but then I am sent to a new page. Slightly annoying.


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).


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!


Like it! Feature request: when we click on the command line, select all the command line and copy it in the clipboard, instead of having to double click then ctrl+c?


I really don't like it when websites do that. What if I had something I cared about in my clipboard?


Thank you and it's been added to the issue tracker! Should be included in the next release :)


I would be very careful about adding a copy to clipboard feature in a website like this. At the very least i hope you will strip newlines in case you implement this. Would be quite awful to copy something without noticing and running it if you mistakenly paste it in a console.


Cool project! Are you considering any kind of vetting mechanism for sorting the great stuff from the less great stuff, e.g. user voting or similar?


Yes, that will be added! For the first release I mostly just wanted to get the basics working.


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.


The fonts on the listing page are really painful to read

https://imgur.com/Y9zdyyX

Something with thicker lines would be great


Hmmm, they don't look as bad on my system - I will need to look into this one. Thank you for the heads-up!


Would love to see this with the fonts a bit larger. Would also prefer to see these expand to show the command beneath the descriptor.

Nice work!


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


I'd look, but 'Secure Connection Failed' so, maybe next time.


It's using Cloudflare - not sure why you'd get that error...


This is interesting. I wonder how long until people get pwned off of it.


Looks like someone has tested XSS there already.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: