gvim survival tip, visual block mode

Thanks to jerald got around the frustrating CTRL+v doing the normal GUI pasting within gvim when I was really wanting to enter vi “visual mode”

Control q to the rescue :)

I used it for commenting block of code:
CTRL-q  (Go in visual mode)

jjjjj  (move cursor)

I   (shift eye to insert)

#   (comment character)

ESC (Escape, writes out)

Awesome, thanks jerald!

Logrotate rotating the rotated, why and how to fix

The Problem:

-rw------- 1 root root  207 Nov 20 00:01 dev-virtual.log.1.gz

-rw------- 1 root root  113 Nov 19 00:01 dev-virtual.log.1.gz.1.gz

-rw——- 1 root root  100 Nov 18 00:01 dev-virtual.log.1.gz.1.gz.1.gz

-rw——- 1 root root  100 Nov 17 00:01 dev-virtual.log.1.gz.1.gz.1.gz.1.gz

Why does this happen ?

Two things wrong,  logrotate and syslog-ng

Logrotate has been told to rotate anyfile:

/var/log/syslog/*

And Syslog-ng was told to create log files by host name with no ” .log ” suffix :

destination messages { file("/var/log/syslog/$HOST"); };

The Fix:

In logrotate’s conf file:

/var/log/syslog/*.log

In /etc/syslog-ng/syslog-ng.conf:

destination messages { file("/var/log/syslog/$HOST.log"); };

Test:

logrotate --force "/etc/logrotate.d/syslog-ng"

-rw------- 1 root root  207 Nov 21 11:39 dev-virtual.log

-rw------- 1 root root  207 Nov 21 11:39 dev-virtual.log.1.gz

-rw------- 1 root root  313 Nov 21 11:26 dev-virtual.log.2.gz

Much better! =)