notifyme – User Log in Notification

In the Name of Allah

notifyme -C `cat /etc/passwd | cut -d: -f1`
root from :0.0 arrived!
NAME
notifyme - notifies a user then other one logs in

SYNOPSIS
notifyme [-c conf ] [-C] [-l] [-q] [-h] [ USERNAME ] ...

DESCRIPTION
notifyme  is a console utility that stays in a background (it isn’t a
daemon but it doesn’t  block  terminal)  and  prints  a  message  if  a
specified login and/or logout occurs. .

When  program  starts it reports number of logins and minimum idle time
of the users that you specified in a resource file. .

In the  config  file  ($HOME/notify.rc  by  default)  you  can  specify
(extended  regular  expressions  are  allowed) usernames, hostnames and
terminals that should be monitored,  optional  messages  that  will  be
displayed and other options (beep, report logouts etc.).

OPTIONS
-c config-file Specify configuration file where
    usernames, hostname andterminals which will be monitored.
-C  Force notifyme to display messages on the center of the  screen.
-l  Do not report when the user logouts.
-q  No beep when a message appears.
-h  Show help index.

FILES
~/notify.rc
Indication usernames, terminals & hostnames  to  be monitored.

AUTHOR
       Michal Suszycki <mike[at]wizard.ae.krakow.pl>

Download

Adding Timestamps to history

In The Name of Allah

# add to .bashrc or type in cmdline
export HISTTIMEFORMAT="%F %T"
history
    1  2015-01-09 08:43:26 uname -a
    2  2015-01-09 08:43:26 ls
    3  2015-01-09 08:43:26 dir
    4  2015-01-09 08:43:26 ls
    5  2015-01-09 08:43:26 cd
    6  2015-01-09 08:43:26 ls
    7  2015-01-09 08:43:26 dir
    8  2015-01-09 08:43:26 cla
    9  2015-01-09 08:43:26 clear
   10  2015-01-09 08:43:26 ls
   11  2015-01-09 08:43:26 cd Desktop/
   12  2015-01-09 08:43:26 ls
   13  2015-01-09 08:43:26 dir
   14  2015-01-09 08:43:26 cls
   15  2015-01-09 08:43:26 ls
   16  2015-01-09 08:43:26 ls -al
   17  2015-01-09 08:43:26 dir
   18  2015-01-09 08:43:26 nc
   19  2015-01-09 08:43:26 ls
   20  2015-01-09 08:43:26 cd Desktop/
   21  2015-01-09 08:43:26 ls
   22  2015-01-09 08:43:26 ls -al
   23  2015-01-09 08:43:26 cd ../../
   24  2015-01-09 08:43:26 ls
   25  2015-01-09 08:43:26 cd home/
   26  2015-01-09 08:43:26 ls
   27  2015-01-09 08:43:26 cd
   28  2015-01-09 08:43:26 ls
   29  2015-01-09 08:43:26 cd Desktop/
   30  2015-01-09 08:43:26 ls