News for hackers. Stuff that matters.
Re:6.5 Million LinkedIn Password Hashes Leaked by akkartik on Wednesday June 06, 2012 @12:43PM (#4074775)
How many hashes are present in both stripped and unstripped form?

  $ cat combo_not.txt |cut -c7-40 |sort |dups |wc -l
  670781
That's ~10% of the total.
Re:6.5 Million LinkedIn Password Hashes Leaked by uselessuseof on Wednesday June 06, 2012 @06:37PM (#4076556)
another useless use of cat

cut -c7-40 combo_not.txt|sort|dups|wc -l

what the heck is dups?

cut -c7-40 combo_not.txt|sort|uniq -d|wc -l

Re:6.5 Million LinkedIn Password Hashes Leaked by akkartik on Wednesday June 06, 2012 @07:07PM (#4076674)
Yeah I'm aware of http://partmaps.org/era/unix/award.html#cat and choose to continue writing my scripts this way. My commands look more symmetric at the prompt, and are easier to manipulate.

dups is indeed a little helper of mine. Like uniq it only handles sorted input. Update: I see you edited your answer to include uniq -d. I wasn't aware of the option, thanks. Now I can simplify the implementation of dups. But I find the name valuable, and I think it's perverse to say uniq when you mean its opposite.

Re:6.5 Million LinkedIn Password Hashes Leaked by uselessuseof on Wednesday June 06, 2012 @07:23PM (#4076729)
symmetric?
Re:6.5 Million LinkedIn Password Hashes Leaked by akkartik on Wednesday June 06, 2012 @07:33PM (#4076753)
Each pipe stage reads from the left and writes to the right. The eye goes left to see the input and right to see the output if it's redirected to file.

The input file is reliably the second word, so C-A M-f gets me to it if I want to operate on a different file. !!:1 gets me the file if I want to use it in a new command.

Re:6.5 Million LinkedIn Password Hashes Leaked by uselessuseof on Wednesday June 06, 2012 @09:07PM (#4077048)
echo abc > file

1. cat file

2. cat < file

3. echo abc|cat

4. echo abc|cat - file

cat can take input from the left, the right, or both

same goes for cut

Re:6.5 Million LinkedIn Password Hashes Leaked by akkartik on Wednesday June 06, 2012 @09:17PM (#4077080)
I'm not sure what you're suggesting. I'm supposed to echo |cut ...? But I have a whole file, not just one line. So I have to cat ... |cut ... -- which is what I did. So what's your point?

I could keep the file first by saying:

  $ < combo_not.txt cut -c7-40 |sort |dups |wc -l
To which I reply, "Yuck!"

Perhaps we should stop here. You seem to have made this account just a few hours ago for the express purpose of poking at people's code fragments in this thread. You're making stylistic nitpicks (they don't affect correctness, do they?) and you're making them in a tone that I'm not sure I would take from Randal Schwartz himself (you actually edited http://news.ycombinator.com/item?id=4076556 to be ruder than the original). It's a drag, man.

Re:6.5 Million LinkedIn Password Hashes Leaked by uselessuseof on Wednesday June 06, 2012 @10:43PM (#4077354)
cut takes a file as an argument. there's no need to start the line with <

   cut -c4-70 combo_not.txt|...
Re:6.5 Million LinkedIn Password Hashes Leaked by akkartik on Wednesday June 06, 2012 @10:55PM (#4077383)
But that's where this conversation started out. My response the last time around: http://news.ycombinator.com/item?id=4076674

BTW, HN has some formatting support: http://news.ycombinator.com/formatdoc