News for hackers. Stuff that matters.
Re:What is the coolest thing you can do in ten lines of code? by charlesap on Friday December 30, 2011 @09:21PM (#3409902)
Is 30 close enough to 10?

I got a job with 30 lines of code appended to my resume, with a screenshot of the resultant output.

Perhaps the first two pages had something to do with it but I was told that the third page was what stood out.

This was a sysadmin position, the code includes bash, sed, awk, grep, tcpdump, netcat and gnuplot.

Hint to anyone who tries this sort of resume stunt: You WILL be asked what the code does.

Just the code: http://bbookkss.com/CharlesPerkinsCV3of3Pages.pdf

Re:What is the coolest thing you can do in ten lines of code? by moe on Saturday December 31, 2011 @05:22AM (#3410627)
That's indeed an interesting example because, by any standard, this is terrible code.

Yet for a sysadmin position it still provides valuable insight into your a) pain threshold, b) familiarity with the tools, c) willingness and ability to bend reality for the boss.

I'd just add a big disclaimer that this kind of code only happens in emergencies.

(disclaimer: I'm guilty of these gnuplot hacks myself and they always stick around way longer than they should...)

Re:What is the coolest thing you can do in ten lines of code? by cydonian_monk on Saturday December 31, 2011 @11:25AM (#3411163)
> They always stick around way longer than they should...

But isn't that true for all 'terrible' code? Most of the elegant and well-formed code I write ends up getting butchered for the sake of 'features,' while the quick hacks that 'just work' stick around forever.

Re:What is the coolest thing you can do in ten lines of code? by martincmartin on Saturday December 31, 2011 @06:44PM (#3412232)
That's indeed an interesting example because, by any standard, this is terrible code.

It's not nice to criticize without being constructive. Care to explain why the code is bad, and offer better suggestions?

Re:What is the coolest thing you can do in ten lines of code? by icebraining on Saturday December 31, 2011 @02:30AM (#3410414)
Useless 'cat' detected ;)

But seriously, nice work. Being able to put something useful together that easily (in terms of lines of code) is what most attracted me to UNIX/Linux coming from Windows. The amount of CLI tools one can take advantage of is simply astonishing.

Re:What is the coolest thing you can do in ten lines of code? by meric on Friday December 30, 2011 @10:49PM (#3410087)
How long would it have taken you to write that?