The hard part in becoming a command line wizard - <AUTHOR> https://www.johndcook.com/blog/2019/02/18/command-line-wizard/ <comment><USER4> I like the "everything is text" mentality, but really, the "hard part" of the GNU/Linux CLI is getting things done _when you don 't already know how_.

If you've memorized the hundreds of different invocation arguments for find, sed, grep, tr, sort, uniq, cat, xargs, etc. -- then yes, you can be very fast. If not -- be prepared to RTFM for about 4 different programs to get your job done.

That's an incredible hurdle and it really only makes sense if you are using these tools daily/weekly. I'm still not completely convinced that its "worth it" to master these tools, when general-purpose scripting languages are _almost_ as succinct and obviously way more powerful. That's speaking as someone who's written a fair amount of Bash.

In contrast, I think tools with higher discoverability and self-documenting nature (arguably, Excel) usually offer a more user-friendly way of doing the same thing, unless you are doing it _a lot_.

<comment><USER5> Yes, most of us would probably have to check the manpage for three or four of these utility programs to put together something like Rob McIlroy's one-liner from the article. I think this is clearly still more efficient than writing 17 pages worth of code in a general purpose language, which is what it's being pitted against. I also don't think it's really a very high hurdle -- if I were writing the same thing in a Python or Perl script I bet I would end up also consulting the documentation to check exactly how to do things or what some detail of syntax is. If you happen to write Python all day every day then sure, you'll find it much faster to just write a quick Python script for this sort of thing. If your day job is C or Java or some other non-scripting language and this is a once-a-month-or-so task then I think the time required to do this sort of small utility task in shell-and-utility-tools is not really any different to remembering how to write Perl scripts.

<comment><USER6> The 17 pages comment gets me. Literate programming is verbose by design. I'd be surprised if the Ruby version of that script was much longer than the command line version.

</comment></comment></comment><comment><USER7> The Lisp philosophy is very similar to the unix philosophy, but with one crucial modification: instead of "everything is text" the mantra becomes "everything is an S-expression".

The reason s-expressions are better than text is that they are more expressive. They allow arbitrary levels of nesting whereas text doesn't. Text naturally develops a record structure with only two levels of hierarchy: records separated by newlines, containing fields separated by some other delimiter (usually spaces, tabs or commas, sometimes pipes, rarely anything else). Going any deeper than that is not "native" for text. That's why, say, parsing HTML is "hard" for the unix mindset. But a Lisper naturally sees HTML (and XML and JSON and, well, just about everything) as just an S-expression with a more cumbersome syntax.

<comment><USER8> > The reason s-expressions are better than text is that they are more > expressive

That has got to be a joke right? S-expressions are a subset of text it's axiomatically impossible for them to be more expressive.

<comment><USER9> Sugar is better than sooty water. They are both C, H, O, but the sugar has useful structure.

s-expressions are structured text. Therefore, for some set of problems, s-expressions are "better" (contain more information, are more easily manipulated, etc.) than unstructured text.

<comment><USER8> Please provide an example of an s-expression that provides more information than can be encoded though a text string that is the same length, and in fact identical to said s-string.

I mean, I get it. Lispers like lisp, and think it's "better". But it's more more expressive than text, and in fact operating on text gives you natural access not just to s-expressions but to any other programming languages or structured and unstructed examples of text.

If you shell operated only on s-expressions that would either have you reduce expresiveness, or just doing tricks to encode the text-stream as a s-expression which hardly qualifies as making it more expressive, that's just adding extra redundant information around the original information.

<comment><USER10> > Please provide an example of an s-expression that provides more information > than can be encoded though a text string that is the same length, and in > fact identical to said s-string.

We're talking about a class of strings, not a single individual string. S-expressions are more constrained than arbitrary text, and therefore contain more structure than arbitrary text. Constraints _are_ information.

You can't simply impose a tree structure on any arbitrary piece of text.

</comment></comment></comment></comment></comment><comment><USER11> For me, clever one liners is a very much an iterative process. In the example given I'd find (memory or Google) the program to spit out each word, then find how to count them, somehow sort it. In the end you might have a multi line sequence of commands, then you gradually move them to pipes. It is rarely written in one swoop anyway.

</comment><comment><USER12> If learning all that stuff is too hard for you, follow this advice from Dilbert: [https://dilbert.com/strip/2010-05-16](https://dilbert.com/strip/2010-05-16)

:-)

<comment><USER13> I used to LOVE Dilbert. His comics are so funny.

I didn't mind the Trump stuff. I think Scott Adam's insights were valuable even if his comments were extremely frustrating and contradictory.

But his somewhat new Climate Change denial stuff finally made me unfollow him.

[https://twitter.com/ScottAdamsSays/status/109968558214017024...](https://twitter.com/ScottAdamsSays/status/1099685582140170240)

<comment><USER14> > But his somewhat new Climate Change denial stuff finally made me unfollow > him.

I don't follow Scott Adams, but my understanding from when he started talking about that subject is that he is not denying climate change, but he is acting as a climate skeptic in order to bring about debate and enlighten people on all sides.

For a (possibly bad and certainly trite) metaphor, it's somewhat like saying "Gravity is settled science" to a gravity denialist. You could instead provide some facts and experiments they could try such as holding their hands above their head to fight the force[0] of gravity. They could decide they don't think your facts are correct and perhaps theorize other reasons why they cannot hold their hands above their head indefinitely.

That's science, where even gravity is "just" a theory[1].

[0] Apparently in the Theory of Relatively, gravity is not actually a force, but a consequence of the curvature of space-time and uneven distribution of mass

[1] [https://en.wikipedia.org/wiki/Gravity#Modern_alternative_the...](https://en.wikipedia.org/wiki/Gravity#Modern_alternative_theories)

<comment><USER15> > _I don 't follow Scott Adams, but my understanding from when he started > talking about that subject is that he is not denying climate change_

We don't need debate on climate change. There are not "sides". (Unless you count reality and magical thinking as "sides".)

<comment><USER16> We absolutely need debate and skeptics on climate change. Debate doesn't mean adversarial; it means questioning the evidence and possible interventions.

If we aren't debating on climate change, how do we decide where to put resources to reduce emissions and clean up existing pollution?

<comment><USER15> >Debate doesn't mean adversarial; it means questioning the evidence

Questioning the evidence of climate change is de facto adversarial. The evidence is overwhelming and beyond question. No intelligent, sane person arguing in good faith would argue otherwise.

<comment><USER16> Your derision and perspective are more appropriate for a religious zealot than a scientific thinker. Skepticism is the heart of science.

I have not invested enough time in understanding the currently best climate models. I must, therefore, take a skeptical approach and question conclusions drawn from that evidence. Especially so for a projection.

For the level of assurance you seem to have, I assume that you have rerun models yourself, have a deep understanding of complex systems and statistics, and done other climactic work? Even that is skepticism applied and questions asked.

</comment></comment></comment></comment></comment></comment></comment><comment><USER17> I never really got to be a command line wizard even after 7 years of using it daily. After some time it struck me that I am somewhat of a wizard in Ruby and most of the things that I need to to in the terminal would be really easy for me if I could make use of my Ruby skills in a more natural way. I came up with rb [1] which made it possible and I no longer read man pages of simple unix tools

[1] [https://github.com/thisredone/rb](https://github.com/thisredone/rb)

<comment><USER18> I'm about the closest to a command-line wizard that I know personally, but the only reason is that I grew up on the command-line - I had already graduated college before GUIs were common. I'm not entirely convinced that, in today's era, spending the time it takes to really master the command line is honestly worth it; you need to know how to do some things, but there are probably better tools for most of these jobs. A lot of what I do naturally with sed, awk, cut, paste, uniq, sort and tr could be done just as quickly and naturally in Excel; I just use the command line because I already know it.

</comment></comment><comment><USER19> > _The output of a shell command is text. Programs are text. Once you get into > the necessary mindset, everything is text._

This mindset is also how we got the C preprocessor...

<comment><USER20> Programs are _structured_ text. The judtaposition is against binary structures (Windows style) that require an intermediary to perform translation for humans.

The C-preprocessor travesty is text, but hygenic macros are also text. The difference is structure.

</comment></comment><comment><USER21> And the best bit about PowerShell is that you don't have to force everything into text, and then work out how to parse it back out of text.

You are in a scripting language REPL where you can have a hashtable of words and their counts, and keep it structured

        gc words.txt |% { -split $_ } | group | sort count -desc | select -first 5

and when I saw the first one was spaces:

        gc words.txt |% { -split $_ -match '^\w+$' } | group | sort count -desc | select -first 5

But the point isn't that you can do it, or any comment on the length of it, the point is that the output of group (group-object) is structured - <USER2> counts are [int] types, the sort is able to pick those out and sort on them without needing to parse them out of text and convert them to numbers, the select (select-object) isn't outputting individual lines of text, so the structure isn't lost when shown on screen, and the output can be formatted for display as columns, lists, tables, from its structure.

</comment><comment><USER22> I tried it on the text of the article itself.

Here's my cmdline:

# cat file | preserve only spaces and letters (remove punctuation) | convert to lowercase and put each word on one line | use awk maps to keep a count for each word and print map in two columns, count followed by word | sort in reverse numerically by count column, then by word ascending | print top 10 words by frequency

cat input.txt | sed -e 's/[^a-zA-Z ]//g' | tr -s ' A-Z' '\na-z' | awk -F ' ' '{ if($1 in count) { count[$1]=count[$1]+1 } else { count [$1] = 1 } } END { for(k in count) { printf("%d\t%s\n", count[k],k) } }' | sort -k1,1nr -k2,2 | sed -n -e '1,10 p'

Output:

27 the

21 to

15 a

11 is

10 of

10 that

9 but

8 text

7 was

6 and

<comment><USER23> Here's my version using a different "command line": chrome devtools

Object.entries(document.body.innerText.replace(/[^a-zA-Z\s]/g, '').toLowerCase().split(/\s+/).reduce((o, word) => {o[word] = (o[word] || 0) + 1; return o}, {})).sort((a,b) => b[1] - a[1]).slice(0, 10)

Plain JS is missing some niceties, but being able to crunch some data from a website using the same iterative approach as a shell command line has its place!

<comment><USER24> This is pretty cool, I haven't really used the console for something like this in a while, and it's a good reminder for its power.

</comment></comment></comment><comment><USER25> To me it's a similar principle to REPL-based development: you compose or chain tools, testing each tool (or deciding between tools) at each step.

As with most programming, there are usually many ways to solve a problem. Sometimes the different approaches are equally good, but sometimes the approaches are more or less ideal given the constraints.

There's no real magic, and it's really not difficult. To me, problem solving like this, and ending up with a "script" (just a chain of piped commands with some args) is often the easiest way to solve problems.

<comment><USER26> I tend to agree here, as someone who is both command line wizard and REPL- based developer.

In fact, the majority of my Ruby scripts for systems work are combinations of the language and %x'd unix commands. I find it's incredibly powerful.

</comment></comment><comment><USER27> For more on Knuth, see [https://franklinchen.com/blog/2011/12/08/revisiting- knuth-an...](https://franklinchen.com/blog/2011/12/08/revisiting-knuth-and- mcilroys-word-count-programs/) and also a C version in [http://www.cs.upc.edu/~eipec/pdf/p583-van_wyk.pdf](http://www.cs.upc.edu/~eipec/pdf/p583-van_wyk.pdf)

I think the main thing that stands out to me here is just how long ago it was; Knuth was writing just past the assembler era. None of the modern infrastructure was available, such as languages with builtin dictionaries like Perl and Python.

However, software compositionality is one of those things that's been tried in so many not-quite-successful ways. Pipes? Objects? Interprocess object systems (COM/OLE) or object brokers (CORBA)? RPC? Microservices? Packages? Object pipes (powershell)?

</comment><comment><USER28> One of my more enjoyable side projects was improving parsing of some truly horrendous log files - massive and poorly formatted - from ~2 hours to ~2 minutes.

The code I was given was several hundred lines of python. All I did was replace all but the final parsing function with a single "grep | sed | awk | grep | uniq | sort | grep" line and called it a day. I'm sure I could have taken it farther, but for the amount of effort it was a fun little exercise.

</comment><comment><USER29> I can't beat this for terseness, but I think I could whip up something close (say 15 lines) in Python (readable) or Perl (would be shorter than Python but more readable than linux).

I guess I am more curious about what Knuth did! Did he just comment it a lot for "literate" code?

As always I feel the Python (or Ruby if I could write it) is the sweet spot between being easy to read and easy to write.

<comment><USER30> Knuth was writing in Pascal, a language that had many limitations (e.g. it didn't even have a proper string type; "array of 15 characters" and "array of 16 characters" were distinct types) -- see Kernighan's article "Why Pascal is not my favourite programming language" from about the same time. So he had to implement a lot of the primitives in the program, and also more complicated data structures like a hash trie in this case, and the point was to demonstrate how to do that without the program becoming unreadable. I'm reading some of Knuth's Pascal programs recently and writing down notes for myself; ended up discussing some of these points here: [https://shreevatsa.github.io/tex/program/pooltype/#other- pro...](https://shreevatsa.github.io/tex/program/pooltype/#other-problems- with-pascal)

(A slightly better comparison may be with the source code of the Unix programs (tr, wc, etc), rather than with shell pipelines composing those programs.)

Read the original sources for more:

[https://www.cs.tufts.edu/~nr/cs257/archive/don- knuth/pearls-...](https://www.cs.tufts.edu/~nr/cs257/archive/don- knuth/pearls-1.pdf)

[https://www.cs.tufts.edu/~nr/cs257/archive/don- knuth/pearls-...](https://www.cs.tufts.edu/~nr/cs257/archive/don- knuth/pearls-2.pdf)

[http://www.cs.upc.edu/~eipec/pdf/p583-van_wyk.pdf](http://www.cs.upc.edu/~eipec/pdf/p583-van_wyk.pdf)

<comment><USER31> Thank you for those links and your post!

</comment></comment></comment><comment><USER32> > The hard part on the path to becoming a command line wizard, or any kind of > wizard, is thinking about how to apply existing tools to your particular > problems. You could memorize McIlroy's script and be prepared next time you > need to report word frequencies, but applying the spirit of his script to > your particular problems takes work.

It definitely takes a bit of work, but hopefully it's still a lot less work than writing the verbose solution.

The hard part of mastering unix one-liners for me are two things:

\- Figuring out which tool can pick apart or reconstruct a specific syntax robustly. I think I spend more time figuring out input parsing and output presentation than anything else.

\- Knowing when the right time is to ditch the clever one-liner and upgrade to a real program. There's a benefit to prototyping as a one-liner, but there are cases when replacing the result with a long program is appropriate, especially in a production environment. But, then again, only if the one-liner isn't robust or scalable enough, and usually it probably is.

<comment><USER33> A verbose solution is repeatable, devuggable, and understandable six months or even six years from now.

A verbose solution can be deconstructed and understood by a newbie.

A oneliner? Not so much, if at all.

<comment><USER32> That is occasionally true, but in 30 years I've absolutely definitely seen a lot more the other way around, personally speaking.

Good POSIX one-liners don't need to change usually and aren't hard to understand. A verbose program, on the other hand only lasts if it's like K&R C with zero dependencies. All the languages and libraries have changed considerably, scripting languages and versions come and go, C++ is quite different and might not compile later, build systems have backward incompatibilities.

Plus, a one liner is, like, one line. It's really not that hard to understand unless it's intentionally crazy, and even then, even if it takes a half hour to work through, that's still less work than something like Knuth's 15 pages of code.

We could be imagining pretty different scenarios, though, so feel free to share examples. Normally a pipe consisting of a combination of sort, cut, head, and uniq is trivial to grok, and it would be very wasteful to re- implement that kind of thing on your own. Here are a few one-liners I've made use of recently that I love:

      # count the function calls in log.txt

      grep -Po '^\K.+(?=\()' log.txt | sort | uniq -c | tee callcounts.txt

      # sum the timings
      # input: 2 columns, time & name. output: 3 columns: time_sum, name count, name
      # It's basically a pivot table in one line of code

      < time.txt perl -lane '$k{$F[1]}+=$F[0]; $c{$F[1]}+=1; END{print "time\tcount\tcall"; print "$k{$_}\t$c{$_}\t$_" for keys(%k) }' | sort -n | tee time_grouped.txt

In my own personal repo, the bash scripts and one liner aliases are outlasting all my python and C++ code. The verbose programs that I wrote myself are harder for me to maintain.

</comment></comment></comment><comment><USER34> The question I have for Dr. Cook is, "What is this wizardry worth in today's world of computing?"

It seems for every concise one-liner that requires no internet access there is a complimentary website someone has set up to perform this same task "for free" on a remote computer and return the results in a web page.

I never use those because I still enjoy the command line. People who design software and websites today, and those who review their work in the media, often refer to the command line as some sort of purgatory. God help the user who is faced with a command prompt. For me, this is more like a haven from the world of gratuitously graphical software and web applications that are too often either bloated, overly complex, inflexible, opaque, slow, or some combination thereof.

It is not that the command line is pleasing in an absolute sense. It is only pleasing in a relative sense, when contrasted with the alternatives. If the alternatives are painful enough, then moving to a command prompt is a relief.

<comment><USER35> It's also worth quite a bit (IMO) that the data doesn't have to leave your computer.

</comment></comment><comment><USER36> I think this is just the hard part of programming in general - mapping your problem into something that the tools you know how to use can solve.

I don't think there is anything fundamentally different between when your tools are Unix cli tools or a programming language. It is the same skill.

</comment><comment><USER37> Isn't

      tr A-Z a-z | tr -cs a-z '\n' | sort | uniq -c | sort -rn | sed ${1}q

equivalent to

      tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | sort -rn | sed ${1}q

but 4 characters shorter? Or am I missing something?

<comment><AUTHOR> Yes, it's shorter, but we're not playing golf. It's conceptually pretty much the same, and then you just go with whichever one you came up with first.

Yours says:

        Convert to lower case
        Convert non-letters to CR

The original says:

        Convert non-letters to CR
        Convert to lower case

Conceptually the same. The point is, most people don't seem to be able to do this at all, although there are many who can tinker with a given solution and improve it around the edges. It's the ability to come up with the initial version that seems to be rare.

<comment><USER38> My first reaction was to wonder why `tr` was required at all - <USER3> conversion struck me as necessary. These days both `sort` and `uniq` can do case-insensitivity:

        sort -f | uniq -ic

So I just allow the shell to do word splitting:

        for x in `cat foo.txt` ; do echo $x ; done | sort -f | uniq -ic | sort -rn | head -<num>

<comment><AUTHOR> Doesn't that have different behaviour if there is punctuation in the file? On my phone and not in a position to test it, so I'm not sure, but I think it's different.

<comment><USER38> It does indeed. Good catch :)

</comment></comment></comment></comment></comment><comment><USER39> jq has made it easier to munge complex data from many non-unixy apps, but then you have to learn how to write complex jq expressions. Something like sql applied to json might make this easier.

<comment><USER40> jq is an amazing tool, and I wish I used it frequently enough to remember how without looking it up.

<comment><USER41> I've mostly switched to using gron [1] for these applications -- the operation is much simpler and doesn't depend on learning a new DSL for manipulating json. I have to manipulate JSON data just enough to want to have a tool better than just firing up node and running something, but not a complete new language. With gron I can just wire it up to a bunch of standard line-based utilities.

[1] [https://github.com/tomnomnom/gron](https://github.com/tomnomnom/gron)

<comment><USER42> while I get what gron is trying to do, I do not have an intuitive grasp of how to use it. Do you have an example that you wrote/learnt from?

</comment></comment></comment></comment><comment><USER43> Is the entire question becoming obsolete?

I'm something of a command-line wizard (well, given enough time, if I'm honest! I always have to re-remember things like awk syntax), but in interviews now, no one asks core Linux shell-type questions (or even theoretical kernel-type questions). They primarily ask:

\- coding (70+%)

\- diagramming infra type questions

\- experience with keywords ("CI/CD" and "containerization" being the biggest keywords).

Recently I interviewed with a 'startup' that's in the real estate space and I was told by a manager, after touting my Linux infrastructure skills, "Oh, I don't even care about that anymore. I can teach all there is to now in a couple of days. It's all AWS and tooling here."

This is in the DevOps space.

Sounds like the new generation can give 0 craps about the command-line?

<comment><USER44> Just because suits don't ask for it in interviews doesn't mean it's not relevant for your day job.

Also works the other way around: How many binary trees are you balancing each day?

</comment></comment><comment><USER45> I love that quoted new-line. Thats the exact amount of crazy idiosyncrasy I expect from shell one-liners.

<comment><USER12> It's nice, alas it has some problems with apostrophes and dashes.

        perl -pe 's/[\s\.,]+/\n/g'

works better. Nowdays you could also get rid of the extra "tr" to convert to lower case and use the new-ish "-i" option to make uniq ignore case. That wasn't available in 1986, however.

</comment></comment><comment><USER46> Are we just going to ignore the (rough guess) thousands of lines of code that make up `tr`, `sed`, `uniq`, and other CLI tools? I enjoy hacking together nifty solutions on the shell, but the tone of this article irked me.

<comment><USER47> That was not implied.

A key skill in good programming is choosing tools at the correct level of abstraction for the problem. Here, the higher-level unix tools are clearly the better choice.

Saying "that's cheating" because the high-level tools are _themselves_ written with lower-level tools with many LOC is missing the point.

<comment><USER46> > Knuth and McIlroy had very different objectives and placed different > constraints on themselves, and so their solutions are not directly > comparable. But McIlroy's solution has become famous. Knuth's solution is > remembered, if at all, as the verbose program that McIlroy responded to.

He admits they don't compare, but does it anyway. I shouldn't take offense... but for some reason I do!

</comment></comment></comment><comment><USER48> Just posted this to HN some days, in another thread, but since relevant:

[https://jugad2.blogspot.com/2012/07/the-bentley-knuth- proble...](https://jugad2.blogspot.com/2012/07/the-bentley-knuth-problem-and- solutions.html)

Post has rough Python and shell solutions to the problem Bentley proposed.

The solutions can be useful for beginners to Python or shell.

<comment><USER49> Your "shell" solution isn't really a shell solution, it's an awk solution.

It's really valuable to know awk, but it's a bit misleading to claim that "it's shell".

<comment><USER22> This is just pedantry.

I this read you other replies and I can't see them adding much value to the discussion.

You are just being rigid about semantics.

What action are we supposed to take having read your comments?

To be careful of not calling a pipeline with awk in it 'shell?'

To be ashamed of using awk because it's a programming language, and that is 'cheating'?

<comment><USER49> Wow, I would never have expected my comments to have been interpreted that way. Genuinely shocked.

Thank you for the feedback.

</comment></comment></comment></comment><comment><USER15> I wish there was some tool that could, given a one liner, expand it out into a series of steps to better understand it.

(Or maybe someone wrote a 1 liner for that too?)

Personally I prefer to write small bash scripts over one liners so future colleagues can understand the program's logic.

<comment><USER50> [https://explainshell.com/explain?cmd=tr+-cs+A-Za-z+%27+++++%...](https://explainshell.com/explain?cmd=tr+-cs+A-Za-z+%27+++++%27+%7C+++++tr+A-Z+a-z+%7C+++++sort+%7C+++++uniq+-c+%7C+++++sort+-rn+%7C+++++sed+%24%7B1%7Dq)

<comment><USER51> Perfect, this is why, after almost 10 years, I still come back to HN regularly!

</comment></comment></comment><comment><USER52> Hrm.

[msimmons@msimmons-lin ~]$ time cat moby10b.txt | tr " " "\n" | grep -v '[[:space:]]' | sort | uniq -c | sort -g | tail -n 10

1592 I

2122 his

2446 that

3462 in

3906 a

4051 to

5225 and

5514

5851 of

11997 the

real 0m0.768s user 0m0.805s sys 0m0.021s

</comment><comment><USER53> my question, now, is where does a complete beginner start?

<comment><USER54> Google "enough command line to be dangerous"

It lives up to its name and is very much a place to start and nothing more.

Your real problem is going to find enough problems to solve to build up muscle memory.

</comment></comment><comment><USER55> Its 2019, learning to program like its 1975 might not be a good use of time.

<comment><USER56> Sometimes it is wiser to learn what has been tried, before reinventing what didn't work in the past. And tools that survived for 40 years in our industry can't be that bad.

<comment><USER55> you can use vi and vim, but I'll just use nano.</comment></comment></comment>


The Plot to Kill PHP MySQL Extension - <AUTHOR> http://www.phpclasses.org/blog/post/153-The-Plot-to-Kill-PHP-MySQL-Extension.html

<comment><USER2> Will this result in more people using the prepared statements provided in PDO etc.? Then this could reduce the global number of MySQL injection attacks by a noticeable percentage.

<comment><USER3> There is no MySQL injection attack. There is SQL injection attack. And it's not merely a problem of mysql but of how the code that uses mysql is written. And this affect all platforms. You should fix the developers to fix all sql injections.

<comment><USER2> MySQL queries constitute a signification proportion of SQL queries, and PHP's MySQL extension is responsible for a significant proportion of MySQL queries. It's not a problem of MySQL and it's not even a problem of how the PHP code that uses MySQL is written - the problem is that PHP's MySQL extension _doesn't even offer_ a way to safely prepare a statement. "Fix the developers", in this context, would mean beating them about the head until they remember to mysql_real_escape_string() every parameter every time, and that's obviously not the right approach.

A better approach is to either (1) add a mysql_prepare() function to the PHP MySQL extension, or (2) deprecate the extension in favour of one which forces or at least encourages or at least _supports_ the use of prepared statements.

</comment></comment></comment><comment><USER4> First of all, mysqlnd is not a proper extension itself, but a backend for the mysql / mysqli extensions. Anyone that bothers to build PHP 5.3.x knows that mysqlnd replaces the libmysql dependency if the --with-mysql(i)=mysqlnd flag is passed to the configure script. Which brings me to the point that the author understands little of the internals themselves.

Second of all, people should man up, step up from their lazy ass and move on. If the code is so really hard to refactor, maybe that code sucks really hard in the first place. I've seen incredible piles of garbage PHP code just to keep PHP 4 compatibility. It's 20-fu-11. 5 years since PHP 4 is officially dead. Maybe, just maybe, the internals team is not to blame for this stuff. I'm not even mentioning sentences containing the word "security" that seems to be some really scary stuff for some pumpkins still trying to figure out how SQLi works.

<comment><AUTHOR> The problem is that many, many PHP sites were created by people with limited budgets that will avoid all types of maintenance in the site code, because that means paying the developers more money to do those maintenance tasks, if they ever have a clue that they really need to update their site code to work with newer versions that shared hosting providers eventually will impose.</comment></comment>


Show HN: First JavaScript game, Space Invaders inspired with transgender theme - <AUTHOR> http://supertinyrobotichormonedestroyingmachine.com <comment><AUTHOR> Using Google App Engine for the back end, though all it really does is serve up the JavaScript.</comment>


Ask HN: Google Sold You Out? What does this means - <AUTHOR>

Hi folks I have reading a lot of reports(Blog Posts) about how Google and Verizon are having a under the table deal and ignoring all the other for self economic gain. What all this actually means for a start-up. Me as a consumer.<p>Is this an international issue or US only? <comment><USER2> People are generally overreacting and free-associating, Verizon and Google announced an agreement about how the neutrality debate may move forward. They agreed on non interference in wired communication, but kept the mobile question open, also there are some loopholes left there that are somewhat worrisome. It's a non binding agreement of course and it's a US only issue.</comment>


When the 'S' in HTTPS also stands for shady - <AUTHOR> https://www.engadget.com/2017/03/31/when-the-s-in-https-also-stands-for-shady/ <comment><USER2> TL;DR: Users have been conditioned to think HTTPS means "legit site", the sky is falling.</comment>


NSA deleted surveillance data it pledged to preserve - <AUTHOR> https://www.politico.com/story/2018/01/19/nsa-deletes-surveillance-data-351730 <comment><USER2> Would anybody else vote on this one issue? Any candidate who said flat out "your government is spying on you through giant corporations and they're all lying about it, and I'm going to Washington to put a stop to it" would have my vote.

<comment><USER3> It's coming. not in the 2018 elections, but the 2020 democrat party will be forced from below and unpredictable other sides to be far more leftist and treat privacy as a crucial issue

<comment><USER4> Personally, I find it more likely that the NSA or another organization ends up leaking some sort of damning info about Trump. This would give them a huge opinion boost, and the Democrats would end up owing the organization for their victory. We're already seeing this, the Democrats seem to love Comey despite his role in mass surveillance.

<comment><USER5> > huge opinion boost

You think people would warm to the NSA if only they demonstrated an inability to keep secret the findings of their domestic spying, and revealed they'd been spying on the president?

You don't think that would make them look like they were illegally meddling in partisan politics?

<comment><USER4> >You think people would warm to the NSA if only they demonstrated an inability to keep secret the findings of their domestic spying, and revealed they'd been spying on the president?

They may not need to make it domestic or seem like they were spying on the president, finding some sort of scandal involving a different nation doesn't seem that hard. Or they could use some intercepted knowledge from a foreign spy agency.

As a whole though, I suspect they'd see an opinion boost even if it came from domestic surveillance. The hatred of Trump is ridiculous, Democrats have even praised Bush following his attacks on Trump. Plus, Mark Felt did basically did this and just got had a movie made about him.

</comment></comment></comment></comment></comment><comment><USER6> So in litigation, when one side destroys evidence, you can ask the court to draw an adverse inference about what the evidence would have contained. That seems like it would be appropriate here.

<comment><USER7> It certainly would, though I think in this case the evidence was destroyed to protect officials from going to prison over surveillance excesses.

</comment></comment><comment><USER8> NSA "oversight" is a complete joke, especially with Senate Intelligence Committee members like Feinstein cheerleading for more surveillance.

How is anyone ever going to rein in on NSA or find out what they're really up to if they come up with excuses like this one and then they're just let off the hook?

Stuff like this is also why I can't take seriously any pro-surveillance argument, because clearly the NSA is very non-serious about it, too.

</comment><comment><USER9> Direct violation of a court order, and yet another piece of evidence that our police-state overseers are above the law.

<comment><USER10> The lawmakers are by definition "above the law" since they can retroactively make their actions legal.

<comment><USER11> The NSA is part of the executive branch. They don't make any laws.

</comment></comment></comment><comment><USER12> If they can't comply with this direct court order how are they going to ensure compliance with the Constitution? The mass surveillance program is too expansive to be responsibly controlled and should be shut down.

</comment><comment><USER13> Hahaha, the NSA deleted data, of course.

<comment><USER14> We don't collect that data about Americans.

is_deleted=false

Yes, it was deleted. We can't give it to you.

is_deleted=true

Even if it was actually deleted, it's still in the backups somewhere. Even if it's not in the backups, the NSA SSD firmware copied it off to unused hidden blocks. Even if it didn't, the NSA has tools to recover data, even after multiple passes of file wiping.

Nobody ever deletes data anymore. They didn't physically destroy all devices with a copy? They still have it.

</comment></comment><comment><USER15> How nice! Usually their malfeasance goes the other way round.

</comment><comment><USER16> What a surprise.</comment>


Is "friendship" meaning same for all world? - <AUTHOR> http://www.paradict.com/title?id=140 <comment><USER2> In English and in France we use a bunch of different words that kind of quantify levels of friendship. This means that the word friendship is already subjective within a particular language.

Here a some of the words:

My friend, my palm, my buddy, my chum, my bff, my mate

Mon ami, mon pot, mon copain, mon camarade, mon familier

Here are some references to show how they relate to each other: [http://www.wordreference.com/enfr/reverse/friend](http://www.wordreference.com/enfr/reverse/friend) [http://www.wordreference.com/fren/reverse/pote](http://www.wordreference.com/fren/reverse/pote)

Also there is a difference between a female friendship and male friendship usually. Men friends with other men barely talk about their problem, they're usually hanging out to escape their problems. I can't speak for women categorically but I feel they're more likely to discuss their issues with their female friends than men.

There are far more factors in play too, such as culture, friends in the Australia for example may call each other cunts but in the USA that would probably not be a friendly thing to do even with your pals.

My overarching point being that friendship means many things to many different people, regardless of even leaving a country, language or culture. So given the context of the world, it clearly has varying meanings.

<comment><USER3> In what kind of detail? We have multiple terms of friendship too albeit many slang and likely less beautiful than the French language:

       associate
       acquaintance
       colleague
       school / work / etc mate
       friend
       homegirl / homeboy
       comrade
       wingman
       best friend (plus similar slang like "bezzie" and "bff")
       confidant
       companion
       girlfriend / boyfriend
       partner / wife / husband
       soul mate

...plus many more I've not thought of.

<comment><USER4> > ...plus many more I've not thought of

Several more are in one scene of one Simpsons episode [1]. Homer is trying to determine who his soul mate is, and goes into Moe's thinking it might be Barney.

Barney said that he was more of a chum.

Homer turned to Lenny, who said he was a crony.

Carl said he was an acquaintance.

Other people at the bar said colleague, sympathizer, compadre, associate, and contemporary.

Finally, Homer turns to Moe, who unleashes the perfect term for many modern friendships: "I'm a well-wisher in that I don't wish you any specific harm".

[1] Season 8, Episode 9, "The Mysterious Voyage of Homer" (3F24).

</comment></comment></comment><comment><USER5> In theory yes, how it actually develops no. Friendship in Brazil is really close and intimate, in Ireland is a casual every now and then encounter.

<comment><USER6> That's a strange thing to say. In my experience having friends in Ireland is just like having friends in any other country.

<comment><USER3> I think he means the definition of friendships can be broader or more intimate depending on the language.

<comment><USER2> He never mentioned language, he mentioned nationality though.

<comment><USER3> I just assumed he discussed nationalities with regards to regional colloquialisms. Much like you're assumed he was discussing regional social attitudes.

</comment></comment></comment></comment></comment><comment><USER7> I think it has different meanings not only for countries but also for people</comment>


Sony Pictures hacked, entire computer system unusable - <AUTHOR> http://thenextweb.com/insider/2014/11/24/sony-pictures-hacked-employee-computers-offline/?utm_source=t.co&utm_content=Sony%20Pictures%20hacked,%20entire%20computer%20system%20unusable&utm_campaign=Twitter%20Publisher&utm_medium=referral&awesm=tnw.to_d4hKv

<comment><USER2> Un-altered image: [http://ic.tweakimg.net/ext/i/imagenormal/2000563852.png](http://ic.tweakimg.net/ext/i/imagenormal/2000563852.png)

</comment><comment><USER3> Does anyone know/think that the Sony & Craiglist attacks are related? Seems quite coincidental that both would happen within 24 hours of each other.

<comment><USER4> As far as I know, the craigslist hack was a takeover of their DNS. This can be done purely through social engineering, and without some sophistication, it can't lead to lost/compromised data.

This Sony thing seems much more serious, and it also seems like some very sensitive data was compromised.

Of course, we don't know the full story on either of these yet, so I may be very wrong.</comment></comment>


Hello Startups Program by 7C Studio – Where we develop apps for free for you - <AUTHOR> http://www.7cstudio.com/hello-startups.html <comment><AUTHOR> Disclaimer: I work at 7C Studio. I am happy to answer any questions if you have.

</comment><comment><USER2> What's the catch?

<comment><AUTHOR> No catch actually. We want to show case and market ourselves too. However if the app is complex or would take lot of time, we will try to limit the features to 3 months of effort. You don't need more time than that for 1st version in most cases</comment></comment>


Facebook growing, but more roadkill coming? - <AUTHOR> http://venturebeat.com/2007/05/18/facebook-growing-but-more-roadkill-coming/ <comment><USER2> Interesting how Canada jumped on the bandwagon so quickly

</comment><comment><USER3> obvious.</comment>


Tell HN: I just launched Log Anything and want to give away some API keys. - <AUTHOR>

Hi hackers!
At my day job I wanted my code to track a few simple metrics over time.  All the products I found were more complicated than I wanted and usually involved maintaining yet another service on my network.
Log Anything is my solution for any programmer who wants a very simple way to log a whole lot of events and get simple aggregated reports over time to use on websites, in Excel or anywhere else.  It's first task is helping me track down why one of my applications seems to get slower after lunch!
If you would like a free API key to help me test things out drop me a message.  Obviously I am looking for your feedback in return.  Now back to work, so much to do...
http://www.xovert.com <comment><USER2> I like it! Some random thoughts:

I'm not sure about the name. I was expecting a Splunk competitor. "Graph Anything" might be better, but then I might have thought that it was similar to Google Chart Tools. Actually, have you considered integration with Google Chart Tools?

One feature which would be really nice would be some sort of anomaly detection and alerting heuristic. How about something that works with Google's new prediction API?

<comment><AUTHOR> Yeah the name was picked using the "Get it up now and fix it later" methodology. The domain wasn't available so I got x/t instead which I thought was clever, but probably doesn't help.

I original had my samples in Google charts but I wasn't sure if I should be proxying the charts to the user, redirecting requests to Google or something else. I have a bunch of different usage samples to put together

Anomaly detection is a good idea, I'll put that on my speculative list. Cheers.

</comment></comment><comment><AUTHOR> The data on the homepage is actually real data from the server because I needed some examples. It does show a couple of interesting things:

\- The CPU is bored.

\- The web server has an interesting memory growth / garbage collection pattern.

\- Traffic to Google is fast and wonderfully stable.

\- Traffic to New Zealand is awful and awful.

</comment><comment><USER3> Congrats on the launch! Have you considered also posting a privacy policy to let folks be more comfortable integrating this API into their apps? For example: how long is the data stored, is it encrypted in any way, is there any way to purge the data, and so on. (I am not a lawyer.)

<comment><AUTHOR> A privacy policy will definately be coming, thanks for helping me fill it out, hah!

</comment></comment><comment><USER4> Neat! I'm sure you may be knowing, but MixPanel is in the same domain. I'm curious how you solve the scalability problem. Suppose someone sends you a million requests in a day, will you be able to handle it? I could be interested in trying out your service.

<comment><AUTHOR> That's one of the reasons the functionality was picked to be as simple as it could be and still solve my problem. Hopefully I can be a bit different by offering less but scaling easier and cheaper.

Not there yet of course.</comment></comment>


Linux is fast, flexible and free. Experts say that comes with a security cost - <AUTHOR> http://www.washingtonpost.com/sf/business/2015/11/05/net-of-insecurity-the-kernel-of-the-argument/?hpid=hp_hp-top-table-main_linux-245pm%3Ahomepage%2Fstory <comment><USER2> Ignoring the fact that this article suffers from severe lack of expertise (~"linux (the kernel) suffered from heartbleed"): The article is playing extreme positions against each other. Yes, when I am in charge of a company's security, I'd want my users to require root access (i.e. my blessing) when they want to join unknown networks - no, I would not want my parents to require my help when they want to connect to a wireless network at an airport when waiting for their flight into their holidays.

A pragmatic solution to this is a configurable policy that is determined at boot time (and immutable ever after). There is no need to discuss with the aim to reach an agreement - requirements differ and for a lot of use-cases "I don't care" is just as OK as "no fscking way" is for others.

<comment><USER3> That sounds a lot like the securelevel [1] features the BSDs have. A coarse- grained system that locks a system down with progressively stronger and stronger controls. There have been occasional discussions on the kernel mailing list on adding such a feature, but at the moment, Linus prefers the capabilities system. A shame, really, because having something to disable activities that people wouldn't do in a production system would be useful in a lot of circumstances.

[1] [http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD- current/man7/...](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD- current/man7/securelevel.7?query=securelevel&sec=7)

<comment><USER4> Securelevel in linux has never had a good time.. its also not working so well with kexec at the moment, I think its fix in the 4.x series though.

</comment></comment></comment><comment><USER5> This reeks of some kind of PR hit, but there's no obvious candidate for the source or motivation. The reporter gets some simple stuff wrong, like "The Linux kernel runs on the New York Stock Exchange", as opposed to a more correct usage of "Linux runs the NYSE trading" or somesuch.

It also reeks of he said/she said journalism, but the kind where you're supposed to figure out whether "he" or "she" said the truth, while the reporter mains a kind of false objectivity.

All in all, not a service to anyone.

</comment><comment><USER6> If you look at what the experts say in the article, I don't think any of them say anything that means "Linux is fast, flexible and free. That comes with a security cost". In fact, I'm not sure the author of the article is even saying that, although they're certainly trying to cash in on some fear. This title is misleading.

Ultimately, I think the message of this article, that Linux out of the box isn't inherently secure, and the culture around Linux needs more focus on security, is true. But it's also being said in a vacuum, with no comparison to other platforms. Certainly the experts in question were right to have concerns about Linux security, but I'd put bet money on the assertion that they have even greater concerns about, say, Windows.

And finally, some of the problems being blamed on Linux are actually problems with the tooling around Linux and the platforms Linux is being run on. Android is inherently always going to be insecure as long as it's running with GSM, which is fundamentally broken. Heartbleed was an OpenSSL bug. And Linus is absolutely right that if you are running Linux in a nuclear power plant, you absolutely shouldn't connect it to the internet.

<comment><USER7>
        > I'm not sure the author of the article is even saying
          that

The author, at least, certainly is:

        > But while Linux is fast, flexible and free, a growing
          chorus of critics warn that it has security weaknesses
          that could be fixed but haven't been.

<comment><USER6> That's different from saying that fast/flexible/free is coming at the cost of security. The cost wording makes it sound a) causal and b) unique in this property compared to other options.

There are security weaknesses in Linux that could be fixed but haven't been. The same is true of Windows, MacOS, iOS, etc.

That's different from saying, that if you choose Linux, you have to pay the cost of lowered security.

<comment><USER8> MacOS is obsolete. I think you mean OS X.

<comment><USER6> If you know what I mean, why are you correcting me? I haven't failed to communicate my point, and you're adding noise to the signal of the conversation.

I suspect you think this makes you seem more intelligent, but in reality, it makes you seem socially inept. Don't be that guy.

<comment><USER8> I didn't mean to offend you. I just wanted to point it out for future reference. Simmer down and learn to take a correction.

> I suspect you think this makes you seem more intelligent

Nope, I'm just a Mac developer. I use OS X every day. MacOS was non-Unix operating system that ran on a PowerPC architecture. You were very far off

> it makes you seem socially inept

If you called Windows 10, Windows XP it would not be socially inept to correct you __unless you were not in the tech industry. However, since this is HN, I assumed you could handle it. Sorry!

</comment></comment></comment></comment></comment></comment><comment><USER9> When Linus says "To me, security is important. But it's no less important than everything _else_ that is also important!"

I believe him, but now I'm not so sure anymore with this article. This is a very disconcerting about the linux kernel, I'm totally freaked out by this article. I didn't realize that the state of security with linux has come to this.

My first linux distro was redhat 2.0. And now after almost 20 some years of using linux, I'm now going to have to switch back to Microsaft Windows!

</comment><comment><USER10> This article is so poor, it's not worth reading. I know the author and publication usually have no idea what they're talking about, but if their whole point is based on their misunderstanding, then the article is just garbage. Heartbleed and shellshock have nothing to do with the Linux kernel.

</comment><comment><USER11> THe article seems to miss a crucial point: if everything is so screwed up, why it has been the dominant technology for 24 years? I mean, we are all still there alive and breathing.

<comment><USER12> > if everything is so screwed up, why it has been the dominant technology for > 24 years?

I understand your point, but why is Windows a thing?

</comment></comment><comment><USER13> That's a pretty horrible article. There are security extensions to Linux like SELinux. There is nothing stopping anybody from forking Linux into a more secure version. That would be the best way to solve the problem.

The only result of this article is that I have a lower opinion of The Washington Post than I used to.

<comment><USER14> Well, Grsecurity _did_ maintain their own Linux fork for the past ten years with an excellent security track record. The issue is that mainline is not interested in merging it, leaving most users vulnerable (since using a Linux fork in a production environment is something most users aren't going to do, even if there are clear benefits).

</comment></comment><comment><USER15> link bait, right?

</comment><comment><USER16> This is a really crappy article. Light on technical details, and wrong on some. The Post should ashamed to publish this.</comment>


Lord British wants to take you to space, and he's closer than you think - <AUTHOR> http://arstechnica.com/gaming/news/2011/02/lord-british-wants-to-take-you-to-space-and-hes-closer-than-you-think.ars/

<comment><USER2> Dup: <http://news.ycombinator.com/item?id=2270355></comment>


Choosing the best travel dates on Skyscanner - <AUTHOR> https://medium.com/@suexianhor/skyscanner-choosing-the-best-travel-dates-f59dbae249bb <comment><USER2> If anything, this is as good as it gets with regards to a modern jobhunt. First response is from Skyscanner!

For us 'flexible' travellers, it's even harder than the story suggests. I have 4+ international airports with 1,5 hours drive. A long time ago Kayak would let me enter three of them at the same time, for their matrix-look. So I had flexible departure, flexible dates to one destination. Skyscanner gives me flexible dates, from one airport to the other. The true beauty (for me) would be flexible from, flexible to, flexible dates. Perhaps even with some

I usually solve this by tweaking the url until it hurts and then running multiple search for a first pruning. Then zooming in on a few well priced trips.</comment>


Those Hilarious Times When Emulations Stop Working - <AUTHOR> http://blog.archive.org/2016/06/27/those-hilarious-times-when-emulations-stop-working/ <comment><USER2> If you enjoyed this you might also like the following strange Chrome bug:

[http://stackoverflow.com/questions/37939455/why-does-the- val...](http://stackoverflow.com/questions/37939455/why-does-the-value-of- typeof-null-change-inside-a-loop)

Quote from Stackoverflow:

       function foo() {
           return typeof null === 'undefined';
       }
       for(var i = 0; i < 1000; i++) console.log(foo());

should print 1000 times false, but on some machines will print false for a number of iterations, then true for the rest.</comment>


Ask HN: What's your favorite window manager for X11? - <AUTHOR>

Ask HN: What's your favorite window manager for X11?<p>Do you prefer keyboard-driven window manager? and how do you arrange your windows to be more efficient? <comment><USER2> Xmonad, one of the best tiling window managers out there. It is very easy to grasp for beginners[1], has a comprehensive documentation and is extremely powerful under the hood. The configuration is in Haskell, which makes it Turing-complete, but you can customize Xmonad even if you are not familiar with the language.

[1] <http://xmonad.org/tour.html>

<comment><USER3> Another vote for xmonad. I have been using xmonad on my desktop for most of this year, and it has worked amazingly well, and definitely has one of the best multi-monitor setups I've ever used.

One of the most impressive things is how well it has worked out of the box, so well that I basically forgot to come back and customize, its just been working for quite a while now.

</comment></comment><comment><USER4> I've tried a dozen window managers for weeks at a time. For over a decade I always returned to my old reliable WindowMaker. In the past couple years I started using Metacity (default in Gnome now).

All I care about is having separate workspaces and a few keyboard shortcuts. I have 7 work spaces: Main (local terminal), Browsing (Chrome/Firefox), Communications (Pidgin/XChat/Skype), Development (GVim/terminal), Email (Thunderbird/GMail), Shells (tabbed remote terminals), Misc (usually shells/music player).

Each workspace is dedicate to a single task. Everything is fully maximized in each workspace (for the most part). I switch between them with Alt+{1,7}. Ctrl+M Maximizes a window. I have a few monitoring applets (CPU/network) in the taskbar thingie. Over time I've found that is all I need to be happy and productive.

<comment><USER5> I also used Windowmaker for a really long time, but stopped when a few years ago it was incompatible with a few of the applications I use (e.g. gaim (now pidgin) would crash very often, and some more annoyances I forgot about).

I especially liked docking applications/icons, its good support for virtual desktops and especially the many wmXXX applications that did one job well, in the space of a 64x64 pixel tile.

These days, I mostly resort to the "standard" gnome desktop with whatever it uses and resort to something very lightweight such as fluxbox on resource constrained machines.

</comment></comment><comment><USER6> Somewhat customized Openbox. Six workspaces, everything keybound. I make heavy use of alt-drag and alt-middle-drag to move and resize windows without needing to find their targets. Control-fkeys for frequently opened apps like gnome- term, chromium, etc. Each workspace is a discrete task: writing code, testing, email/IM, etc. Helps keep me focused.

What I love about OB is that _everything_ is configurable. A lot of WMs (ahem, metacity) give you no control over the basic operations _because they can't imagine any other way to do it_. If you find faster ways to do things, e.g. workspace warping with mousewheel, or reordering windows with win+middle click) OB actually lets you achieve them. It's all there in XML--and the defaults are well thought out, too.

I know several people who swear by xmonad, but I've never been able to deal with it for graphical work.

</comment><comment><USER7> I was surprised to find that no one else has recommended dwm[1], which is what Xmonad (and others) are based on[2].

It's tiling, keyboard-driven, small and lightweight. I've been using it for years now. It's a little hairy to start with, but I love it.

Instead of workspaces it uses "tags" which you can treat just like workspaces, but you can also combine, on-the-fly, to form a mashup of different tasks. For example, sometimes I want my editor & web browser next to each other, when I'm looking something up, but most of the time I just want to focus on the code.

[1]: <http://dwm.suckless.org/>

[2]: <http://en.wikipedia.org/wiki/Dwm>

</comment><comment><USER8> I've found that if you set up devilspie and xbindkeys, it doesn't really matter what WM you use.

devilspie is a rules engine for windows--new windows for this application go to this desktop and are always maximized; browser windows always go to workspace 1, all windows are always undecorated, etc.

xbindkeys is a scheme app that just handles mapping key bindings to shell commands.

Both of these are configured with files full of s-expression that you can check into your version control. Put them together and you can kinda ignore the fact that you're still using brain-dead metacity.

</comment><comment><USER9> I use wmii with some minor customizations. I have one 30" full of 256-color rxvt-unicode windows and a smaller monitor running chromium. Generally communications (mutt, irssi) runs down the right edge of the 30" and then there are 2-3 columns of terminals running vim or zsh.

One killer feature of wmii is its use of 'tags' instead of virtual desktops. Windows can be assigned to multiple tags. I tend to have tags per task, so task switching is as simple as switching desktop tags.

<comment><USER10> +1 for wmii ! I was using ion3 until 2008 and migrate to wmii at this time.

I'm mainly using OSX now but I always have my wmii open in a virtual box.

<comment><USER7> I miss Ion3. But I use dwm now!

</comment></comment></comment><comment><USER11> I use Awesome WM. It was my first foray into the tiling WM world, and I am currently loving it. I have two monitors. I usually have whatever main task I'm working with on my main widescreen, and then a bunch of terminals with various programs (ncmpcpp, irssi, etc) on my old 17 inch monitor.

Awesome is great because of its use of the keyboard and tag system. Also, it is named after one of Barney Stinson's catchphrases.

<comment><USER12> The problem I have with awesome is that it likes to make you write new configs every other release. That's why I'm still stuck with a fairly old version.

Now that they kicked xcb out of cairo (which awesome needs) which resulted in awesome getting kicked out of the arch linux community repository I think I'll just switch to i3 like all of my buddies.

<comment><USER11> I didn't even realize awesome wasn't in the Arch Linux repositories any more. I installed it from there a month ago.

</comment></comment></comment><comment><USER13> I am using dwm with the bottomstack, gridmode and pertag patches and my own modifications.

Currently I am using a notebook in front of an external display and I added a function to dwm with which I can essentially "push" all clients (windows) to the external display, which in turn sends all its clients to my notebook's display (or in other words it swaps all clients of one display with all clients of the other).

When I am coding I am always using bstack mode with vim on top and one or two terminals at the bottom. The external monitor is displaying documentation. If I have to look something up I just have to push vim + terminals away. If I am finished I pull them back. So my notebook display becomes my working display.

<comment><USER14> I find that dwm always gets dismissed by users of awesome or xmonad. I've run all three for long periods of time and always go back to dwm, most likely due to my hatred of "bloat". It's stable, small (28kb binary), fun to hack and nice and snappy.

<http://suckless.org> has some other really cool stuff as well.

ii is a FIFO based IRC client, slock, wmii etc...

<http://hg.suckless.org/> is their HG repo.

</comment></comment><comment><USER15> I've been using blackbox for many years ( after using afterstep and windowmaker) but recently turned to stumpwm, a tiling wm written in lisp[<http://www.nongnu.org/stumpwm/>]. Getting used to it but i think i'll keep it, i like tiling wm . Never been a fan of gnome or kde, and never need all things they carry i prefer a simple window manager.

</comment><comment><USER16> After using windowmaker, I switched to awesome and I am not looking back. The install is tiny, and it starts instantly, unlike KDE. The tiling is very nice. The configuration is in lua but I haven't been annoyed by anything enough to bother modifying it.

<comment><USER16> As I work with dual screen linux connected to a remote windows XP/7 desktop running in VMWare/HyperV, I have a screen for tiled urxvt terminals connected to the servers running the processes I manage, with a floating rdesktop session hiding it most of the time. The other screen is set to 'floating' for emails, web browsing and local terminals sessions.

</comment></comment><comment><USER17> I've used Fluxbox and Blackbox basically since I was in diapers, but I recently decided that it's really way past time to try a tiling WM, and settled on xmonad after initially trying awesome. I like it a lot so far; it's lightweight, flexible, and very easy to configure, and I'm surprised how little I miss dragging windows around (although I still float some frequently used applications, Chrome and Audacious primary among them.)

I usually have a workspace for shell & filesystem stuff, one for emacs, one for documentation, one for running servers and monitors and other misc. utils for whatever I'm doing, and one floating one for web browser and music.

<comment><USER2> Why do you float Chrome windows? Web browsers and terminals are the easiest applications to tile.

<comment><USER17> Honestly, there's no good reason at all. I'm just so used to resizing my web browser with the mouse all the time to read things better. I should probably break that habit.

</comment></comment></comment><comment><USER18> I use sawfish. It is very lightweight, configurable, supports plenty of keyboard shortcuts and generally stays out of my way.

I have keyboard shortcuts for most simple operations (change workspace, change window, send to back, etc.) and use the mouse when that sort of thing makes sense. I try to stick to 'one task-type per workspace' which helps keep things somewhat organized (plus it keeps my browser in hiding while I'm trying to code).

Link: <http://sawfish.wikia.com/wiki/Main_Page>

<comment><USER19> I use this as well. I have a bunch of self-written mods that I really should push out somewhere.

I started using it when it was the default WM for gnome, and had so many customizations that I couldn't switch away when metacity came out.

Things like windows7-ish tiling (I had it before windows 7, when someone using another WM could do it).

</comment></comment><comment><USER20> I like fvwm - <http://fvwm.org/> \- I can change the size of windows on all sides, and the width of the borders is easily configurable.

(Everything else is as well, but those are the things I particularly like over other window managers I have seen.)

I would like to try running Xmonad on a second monitor, and use that monitor for xterms primarily - I don't want my browser window-size to change with how many windows I have open - but I haven't had time/monitors to experiment.

<comment><USER21> Another vote for fvwm. I've customized it pretty heavily over the years:

I have a single config file that detects which host its running on and modifies fvwm's behavior accordingly. This way I can have the same configuration work well on the desktop and the netbook.

It works well on the netbook, too, as its very resource-friendly.

I have it set up with a 3x3 virtual desktop space and no edge resistance. The "Windows" key pops up the virtual desktop manager.

Also, I have it configured so that when I hit the "Menu" key or CTRL-Windows I get the root menu, so it's reasonably keyboard friendly. (e.g. CTRL-Windows,T gets me a terminal; CTRL-Windows,N,W gives a browser.)

Not that I use those, really, since I have F1 on the root window bound to "launch terminal", and F2 to "launch browser".

FVMW doesn't work as well as others out-of-the-box, but you can pretty much make it do anything if you tweak the config enough. But that's work, so you gotta wannit.

I really wish it was a compositing window manager, but it's not, and it doesn't seem likely to be.

</comment></comment><comment><USER22> Windows XP.

I have used Linux almost daily for the last 12 years; a good chunk of them via putty/ssh from XP. I headless Slackware box without X; ssh or serial is just fine by me.

At the risk of being mauled to death, I also have a Mac that I just got used, and I only ssh to it. Couldn't be bothered to figure its quirks; will come handy when I get into iphone dev though.

Also, I will not use a non Thinkpad machine if it was given to me for free. My current setup is an R51; Pentium M, 1GB RAM, and 33GB disk.

</comment><comment><USER23> Openbox for me - extremely customizable, standards compliant, and very keyboard friendly. Good theming, well written code.

</comment><comment><USER24> The tiling, keyboard-driven Xmonad on Linux, but then I got fed up of the look and feel of Linux in general and bailed to OS X completely (with a more basic helper, SizeUp).

I like a main window taking the left 60% of the screen and the remainder for 2 aux windows stacked vertically.

</comment><comment><USER25> WindowMaker. I wish it were more keyboard driven, but I find it's window arrangement and Xinerama support to be the crucial features.

I've also been meaning to give a modern tiling window manager (I've used ratpoison in the past) e.g., Xmonad a try.

</comment><comment><USER26> I go with the (distribution) flow and use KDE/kwin. I dumped Gnome/metacity a while ago as it wouldn't do more than 12 desktops, while kwin gives me 20. F1-F12 for the first 12, Alt+F1-F8 for the rest. Every major window is fullscreen on its own desktop and can thus be switched with one keypress (I like desktops over some sort of window-focus hotkey as it gives me a spatial metaphor to how keys are assigned). For example, I'll bounce between web (F7) or pdf (F6) while editing code (F1/F2), negating the need to have two windows side-by-side with the management/tradeoffs that incurs.

<comment><USER27> I can have 36 desktops with the gnome in ubuntu 10.04 (not that I do, I just use 6 ;-)

<comment><USER26> Sure... however last time I checked, you can only assign hotkeys to 12 of them.

<comment><USER27> Hum, you're probably right. A hack would be to use something like wmctrl and custom hotkeys.

</comment></comment></comment></comment><comment><USER28> Does anyone by any chance know of a Zooming UI (ZUI) WM for linux ? I've been looking to replace my Gnome desktop I've otherwise been running for years. I'm no fan of tiling WMs so a ZUI seem a good next step.

</comment><comment><USER29> StumpWM.

Tiled and programmable in Common Lisp. It's fun to config/hack.

</comment><comment><USER30> XFCE, a rather minimal window manager I find perfect for my desktop and development machine. <http://www.xfce.org>

</comment><comment><USER31> ratpoison, because it actually manages those pesky windows.

<comment><USER32> I use ratpoison on a ThinkPad X201. I basically only have one xterm with tmux and one browser open. Ratpoison is the least annoying window manager for that.

<comment><USER8> > I basically only have one xterm with tmux and one browser open.

What more could one ask for?

</comment></comment></comment><comment><USER33> Evilwm: <http://www.6809.org.uk/evilwm/>

It can spawn a terminal with one keystroke, can move and resize windows, and has virtual desktops. Other than that, it gets the hell out of my way -- no extraneous bars / panels / whatever, and one-pixel-wide window borders. That's all I ever want a WM to do.

</comment><comment><USER34> I currently use awesome wm but I run slim so I can login to any number of window managers. I was using xfce4 for a few months and still think it's a great environment. I also mess around with fluxbox. After seeing so many people rave about xmonad I'm going to give it a try as well.

</comment><comment><USER35> I use scrotwm - don't be put off by the silly name, it's a great window manager: think dwm with a plain text, human-readable config file.

That said, most of my 'window' management is handled by tmux.

</comment><comment><USER36> I'm one of the several people here who uses awesome. It's rather nice.

</comment><comment><USER37> WindowMaker, it was the first windowmanager that I liked, and haven't moved since, but it is beginning to feel its age. I am missing some of the new stuff from gnome/kde a litte bit.

</comment><comment><USER38> I prefer WMII in VirtualBox as development enviroment. <http://wmii.suckless.org/>

<comment><USER38> And i forgot to mention a Vimperator project. It's really useful peace of software. It let you to surf the web with keyboard only. <http://vimperator.org/vimperator>

</comment></comment><comment><USER39> Depending on my mood; if i`m looking for no distractions I will work in AwesomeWM. Otherwise, I just default to Gnome.

</comment><comment><USER40> I use awesome (<http://awesome.naquadah.org/>), a tiling wm.

</comment><comment><USER41> kwin because it has such great configuration options. You can customize everything by window class/title etc, like which desktop it goes to, is it always on top/bottom, maximized horizontally/vertically, skip the taskbar etc.

The compositing effects Present Windows Desktop Grid are actually useful

</comment><comment><USER42> I have two favorites: Ratpoison (tiling) and Evilwm (non-tiling).

</comment><comment><USER43> I'm sad to see so little love for ion and ratpoison. Ion2 ftw.

</comment><comment><USER44> Awesome WM at the moment. Looking at xmonad too though

</comment><comment><USER45> twm ;)

</comment><comment><USER46> 9wm aka rio <http://swtch.com/plan9port/screenshots/rio.png>

<http://swtch.com/plan9port/>

</comment><comment><USER47> rio</comment>


Show HN: "How to Speak Canadian" – A chrome extension for newcomers to Canada - <AUTHOR> https://chrome.google.com/webstore/detail/yonge-is-young/ghfjpbeonpgcefeclhikndppoanmbelg <comment><AUTHOR> As a new immigrant to Toronto, Canada, many words caught me off guard. I speak English but I didn't know how to pronounce so many words.

Yonge Street is the longest street in North America. But how do you say it? Is it pronounced Yonjee or Yongay? Neither, it's Young.

Also, Quay is pronounced Key. There are dozens of other words like this.

I can't be the only one struggling with this, so I created this nifty little chrome extension for newcomers, visitors, immigrants and aspiring immigrants to Canada.</comment>


Is Palindrome? - <AUTHOR> http://ispalindro.me <comment><AUTHOR> Sorry folks, meant to post this as a 'Show'. Just a silly word game I built while learning rails.</comment>


Ask YC: Where can I get a Slideshow for my site like the one on the YC home page? - <AUTHOR>

i clicked through to Heysan's site but they are doing something different.  I searched around, and don't really want to use slide (to common).  Any suggestions. <comment><USER2> <http://www.google.com/uds/solutions/slideshow/index.html>

<comment><AUTHOR> thanks for the link, surprised there is not more options, but this looks good.</comment></comment>