Pages

Monday, May 17, 2010

Ubuntu: How to create slideshow using PhotoFilmnStrip

PhotoFilmStrip is an opensource software for create a movies from our photos in various formats like VCD,DVD etc in three easy steps.

Now download and install the programme.

Then go to Applications->Sound & Video->PhotoFilmStrip


Here press the '+' sign to select and add the photos



Press the tick sign then


Here, select some settings like dvd. pal or ntsc, duration and audio file and press 'Start' button to create a slidshow movie.


Sunday, May 16, 2010

Ubuntu: How to install additional screensaver

In ubuntu, the following packages are used for screensaver lovers. Now type the following command in terminal

sudo aptitude -y install xscreensaver-data-extra xscreensaver-gl-extra rss-glx

Then go to system->preferences-screensaver and select the desired screensaver


Some extra screensaver




Ubuntu How to install LBPxxxx canon printers

Here I explain how to install the Canon LBPxxxx printers in ubuntu

First, download the drivers from here and extract the file.


Then double click on the files and install or type the following command in terminal one by one.

1.sudo dpkg -i cndrvcups-common_2.00-2_i386.deb

2.sudo dpkg -i cndrvcups-capt_2.00-2_i386.deb

Now restart the cups type following commands in terminal

3.sudo /etc/init.d/cups restart

4.sudo /usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0

Type the following the screen will display printer models

5.ls /usr/share/cups/model/ |grep CNCUPS



here select the printer model for installation


6. /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E

Now the printer is installed




Then restart ccpd type the following command in terminal

7.sudo /etc/init.d/ccpd start

Set the ccpd at starting the computer type the following

8.sudo update-rc.d ccpd defaults 20

Now the printer works fine in my office .

Saturday, May 15, 2010

Ubuntu: zoho web services replacement of openoffice


Zoho web services applications, a replacement of openoffice and online editing storage office applications like word,spreadsheet,presentation. Create a documents online and store in local machine or online storage with zoho.

Installation

Type in ubuntu software center' search box 'zoho', select zoho applications and install it




After installation go to Applications->Office->zoho web services word processor or spreadsheet or presentation

A word document in online



A spreadsheet document in online


A presentation in online


Open a word document with zoho web services applications


Open a spreadsheet with zoho webservice applications

Friday, May 14, 2010

Ubuntu: How to find difference in days between two dates



Here a script for finding difference in days between two dates. .eg 10/1/2010 and 10/31/2010

Now open the empty text file namely betdat.sh (this is optional name)

sudo gedit betdat.sh

Then copy and paste the following script lines , save and exit

#!/bin/bash
# days-between.sh: Number of days between two dates.
# Usage: ./days-between.sh [M]M/[D]D/YYYY [M]M/[D]D/YYYY
#
# Note: Script modified to account for changes in Bash, v. 2.05b +,
#+ that closed the loophole permitting large negative
#+ integer return values.

ARGS=2 # Two command-line parameters expected.
E_PARAM_ERR=85 # Param error.

REFYR=1600 # Reference year.
CENTURY=100
DIY=365
ADJ_DIY=367 # Adjusted for leap year + fraction.
MIY=12
DIM=31
LEAPCYCLE=4

MAXRETVAL=255 # Largest permissible
#+ positive return value from a function.

diff= # Declare global variable for date difference.
value= # Declare global variable for absolute value.
day= # Declare globals for day, month, year.
month=
year=


Param_Error () # Command-line parameters wrong.
{
echo "Usage: `basename $0` [M]M/[D]D/YYYY [M]M/[D]D/YYYY"
echo " (date must be after 1/3/1600)"
exit $E_PARAM_ERR
}


Parse_Date () # Parse date from command-line params.
{
month=${1%%/**}
dm=${1%/**} # Day and month.
day=${dm#*/}
let "year = `basename $1`" # Not a filename, but works just the same.
}


check_date () # Checks for invalid date(s) passed.
{
[ "$day" -gt "$DIM" ] || [ "$month" -gt "$MIY" ] ||
[ "$year" -lt "$REFYR" ] && Param_Error
# Exit script on bad value(s).
# Uses or-list / and-list.
#
# Exercise: Implement more rigorous date checking.
}


strip_leading_zero () # Better to strip possible leading zero(s)
{ #+ from day and/or month
return ${1#0} #+ since otherwise Bash will interpret them
} #+ as octal values (POSIX.2, sect 2.9.2.1).


day_index () # Gauss' Formula:
{ # Days from March 1, 1600 to date passed as param.
# ^^^^^^^^^^^^^
day=$1
month=$2
year=$3

let "month = $month - 2"
if [ "$month" -le 0 ]
then
let "month += 12"
let "year -= 1"
fi

let "year -= $REFYR"
let "indexyr = $year / $CENTURY"


let "Days = $DIY*$year + $year/$LEAPCYCLE - $indexyr \
+ $indexyr/$LEAPCYCLE + $ADJ_DIY*$month/$MIY + $day - $DIM"



echo $Days

}


calculate_difference () # Difference between two day indices.
{
let "diff = $1 - $2" # Global variable.
}


abs () # Absolute value
{ # Uses global "value" variable.
if [ "$1" -lt 0 ] # If negative
then #+ then
let "value = 0 - $1" #+ change sign,
else #+ else
let "value = $1" #+ leave it alone.
fi
}



if [ $# -ne "$ARGS" ] # Require two command-line params.
then
Param_Error
fi

Parse_Date $1
check_date $day $month $year # See if valid date.

strip_leading_zero $day # Remove any leading zeroes
day=$? #+ on day and/or month.
strip_leading_zero $month
month=$?

let "date1 = `day_index $day $month $year`"


Parse_Date $2
check_date $day $month $year

strip_leading_zero $day
day=$?
strip_leading_zero $month
month=$?

date2=$(day_index $day $month $year) # Command substitution.


calculate_difference $date1 $date2

abs $diff # Make sure it's positive.
diff=$value

echo $diff

exit 0


Then in terminal type the following for making the file as executable.

sudo chmod +x betdat.sh

./betdat.sh 10/1/2010 10/31/2010
The output is

30



Thursday, May 13, 2010

Ubuntu: script to find largest number in 3 integers

Here small script for finding largest number in three integers

Open the text file via terminal

sudo gedit laint.sh

Copy and paste the following lines

#!/bin/bash
# Shell code to find largest integer among the 3 integers given as arguments.
# -------------------------------------------------------------------------

a=$1
b=$2
c=$3

if [ $# -lt 3 ]
then
echo "$0 n1 n2 n3 "
exit 1
fi

if [ $a -gt $b -a $a -gt $c ]
then
echo "$a is largest integer"
elif [ $b -gt $a -a $b -gt $c ]
then
echo "$b is largest integer"
elif [ $c -gt $a -a $c -gt $b ];
then
echo "$c is largest integer"
else
echo "Sorry cannot guess number"
fi

Save and exit from the file. Next

sudo chmod +x laint.sh

./laint.sh 90 70 40

the output is

90 is largest number

Ubuntu: How to get ip address,owener of domain name,etc

The following steps to know the ip address,owener of the domain name,etc .

1. Type the following command in terminal and open the empty text file

sudo gedit ipad.sh

Copy and paste the following lines in the text file ipad.sh then save and exit

#!/bin/bash
# A sample shell script to print domain ip address hosting information such as
# Location of server, city, ip address owner, country and network range.
# This is useful to track spammers or research purpose.
# -------------------------------------------------------------------------


# Get all domains
_dom=$@

# Die if no domains are given
[ $# -eq 0 ] && { echo "Usage: $0 domain1.com domain2.com ..."; exit 1; }
for d in $_dom
do
_ip=$(host $d | grep 'has add' | head -1 | awk '{ print $4}')
[ "$_ip" == "" ] && { echo "Error: $d is not valid domain or dns error."; continue; }
echo "Getting information for domain: $d [ $_ip ]..."
whois "$_ip" | egrep -w 'OrgName:|City:|Country:|OriginAS:|NetRange:'
echo ""
done


Then make the text file as executable file.

sudo chmod +x ipad.sh

Next execute the script 'ipad.sh'

./ipad.sh