Tag: Linux Console

Logwatch for Linux Systems – Scheduled email.

On my personal desktop at home, I like to see the statistics at least once a day, for what was installed, what was run with sudo and other such details like kernel errors.

Running this monotonously every day is quite boring, so comes to rescue is logwatch. I have Fedora installation so I will talk about the location with respect to that so for your distribution it might be a little different.

First install logwatch using 🙂 yum install logwatch

and you are done.

If you need to do more configuration and want to see something different in the mail that is sent( BTW sendmail is assumed to be default mail client), the keep reading.
First open the file /etc/logwatch/conf/logwatch.conf
The contents for my distro is just one line 🙂
# Local configuration options go here (defaults are in /usr/share/logwatch/default.conf/logwatch.conf)
So, open the file /usr/share/logwatch/default.conf/logwatch.confbr
I will highlight the important lines in the file here:
LogDir = /var/log — This is the directory for all the log files
MailTo = root — Whom should the mail be sent to
Print = If this is set to true then there will be no mail sent and the output will be displayed on the stdout.
Detail = The level of details you want to see in the mail or the output on screen.

Thats pretty much it.. If you want to further modify the details in the mail you can configure the services. For more advanced usage you can even go to /usr/share/logwatch/scripts/services and configure the individual scripts.


Gentoo, Knoppix and Linux Console Screenshots

Finally I decided to try a few distro\’s that I downloaded with Beldi.

1) Gentoo: Quite Small distribution. Did not configure my DHCP address and also did not start a X window also so did not try too much.

\"gentoo\" \"gentoo2\"

2) Knoppix: Well known for its recovery functions, the Live CD does discover all the hardware and boots pretty nicely to the X windows directly with the ethernet configured.
I specially liked the fact that the boot up to X window theme looked quite similar and the background did not change which is quite soothing. And no doubt the desktop background included by default is quite good.

\"knoppix\" \"knoppix2\"

The applications installed by default is also quite interesting and largely covers the requirements for most of the users, I believe. Few scneenshots of the same.



3) Linux Console:
A Live CD with couple of games. Otherwise quite small distribution.

\"Linux \"Linux

shell — one liner to selectively change case

Today I had a hard time, I had a herculian task of converting the case of file to upper case. Well that\’s not difficult :), I know. What made it difficult was the fact that not the whole file had to be converted but only selective lines containing the work important. Okay now that too is not so difficult, I thought. But again the file size was huge, it had some 9 million lines. So, I just thought of trying my skills of shell programming (dont have much of it anyway). So here\’s what I did:

for i in `cat aka`; do  echo $i;  if [[ `echo $i|grep important` ]]; then echo $i|tr [:lower:] [:upper:] > aka; else echo $i > aka; fi; done

Okay let me try to explain this in most simple words (in algorithm)

for each line in file


print the line

if the line contains important


change the case using tr command and put it in another file


put it as is in another file



But the above one is wrong the correct one should be :

for i in `cat aka`; do  echo $i;  if [[ `echo $i|grep important` ]]; then echo $i|tr [:lower:] [:upper:] >> aka; else echo $i >> aka; fi; done