Live data from Hacker News

Password Generator

beta.browxy.com

21–30 of 44 posts

Re: Password Generator

#21
post #16

Earlier quoted context omitted.

Your cute one-liner for 4 words: sort --random-sort /usr/share/dict/words | head -n 4 | tr -d '\n' You may wish to omit words that have "'" characters, in which case you may throw in a grep -v "'" after the sort.

Thank you. I think it's a testament to the power of unix that two different people responded with solutions using different commands. I should have thought of sort, it feels natural in retrospect. Am I right in believing bash pipes are lazy enough that that won't require sorting the whole file, just pulling out four random lines? As a side note, I'm guessing grep had -v before it became a standard for verbose? That's…

I don't think the pipe could know that head will have the -n 4. In what context is -v standard for verbose?

edit: This stack exchange seems to relevant https://stackoverflow.com/questions/45326901/lazy-non-buffer...

I don't think grep was originally open source. FWIW, the nemonic for -v on grep is inVert. I'm so happy that --long_options are a thing nowadays, much more readable.

Re: Password Generator

#22
Thanks for all the nice comments that are intended with good karma. What other feature can I add to this password generator that is useful? I agree that using linux is more secure but for passwords that are not as important I think this tool works fine, also you don't need to remember a big line of code and you can execute it on your mobile phone

Re: Password Generator

#25

Earlier quoted context omitted.

Thank you. I think it's a testament to the power of unix that two different people responded with solutions using different commands. I should have thought of sort, it feels natural in retrospect. Am I right in believing bash pipes are lazy enough that that won't require sorting the whole file, just pulling out four random lines? As a side note, I'm guessing grep had -v before it became a standard for verbose? That's…

I don't think the pipe could know that head will have the -n 4. In what context is -v standard for verbose? edit: This stack exchange seems to relevant https://stackoverflow.com/questions/45326901/lazy-non-buffer... I don't think grep was originally open source. FWIW, the nemonic for -v on grep is inVert. I'm so happy that --long_options are a thing nowadays, much more readable.

I'm pretty sure that head pulls from up in the pipeline line-by-line. Interesting to know the mnemonic. Many modern command-line utilities use -v for verbose logging, in my (limited) experience.

Re: Password Generator

#26
post #2

This generates the password on a server you don't control. I recommend not using it. Using 'tr -dc A-Za-z0-9 < /dev/urandom | head -c $length' is more secure and available on your linux or osx machine even more easily than waiting a second for a server to run some java off in a magic black box.

You can also try indexing into /usr/share/dict/words for a correcthorsebatterystaple-style password. I'm sure there's a cute on-liner, I did it in Python because that took a lot less time than all the man page searching how to do it with Unix text processing tools would have taken. Yes, it would be better to remember random characters of the same length. But most people don't. I personally have one password I use to…

Here's a perl one for fun :)

  perl -MList::Util=shuffle -0ane 'print ((shuffle @F)[0..3],"\n")' 

Re: Password Generator

#27

Earlier quoted context omitted.

You can also try indexing into /usr/share/dict/words for a correcthorsebatterystaple-style password. I'm sure there's a cute on-liner, I did it in Python because that took a lot less time than all the man page searching how to do it with Unix text processing tools would have taken. Yes, it would be better to remember random characters of the same length. But most people don't. I personally have one password I use to…

Here's a perl one for fun :) perl -MList::Util=shuffle -0ane 'print ((shuffle @F)[0..3],"\n")'

Why thank you :)

From the perspective of someone who's just getting started with learning to code, perl seems like a pile of spermaceti: was once very important, could be turned into beautifully smelling products so long as you didn't pay too much attention to the production process, and no longer needed because of modern synthetics :)

But I've only ever read people mocking perl, never built anything with it. It appears immensely powerful, but collapsing arrays by default makes no sense at all.

Re: Password Generator

#28

Earlier quoted context omitted.

Here's a perl one for fun :) perl -MList::Util=shuffle -0ane 'print ((shuffle @F)[0..3],"\n")'

Why thank you :) From the perspective of someone who's just getting started with learning to code, perl seems like a pile of spermaceti: was once very important, could be turned into beautifully smelling products so long as you didn't pay too much attention to the production process, and no longer needed because of modern synthetics :) But I've only ever read people mocking perl, never built anything with it. It appe…

Perl's problem is that it's more confusing than it is powerful.

I think most of the people who were into Perl for the "beauty" ended up going to ruby.

People who were into it for CPAN went to python.

You might find this interesting, as you can see the spirit is alive and well: https://github.com/learnbyexample/Command-line-text-processi...

  ruby -0ane 'print $F.shuffle[0..3].join,"\n"' 
If you're intrigued by the idea of perl one-liners, go explore ruby.

Re: Password Generator

#29

Earlier quoted context omitted.

Why thank you :) From the perspective of someone who's just getting started with learning to code, perl seems like a pile of spermaceti: was once very important, could be turned into beautifully smelling products so long as you didn't pay too much attention to the production process, and no longer needed because of modern synthetics :) But I've only ever read people mocking perl, never built anything with it. It appe…

Perl's problem is that it's more confusing than it is powerful. I think most of the people who were into Perl for the "beauty" ended up going to ruby. People who were into it for CPAN went to python. You might find this interesting, as you can see the spirit is alive and well: https://github.com/learnbyexample/Command-line-text-processi... ruby -0ane 'print $F.shuffle[0..3].join,"\n"' If you're intrigued by the idea…

I will, I hope, someday. I want to get an intermediate knowledge of Lisp, or C, or Rust first I think. I know a bit of Python, and think I'd prefer to learn something more different than it next. My impression is that Python is a less whimsical more enterprise-y and conformist sibling of ruby.

Re: Password Generator

#30

Earlier quoted context omitted.

Perl's problem is that it's more confusing than it is powerful. I think most of the people who were into Perl for the "beauty" ended up going to ruby. People who were into it for CPAN went to python. You might find this interesting, as you can see the spirit is alive and well: https://github.com/learnbyexample/Command-line-text-processi... ruby -0ane 'print $F.shuffle[0..3].join,"\n"' If you're intrigued by the idea…

I will, I hope, someday. I want to get an intermediate knowledge of Lisp, or C, or Rust first I think. I know a bit of Python, and think I'd prefer to learn something more different than it next. My impression is that Python is a less whimsical more enterprise-y and conformist sibling of ruby.

My unsolicited advice: Don't worry too much about specific languages. The most valuable thing you can do is get a strong command of *nix and solve a lot of real-world problems with it. Make it your desktop OS and spend a lot of time with it. Build yourself a router. Make a RPi do something to improve your life. Take some cloud service you use and figure out if you could do it the libre way yourself. Build your own NAS. Bonus points if you learn vim or emacs while you're doing it.

Don't worry too much about the meta-narrative about the culture associated with each of the languages. The surveillance state is being built with python, but a lot of hardware hackers prefer python too. Ruby is praised for its flexibility, but its most successful project is literally called "Ruby on Rails" because it tells you exactly how to do everything.

The way people feel about languages goes in cycles, so it's good to be aware of it, but you can mostly ignore it. Use the best tools for the job. If the job is making computers do things, the best tool is unix :)

Post reply on HN