Showing posts with label Scratch of the day. Show all posts
Showing posts with label Scratch of the day. Show all posts

2015-01-13

Scratch of the day - "yes" to all

While browsing on /usr/src/usr.bin to kill some time, found "yes". The manpage was simple:
NAME
    yes — be repetitively affirmative

SYNOPSIS
    yes [expletive]

DESCRIPTION
    yes outputs expletive, or, by default, “y”, forever.


So, it repeats "y" forever. A quick try rev up my processor to the max and

2012-02-15

Scratch of the day - dmesg log is not at /var/log

dmesg log is the place where system information are written to it, similar to /var/log/messages. It is particularly useful to get information of Hardware details. But after some time, the information in /var/log/dmesg.today & /var/log/dmesg.yesterday are replaced with system messages where by boot messages are replaced.

Fortunately, a copy of boot messages in dmesg are still available in :

/var/run/dmesg.boot

Au revoir !!!

2011-12-30

Scratch of the day - Back dated date

Did some sysctl tuning and need to monitor the log file every "yesterday". This is what I've managed to split out from "strftime" manual (via "date") :
# date
Fri Dec 30 09:59:27 MYT 2011

# date -v -1d +%b\ %Oe
Dec 29


With this, make cron send me an email with filtered entries of /var/log/messages :
1 1 * * * grep "`date -v -1d +\%b\ \%Oe`" /var/log/messages | mail -s "Yesterday ..." root@example.com

See ya !!!