Pareri

Crock: “Che ti succede, D’Angelo?”
Legionario: “Il dottore mi ha detto che sto male per troppo bere e troppe donne”
Crock: “Dovresti chiedere un altro parere”
Legionario: “Perchè? …mi è piaciuto il primo”

“Crock” di Bill Rechin & Don Wilder
Linus
luglio 1991

Mancio

Mancini, sei veramente un grande! In barba a etichetta e “finto” bon ton, dici davvero quello che pensi!
BRAVO MANCIO, falli neri!

(in riferimento alle dichiarazioni fatte a Italia1 il 10/2/08 alle 22.50)

crontab -e: I can’t use the default editor!

Usually we use crontab -e command, while logged in as a user, to modify the user’s cron jobs or crontab -e -u[user] as root.

The editor used fot this depends on the system variable VISUAL or EDITOR (if present) else the default editor will be used /usr/bin/editor.

So if the default editor is a not well known program (take “VI” as an example, even if you use the more user friendly “VIM”…), you can modify the suggested system variables if present, to verify:

set | grep -iE ‘(visual)|(editor)’

grep, cut, awk, sort, uniq… linux shell power!

How powerful can be linux shell? This is just an other nice example of the power of linux shell!

Well, this is the game: suppose to need on a remote machine to count how many times an ip address (or user or whatever you want) is used in a log file or a part of it.

Let’s take a sample log: Apache access log.

The format is something like (see attached example log file):
1.1.1.1 – – [16/Jan/2008:22:18:42 +0100] “GET /dir/pag.htm” 200 11 “http://diegobelotti.com/a.php” “Mozilla 5 (Windows..) Firefox”