News for hackers. Stuff that matters.
Re:Show HN: Share one-liner command snippets by svenwltr on Monday November 19, 2018 @04:33AM (#18485129)
Interesting, but https://www.commandlinefu.com/ is there for quite a long time. What are the benefits over it?
Re:Show HN: Share one-liner command snippets by achillean on Monday November 19, 2018 @04:41AM (#18485163)
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

Re:Show HN: Share one-liner command snippets by OskarS on Monday November 19, 2018 @06:40AM (#18485693)
This one is neat!

    $ curl wttr.in/
Not sure if I'd use it much, but it is nifty!
Re:Show HN: Share one-liner command snippets by raboukhalil on Monday November 19, 2018 @08:56AM (#18486388)
Another good one is "curl parrot.live" (shows a party parrot animation)
Re:Show HN: Share one-liner command snippets by piotrkubisa on Monday November 19, 2018 @09:38AM (#18486654)
I guess it is based on https://github.com/schachmat/wego
Re:Show HN: Share one-liner command snippets by sinstein on Monday November 19, 2018 @06:28AM (#18485637)
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.

Re:Show HN: Share one-liner command snippets by tzs on Monday November 19, 2018 @12:16PM (#18487886)
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 by aritmo on Monday November 19, 2018 @07:21AM (#18485880)
A feature request: when you highlight the command line, do not include the shell prompt.
Re:Show HN: Share one-liner command snippets by achillean on Monday November 19, 2018 @02:24PM (#18488932)
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 by alainchabat on Monday November 19, 2018 @06:04AM (#18485543)
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?
Re:Show HN: Share one-liner command snippets by p4bl0 on Monday November 19, 2018 @10:02AM (#18486862)
I really don't like it when websites do that. What if I had something I cared about in my clipboard?
Re:Show HN: Share one-liner command snippets by achillean on Monday November 19, 2018 @06:10AM (#18485572)
Thank you and it's been added to the issue tracker! Should be included in the next release :)
Re:Show HN: Share one-liner command snippets by 0x14c1de72 on Monday November 19, 2018 @10:12AM (#18486939)
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.
Re:Show HN: Share one-liner command snippets by haasted on Monday November 19, 2018 @07:20AM (#18485874)
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?
Re:Show HN: Share one-liner command snippets by achillean on Monday November 19, 2018 @12:04PM (#18487787)
Yes, that will be added! For the first release I mostly just wanted to get the basics working.
Re:Show HN: Share one-liner command snippets by pmtarantino on Monday November 19, 2018 @08:06AM (#18486105)
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!
Re:Show HN: Share one-liner command snippets by achillean on Monday November 19, 2018 @12:55PM (#18488226)
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 by fareesh on Monday November 19, 2018 @09:52AM (#18486781)
The fonts on the listing page are really painful to read

https://imgur.com/Y9zdyyX

Something with thicker lines would be great

Re:Show HN: Share one-liner command snippets by achillean on Monday November 19, 2018 @12:05PM (#18487796)
Hmmm, they don't look as bad on my system - I will need to look into this one. Thank you for the heads-up!
Re:Show HN: Share one-liner command snippets by jcutrell on Monday November 19, 2018 @09:06AM (#18486447)
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!

Re:Show HN: Share one-liner command snippets by loa-in-backup on Tuesday November 20, 2018 @03:45AM (#18492579)
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
Re:Show HN: Share one-liner command snippets by newaccoutnas on Monday November 19, 2018 @12:17PM (#18487895)
I'd look, but 'Secure Connection Failed' so, maybe next time.
Re:Show HN: Share one-liner command snippets by achillean on Monday November 19, 2018 @01:27PM (#18488474)
It's using Cloudflare - not sure why you'd get that error...
Re:Show HN: Share one-liner command snippets by anonlastname on Monday November 19, 2018 @12:15PM (#18487871)
This is interesting. I wonder how long until people get pwned off of it.
Re:Show HN: Share one-liner command snippets by 7ewis on Monday November 19, 2018 @11:20AM (#18487454)
Looks like someone has tested XSS there already.