Three dear old Linux commands that we should forget

mount: mount is, of course, a fundamental command. But don’t use in “ls mode” to list the current mounts. You’ll get a lot of gibberish, and the command is not designed for that.

Use findmnt instead.


nslookup is deprecated – or almost.

Use host for simple things, and dig for more information.

Notice, however, that all these commands query the DNS directly, instead of going through /etc/nsswitch.conf and /etc/hosts (as the programs that ask use the OS system calls will). If you want a “real” ip resolver, use either getent hosts [IP/NAME] or resolveip (the later comes with the msyql server!).


You should quit using ifconfig.

Get used to ip it’s much better.


Understanding Nginx location rules

Ningx is slim and the configuration feels in many respects less bloated than Apache. But it’s also a little idiosyncratic, and the official documentation, still, is not great. I keep forgetting about the location rules, so here’s an attempt to make my own cheatsheet.

A location block applies some configuraton by matching against a request URI. A location can be one of these five types:

 nginx

(The official documentation, among other things, calls “prefix” the type identifier string ( =,^*,~,~*); this can be confusing, because we are also speaking (in cases 2.a 2.b) of “prefix matching” …)

Important: among the list of location blocks inside a server, only one will be picked (or none). The only way to “compose” settings is by using nested locations.

Trying syntax higlighters…

I’m testing several of the many syntax higlighter plugins for posting code in WordPress… This is a nice list. All are impressive, but after trying the first five, I’m liking most Crayon Syntax Highlighter. I love the extensive customization (including styles, like font sizes); on the minus side, the docs are rather caothic with (currently) many broken links and images. Another slight objection could be that it formats (by default) all <pre> elements.