get systemd journal entries on web interface.

2013-12-12 1 min read Fedora

Just in case you need it, you can get the journalctl entries from systemd in the web page.

First install :

yum install systemd-journal-gateway

Once you have done this you can get the journal entries with wget as well with

wget http://localhost:19531/entries

or if you prefer, you can browse with a browser at http://localhost:19531/. It has a nice little interface for browsing the entries, nothing too fancy but just sufficient.

Continue reading

cvs add files recursively – not already in repository

2013-11-12 1 min read Linux

When you have a lot of files in some repository and you have added a couple of new, in CVS there is no command to add just the new ones to the repository, so here is a workaround for that.

cvs status 2>/dev/null | awk '{if ($1=="?")print "cvs add -kb " $2}'

Well, if you are adding text files then you might want to remove the “-kB” in the cvs command above.

Continue reading

Home grown mail scheduler with bash script and cron

2013-10-04 2 min read Bash Linux

If you are using Linux (Fedora/Ubuntu or anything else) then you do get a lot of tools and one of them is cron. Very very useful. Just write some script that can do the task for you, put it in cron and forget it. So, here is a home grown way to schedule mails.

First, copy this script below:

#!/bin/bash -
#===============================================================================
#
#          FILE: sched_mail.sh
#
#         USAGE: ./sched_mail.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka), 
#      REVISION:  ---
#===============================================================================

mailfile="~/mail"
if [[ $(wc -l $mailfile|awk '{print $1}' ) -ge 5 ]]
then
    to=$(grep ^To: $mailfile|sed 's/To: //')
    echo "Good to send mail... to = $to"
    sendmail -t <$mailfile
    echo "once mail is send, delete the contents of file"
    echo "sed -i '4,$ d' $mailfile"
fi

Now, create a file called mail in your home directory, with the following contents:

Continue reading

find more information on ext2/3/4 filesystem

2013-09-20 2 min read Linux
English: Ext3 & Ext4 file systems: fsck time v...
English: Ext3 & Ext4 file systems: fsck time vs Inode Count (Photo credit: Wikipedia)

In my previous post on check filesystem regurlarly, I mentioned tune2fs. That tool give quite a lot of information. But just in case, you did not find what you are looking for in the output, then you can get much more information on these partitions with the dumpe2fs command.

Continue reading

findmnt – find all the mounts and their source

2013-09-16 1 min read Linux

If you are looking for the source of a mount and the various options used in the mount, then the quickest way to get that is ::

findmnt

By default, with no parameters, it lists all the mounts in a tree like view and all the options used to mount the path. It also lists the source of the mount.

By default again, it uses some capabilities of the terminal to show the tree which you can disable with the option “-a”.

Continue reading

Set some disk params to be safe

2013-09-05 3 min read Fedora Linux

It is always “Better safe than sorry” so, here are some things you
should do..

First check fstab, if you have partitions other than root then use UUID instead of device:

UUID=a8f13a0d-3f1f-42e4-b076-f44b4163306c /mnt/Backup     ext4 defaults,relatime 1 2

Then entries for all your mounts should be like above.
Points to note here :

Disk is mounted using the UUID and not with /dev/sdXX. This ensures
that even if your disk ids change, you will be able to mount them. To
get the partition UUID, you can execute :

Continue reading
Older posts Newer posts