
Show HN: Share one-liner command snippets - achillean
https://snippets.shodan.io
======
svenwltr
Interesting, but
[https://www.commandlinefu.com/](https://www.commandlinefu.com/) is there for
quite a long time. What are the benefits over it?

~~~
achillean
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](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](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](https://snippets.shodan.io/c/GhFfOh2r0mOSLrcJ.png)

------
OskarS
This one is neat!

    
    
        $ curl wttr.in/
    

Not sure if I'd use it much, but it is nifty!

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

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

------
tzs
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/](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).

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

~~~
achillean
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!

------
alainchabat
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?

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

~~~
haasted
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?

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

------
pmtarantino
Nice! One feature request. In snippets like these:
[https://snippets.shodan.io/c/BADsCL6DDfi4hSMM](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!

~~~
achillean
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.

------
fareesh
The fonts on the listing page are really painful to read

[https://imgur.com/Y9zdyyX](https://imgur.com/Y9zdyyX)

Something with thicker lines would be great

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

------
jcutrell
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!

------
loa-in-backup
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

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

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

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

------
7ewis
Looks like someone has tested XSS there already.

