Showing posts with label shell script. Show all posts
Showing posts with label shell script. 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 ---------------------------------------------------------

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 ---------------------------------------------------------

Friday, January 11, 2008

renaming files using shell

This script can be used to change the case of a file as required on the server
Its simple concept
find the exising files
change their case
move the old to new name

[root@server files]# vi rename.sh
#!/usr/bin/sh

c=`find . -name 'Course.xml' `;#|sed "s/Course/course/";
for path in ${c[@]}
do
newname=`echo $path|sed "s/Course/course/"`;
echo $newname;
mv $path $newname

done;