Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Monday, February 15, 2010

Is language really important

I have tried my hands on most of the languages to check if one is better than the other. I rather found all of them to be useful in their own way. Its important for the developer to choose the right language/tools to make the application or program better.

For example one could/should use c/c++ for system level stuff, writing device drivers etc . But if a developer wants to write a web application with C/C++ then that is going to be a nightmare.

Languages like PERL/ruby/python have uses mostly in the *NIX (Linux/Unix) world where the developer or the system admin uses them to do stuff that could save a lot of human labor.

PHP has been in news for a while now.. and it seems to be a nice language  for which it was initially developed .. Its a good language for small/medium size web apps .. but the number of extensions and modules are lesser as compared to cpan for PERL

My all time favorite has been PERL . which has the ability to do both system  and web programming. and its highly customizable to make it efficient and fast. 

LAMP - Linux apache Mysql and Perl/PHP has been the best combination on the internet and a lot of successful website still serve thousands of pages using them.

so the point is unless you are really writing something that is going to change the world don't really bother too much on things like ruby (vs) perl (vs) php (vs) python.. each can solve you problem in the way you want it to.


http://news.cnet.com/8301-13505_3-10453213-16.html




Friday, June 13, 2008

script to monitor mysql status

#------------------------------------------ BEGIN ---------------------------------------------------------
#Author Jabir Ahmed
# Date : 19th January 2008
# Email : jabirahmed@yahoo.com
# Purpose : cron to check the mysl status at regular interval and send mail to admin
#usage
# sh connection_monitor.sh username password hostname


username=$1;
password=$2;
hostname=$3;
mailid="jabirahmed@yahoo.com";


# if you only want the number of connections then use this line

#mysqladmin extended -u $username -p$password -h $hostname|grep Threads_connected -i|sed "s/|/---/g"|mail -s 'mysql status '`date` $mailid



# for complete mysql info use this line
mysqladmin extended -u $username -p$password -h $hostname|mail -s 'mysql status '`date` $mailid



#------------------------------------------ END OF SCRIPT ---------------------------------------------------------

Tuesday, February 26, 2008

Backup only a limited number of tables in mysql

#!/bin/ksh


# Author : Jabir Ahmed
# Date : 26 Feb 08
# Purpose : To backup only a specified number of tables with data from the database
# Email : jabirahmed@yahoo.com

username='root';
password='xxxxx';
hostname='localhost';
command='mysqldump';
database='mysql';
dump_file='database_dump.dbh';


echo show tables|mysql -u $username -p$password -h $hostname $database > /tmp/$$.txt
if [ -e $dump_file ]
then
rm -rf $dump_file
fi

while read TABLENAME
do
echo -n "Backing up table " $TABLENAME
for i in user db func user
do
if [ "x$TABLENAME" == "x$i" ]
then
backup=1;
fi
done
if [ backup -eq 0 ]
then
echo "[ STRUCUTE ]"
$command $database -u $username -p$password -h $hostname $i -d >>$dump_file
else
echo '[ DATA ]';
$command $database -u $username -p$password -h $hostname $i >>$dump_file
fi


backup=0
done < /tmp/$$.txt
echo 'Done'
rm -rf tables.txt
exit;

Friday, January 18, 2008

script to monitor mysql status

#------------------------------------------ BEGIN ---------------------------------------------------------

#Author Jabir Ahmed
# Date : 19th January 2008
# Email : jabirahmed@yahoo.com
# Purpose : cron to check the mysl status at regular interval and send mail to admin

#useage
# sh connection_monitor.sh username password hostname

username=$1;
password=$2;
hostname=$3;
mailid="jabirahmed@yahoo.com";


# if you only want the number of connections then use this line

#mysqladmin extended -u $username -p$password -h $hostname|grep Threads_connected -i|sed "s/|/---/g"|mail -s 'mysql status '`date` $mailid



# for complete mysql info use this line
mysqladmin extended -u $username -p$password -h $hostname|mail -s 'mysql status '`date` $mailid



#------------------------------------------ END OF SCRIPT ---------------------------------------------------------