get the contents of whole site like some wiki or wikia

For wikis and wikia, generally if you are trying to get some url mirror, then websucker.py is an excellent option. This script is in the python sources so, to get this tool,

yumdownloader --source python

Install the rpm downloaded in current directory and then go to ~/rpmbuild/SOUURCES.  You should find a Python-*.tar.xz file here, just extract with

tar xvf Python*.tar.xz

and there you go, you should find the tool in Tools/webchecker/websucker.py.

Enhanced by Zemanta

cksum – compare for multiple files.

If you have to compare cksum for couple of files, the you know how cumbersome it is. So, I wrote a simple script, wherein you can create a file called cksums in the current directory and copy paste the result of  “cksums *”  into this file, and then run this script. Cool 🙂

#!/bin/bash -
#===============================================================================
#
#          FILE: checkcksums.sh
#
#         USAGE: ./checkcksums.sh
#
#   DESCRIPTION: Compare cksums of multiple files.
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (),
#  ORGANIZATION:
#       CREATED: 02/22/2013 09:12:17 PM IST
#      REVISION:  ---
#===============================================================================

file=cksums
while read line
do
    a=( $(echo $line) )
    if [[ -f ${a[2]} ]]
    then
        b=( $(cksum ${a[2]}) )
        if [[ $a == $b ]]
        then
            echo "Cksum for ${a[2]} = ${a[0]} matches"
        else
            echo "Failed ::Cksum for ${a[2]} = ${a[0]} matches"
        fi
    else
        echo "Failed :: file ${a[2]} does not exist"
    fi
done < $file
Enhanced by Zemanta

viewvc – serve current directory in web interface.

Here is the description of viewvc:

ViewVC is a browser interface for CVS and Subversion version control
repositories. It generates templatized HTML to present navigable directory,
revision, and change log listings. It can display specific versions of files
as well as diffs between those versions. Basically, ViewVC provides the bulk
of the report-like functionality you expect out of your version control tool,
but much more prettily than the average textual command-line program output.

and to install, just execute:

sudo yum install viewvc

And when you want to serve the current directory in the web browser, you just need to execute the following command in that directory:

/usr/lib/python2.7/site-packages/viewvc/bin/standalone.py -r $PWD

 

Enhanced by Zemanta