Checking the links to your site (from affiliates) using cron and bash script.

If you have some affiliate links and are concerned about their presence then you can setup cron to check the links for you regularly. For this you need a very simple script (as below) and a cron entry (example further down).

#!/bin/bash –
#===============================================================================
#
#          FILE:  checklinks.sh
#
#         USAGE:  ./checklinks.sh
#
#   DESCRIPTION:  Check if the links exists on affiliate sites
#
#       OPTIONS:  —
#  REQUIREMENTS:  —
#          BUGS:  —
#         NOTES:  —
#        AUTHOR:  Amit Agarwal (AKA), [email protected]
#       COMPANY:  Individual
#       VERSION:  1.0
#       CREATED:  04/07/2010 08:19:29 AM IST
#      REVISION:  —
#===============================================================================

websites=\”space seperated website address like http://amit-agarwal.co.in http://blog.amit-agarwal.co.in\”
echo \”Checking the sites for Links\”
echo $websites|tr \’ \’ \’\\n\’
echo
echo
for i in $websites
do
curl -s $i |grep amit-agarwal.co.in > /dev/null
if [ $? != 0 ]
then
echo \”Link not found on $i\”
fi
done

Then make a crontab entry like this:

40 08 * *  * (echo \”Subject: Link verification on affiliate sites @ `date`\”;<fullpath>/checklinks.sh) |/usr/sbin/sendmail <email>

\"Reblog

Startup animation and theme for Fedora 12 onwards.

Since the release of Fedora 12, fedora is using plymouth. Plymouth kicks in just after grub and before the Xserver starts.

Description:

Plymouth provides an attractive graphical boot animation in
place of the text messages that normally get shown.  Text
messages are instead redirected to a log file for viewing
after boot.

Plymouth does support themes and there are couple of plymouth themes already in the repos:

plymouth-theme-spinfinity-0.8.2-3.fc13.i686
plymouth-system-theme-0.8.2-3.fc13.i686
plymouth-theme-charge-0.8.2-3.fc13.i686
plymouth-theme-fade-in-0.8.2-3.fc13.i686
plymouth-theme-solar-0.8.2-3.fc13.i686

To use one of these you need to do the following and see the effects after a reboot:

sudo /usr/sbin/plymouth-set-default-theme <theme name>
sudo /usr/libexec/plymouth/plymouth-update-initrd

\"Reblog

Finding all the executables/binary in Linux rpm based distro.

I have been thinking about this for quite sometime now, how to find all the executables on the linux system. One of the way is to do a \”ls\” on all the directories in the PATH variable. But that will not list the executables that are outside of the PATH. So, I wrote this one liner :

rpm -qal |agrep \”bin\\/\” > all_execs

This will list all the files in the Linux system in bin or sbin directory and that should be pretty much all the binaries in the system.