Showing posts with label every. Show all posts
Showing posts with label every. Show all posts

Monday, October 2, 2017

Be in love with your life every minute of it

Be in love with your life every minute of it



"People only see what they want
in who they want to see it..."





... so dont bury yourself trying to get people to see what youre really about..."




"... the people meant to be in your life will recognize it effortlessly."




Long time no post! I could say sorry and sorry again but you and I have to face the truth: I just dont have the time to post regularly on this blog. If you want to follow me and my work, then make sure you follow @jessicachrist on Instagram, where I post more often that here. Anyway, I dont want to do that much jabbering, just enjoy the pictures of the beautiful wood watch from Jord! It is delivered in a pretty wooden box, hand finished and the dial is decorated with Swarovski crystal markers. 





 



Available link for download

Read more »

Monday, September 11, 2017

Bash Script to check after every one minute whether a user has logged in or not

Bash Script to check after every one minute whether a user has logged in or not



#!/bin/bash
# isuserloggedin.sh
# Usage: isuserloggedin.sh username
# Shell script which checks after every one minute whether a user has logged in
# or not
# You can also run script in background using & then foreground it to view result

if [ $# -ne 1 ]
then
echo "You supplied wrong arguments"
echo "usage : `basename $0` username"
exit 1
fi

isuserexist()
{
grep -w "$1" /etc/passwd > /dev/null

if [ $? -eq 1 ]
then
echo "$1 is not a valid user"
exit 1
fi
}

isuserexist $1
time=0
while true
do
# you can replace following two statements with
# if `who|grep $1 > /dev/null`
who|grep $1 > /dev/null
if [ $? -eq 0 ]
then
echo "User $1 is logged in "
if [ $time -gt 60 ]
then
hours=$((time/60))
minutes=$((time%60))
echo "He is logged in $hours hour(s) $minutes minute(s) late"
else
echo "He is logged in $time minute(s) late"
fi
exit 0

else
let time++

# You can use following formats also
# time=`expr $time + 1 `
# time=$((time+1))

sleep 60
fi
done

Output:
[root@localhost shell]# sh isuserloggedin.sh
you have suplied wrong arguments
usage : isuserloggedin.sh username
[root@localhost shell]# sh isuserloggedin.sh root
User root is logged in
He is logged in 0 minute(s) late
[root@localhost shell]# sh isuserloggedin.sh roott
roott is not a valid user
Run script in background
[root@localhost shell]# sh isuserloggedin.sh venu &
[1] 15917
[root@localhost shell]# User venu is logged in
He is logged in 3 minute(s) late

[1]+ Done sh isuserloggedin.sh venu
Run script in background then foreground it
[root@localhost shell]# sh isuserloggedin.sh venu &
[1] 16223
[root@localhost shell]# fg
sh isuserloggedin.sh venu
User venu is logged in
He is logged in 1 minute(s) late
[root@localhost shell]#

Available link for download

Read more »