Linux, Programming, Telephony, Asterisk, Apache, Tips & Tricks

Passionate About Technology

  • Home
  • About

How A Microsoft Veteran Learned To Love Linux And Why It Matters

Posted by admin in June 19th 2009  

Great Article

“After The Software Wars”, is a new book in which former Microsoft employee Keith Curtis explores the worlds of proprietary and free software. Quoting from the article:

While I came to not be all that thrilled with Fedora itself, I was floored merely by the installation process. It contained a graphical installer that ran all the way to completion, it resized my NTFS partition — which I considered a minor miracle, setup dual boot, and actually did boot, and let me surf the Web. I didn’t have a clue what to do next, but the mere fact that this all worked told me more about the potential of Linux than anything I had read so far. You cannot, by accident, build an airplane that actually flies.

Read More : How A Microsoft Veteran Learned To Love Linux And Why It Matters

  • Share/Save/Bookmark
No Comment
under: Linux
Tags: Keith Curtis, Linux, microsoft
Digg it Add to del.icio.us Stumble it add to technorati

Autocompletion in Terminal is not working

Posted by admin in June 19th 2009  

One of the most helpful feature I find in linux boxes is it autocomplete fasility. This feature will make our job more easier. But in some servers or VPS this option is desabled by default or relevent packages for autocomplete where not installed. To enable autocomplete we need to two things.

1. Install the package “bash-completion”

$ sudo apt-get install bash-completion

2. Add the following lines to the file ~/.bashrc or /etc/bash.bashrc

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi
  • Share/Save/Bookmark
No Comment
under: Linux
Tags: autocomplete, bash, Linux, teminal, vps
Digg it Add to del.icio.us Stumble it add to technorati

Eucalyptus in Ubuntu Jaunty

Posted by admin in May 1st 2009  

The Ubuntu 9.04 Server Edition beta includes Eucalyptus, an open source software infrastructure for implementing “cloud computing” on clusters, such as Amazon’s EC2 (Elastic Compute Cloud). Eucalyptus is provided as a technology preview to allow users “to experiment with cloud computing”.

EUCALYPTUS — Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems — is an open-source software infrastructure for implementing Elastic/Utility/Cloud computing using computing clusters and/or workstation farms. The current interface to EUCALYPTUS is interface-compatible with Amazon.com’s EC2 (arguably the most commercially successful Cloud computing service), but the infrastructure is designed to be modified and extended so that multiple client-side interfaces can be supported. In addition, EUCALYPTUS is implemented using commonly-available Linux tools and basic web service technology making it easy to install and maintain. For more information click here.

Get the User Guide from this link http://open.eucalyptus.com/wiki/EucalyptusUserGuide_v1.4

  • Share/Save/Bookmark
No Comment
under: Cloud Computing, Linux
Tags: Amazon, cloud, ec2, elastic, eucalyptus, Linux, open-source, S3, ubuntu
Digg it Add to del.icio.us Stumble it add to technorati

Linux Date Command Option

Posted by admin in April 8th 2009  

Date command options.

Date command to get the current date.

$ date=$(date +%Y-%m-%d)
$ echo $date

Date command to get yesterday’s date.

$ date=$(date --date=yesterday +%Y-%m-%d)
$ echo $date

Date command to get tomorrow’s date.

$ date=$(date --date=tomorrow +%Y-%m-%d)
$ echo $date
  • Share/Save/Bookmark
No Comment
under: Linux, Linux Commands, Shell Script
Tags: date, option
Digg it Add to del.icio.us Stumble it add to technorati

Bad Customer service from Lenovo for their Laptops

Posted by admin in February 26th 2009  

This is a true story of one of my friend

“This a true story of mine. I brought a Lenovo 3000N200 series laptop one year back, exactly 21’st Feb 2008 from Dubai Shopping festival for Rs 35, 000. I was very satisfied with their product initially, as it is cost effective with good performance. But after 3 months of working my laptop charger burnt out. I called up the customer care (18004252666) asking for the replacement and they said because it is burnt, they can’t replace it. For me, living without laptop and internet is worst thing in my life”

Read the complete story from the authors blog

  • Share/Save/Bookmark
No Comment
under: Linux
Tags: laptop, lenovo, service
Digg it Add to del.icio.us Stumble it add to technorati

Setting Up the world Database (Countries, States, Cites, etc)

Posted by admin in February 9th 2009  

In certain applications we need the details of all the counties in the world, all the states in in each country and the capital of all the country.  And it is difficult to create all theses information’s manually. But mysql provide a file world.sql which contains sample data for a world database that you can play with. This file contains names of all the Countries in the world, States, Cities, etc.  The file is available for download from the mysql site http://dev.mysql.com/doc. For more details about world.sql visit the site http://dev.mysql.com/doc/world-setup/en/world-setup.html.

To load the contents of the world.sql file into MySQL, use the following procedure:

  1. Change directory to where the world.sql file is locatedIf your current directory is not the same as the location of the world.sql file, use a cd command to change location.
  2. Connect to the MySQL server using the mysql programAt your command-line prompt, issue this command:
    shell> mysql -u root

    This command connects to the server using the MySQL root account to make sure that you’ll have permission to create the world database. The --p option tells mysql to prompt you for the root password. Enter the password when prompted. (Remember that the MySQL root account is not the same as the operating system root account and probably will have a different password.)

  1. Create the world database and select it as the default database:In the mysql program, issue the following statements:
    mysql> CREATE DATABASE world;
    mysql> USE world
  2. Load the contents of world.sql into the world databaseIssue a SOURCE command to tell mysql to read and process the contents of world.sql:
    mysql> SOURCE world.sql

    You’ll see quite a bit of output as mysql reads queries from the world.sql file and executes them.

After mysql finishes processing the world.sql file, try this statement:

mysql> SHOW TABLES;
+-----------————————--------------+
| Tables_in_world |
+-----------————————--------------+
| City            |
| Country         |
| CountryLanguage |
+-----------————————--------------+

The world tables contain the following types of information:

  • Country: Information about countries of the world.
  • City: Information about some of the cities in those countries.
  • CountryLanguage: Languages spoken in each country.

To see what columns each table contains, use DESCRIBE. For example:

mysql> DESCRIBE Country;
mysql> DESCRIBE City;
mysql> DESCRIBE CountryLanguage
  • Share/Save/Bookmark
No Comment
under: Mysql
Tags: , cities, countris, district, language, Mysql, population, states
Digg it Add to del.icio.us Stumble it add to technorati

eAccelerator

Posted by admin in January 24th 2009  

eAccelerator

eAccelerator is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.

eAccelerator stores compiled PHP scripts in shared memory and executes code directly from it. It creates locks only for a short time, while searching for a compiled PHP script in the cache, so one script can be executed simultaneously by several engines. Files that can’t fit in shared memory are cached on disk only.

Installing From Source

unpack it by ::

$ sudo tar -xjvf eaccelerator-0.9.5.3.tar.bz2
$ cd eaccelerator-0.9.5.3/

Linux User Read README file

Windows User Read README.win32

Compile and install it with ::

./configure
make
sudo make install
make test

Add the below line to php.ini file

extension=eaccelerator.so

Check phpinfo()  and conform the module eAccelerator is loaded

phpinfo

  • Share/Save/Bookmark
No Comment
under: Linux
Tags: accelerator, cache, code, eAccelerator, open-source, optimizer, performance, PHP, speed
Digg it Add to del.icio.us Stumble it add to technorati

Shell Script To Monit Swap Usage

Posted by admin in January 2nd 2009  

Some time our system started to use more swap area even 100% of swap area and the system crashes. So for a System Admin it would be very helpful when they get informed if the system started to use more swap usage so that system admin can manage the server before crashing. So I wrote a shell script which will Alert by send mail if the system started to use more that 70% of swap area.

$ vim swap-usage.sh
#!/bin/sh
free -m | grep Swap | while read output;
do
  swap=$(echo $output | awk '{print $2}' )
  used=$(echo $output | awk '{ print $3 }' )
  freed=$(echo $output | awk '{ print $4 }' )
  echo "Swap : $swap"
  echo "Used : $used"
  echo "Free : $freed"
  usep=`expr $used \* 100 / $swap`
  echo $usep
  if [ $usep -ge 70 ]; then
    echo "Swap Usage Alert Total Swap: \"$swap\" Used: \"$used ($usep%)\" Free:
\"$freed\" on $(hostname) as on $(date)" |
     mail -s "Alert: Swap Usage space $usep%" mail1@example.com,mail2@example.com
  fi
done

This script will send mails to the specified mails, if the system started to use more than 70% of  swap area. For continuously check the swap usage we need to set a cronjob for executing this script. So that the system should monit the swap usage by executing this script.

Edit the corntab file.

$ sudo crontab -e

Set the cronjob to to execute the script in every 15 Mints.

*/15 * * * * ~/scripts/swap-usage.sh

Restart the Cron

$ sudo /etc/init.d/cron restart
  • Share/Save/Bookmark
No Comment
under: Linux, Shell Script
Tags: cron. swap, monit, swap-usage, system admin
Digg it Add to del.icio.us Stumble it add to technorati

Shell script to notify Hard disk space utilization

Posted by admin in December 13th 2008  

The below script will check the hard disk space usage, using the command du and send an email alert if any of the partition is using more than 85% of space.

vim disk-usage.sh

#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
  echo $output
  usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1  )
  partition=$(echo $output | awk '{ print $2 }' )
  if [ $usep -ge 85 ]; then
    echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
     mail -s "Alert: Almost out of disk space $usep%" example@example.com
  fi
done

Set a cronjob to run this script.

*/30 * * * * /bin/sh /path-to-file/disk-usage.sh
  • Share/Save/Bookmark
No Comment
under: Shell Script
Tags: hardisk space, monit, notification, Shell Script
Digg it Add to del.icio.us Stumble it add to technorati

Configuring Iptables on system startup

Posted by admin in December 3rd 2008  

In Ubuntu we don’t have a mechanism to start or stop iptables or we don’t have a mechanism to restore iptables after restarting the system. Now we will see how to create a script for start and stop iptables also to make the script to start on system startup.

1. Create a Firewall script

 vim /etc/set_iptables.bash
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.10 --dport 555 -j DNAT --to 192.168.0.12:22
iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.12 --dport 22 -j ACCEPT

2. Change the file permission mod

sudo chmod o+x /etc/set_iptables.bash

3. Create a start.stop script

vim /etc/init.d/iptables
#!/bin/bash

RETVAL=0

# To start the firewall
start() {
  echo -n "Iptables rules creation: "
  /etc/set_iptables.bash
  RETVAL=0
}

# To stop the firewall
stop() {
  echo -n "Removing all iptables rules: "
  /sbin/iptables -F
  RETVAL=0
}

case $1 in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  status)
    /sbin/iptables -L
    /sbin/iptables -t nat -L
    RETVAL=0
    ;;
  *)
    echo "Usage: iptables {start|stop|restart|status}"
    RETVAL=1
esac
exit

4. Change the file permission mod

sudo chmod o+x /etc/init.d/iptables

5. The final step is to make your script running on each boot of your computer:

sudo update-rc.d iptables defaults

Now you can use these commands to start/stop/restart/status your iptables.

sudo /etc/init.d/iptables start
sudo /etc/init.d/iptables stop
sudo /etc/init.d/iptables restart
sudo /etc/init.d/iptables status
  • Share/Save/Bookmark
No Comment
under: Linux, Shell Script, Tips & Tricks
Tags: firewall, Iptables, start, status, stop
Digg it Add to del.icio.us Stumble it add to technorati
« Older Entries

Live Trafic Feeds

Search

Email Subscriptions

  • Enter your email address:

    Delivered by FeedBurner

Feeds

feeds
get latest updates on news and subscribes to our feeds
feeds

Categories

    • Apache
    • Cloud Computing
    • Iptables
    • Linux
    • Linux Commands
    • Micellanious
    • Mysql
    • PHP
    • Securities
    • Shell Script
    • Solaris
    • Tips & Tricks

Subscribes

  • stumble
  • technorati add aol netvibes rojo myyahoo modern freedictionary subrss chicklet plusmo newsburst ngsub wwgthis subscribes

Calendar

  • July 2009
    M T W T F S S
    « Jun    
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  

Blogroll

    • Abhilash T.B
    • Bipin B
    • D.OLPH.IN
    • I am a Techie
    • Kenney Jacob
    • Neena Nair
    • Neena Nair Photos
    • Sajith MR
    • Sarath D R

Tags

  • all Amazon Apache autobench background process backups catch all catchall cleaning directories date deamon digital certificate error favicon firewall google map API Google Map Key httperf http testing image in address bar Iptables Linux mail server monit Mysql mysql backups mysqldump mysqlhotcopy open-source openload pcntl performance performance testing PHP php-modules php installation postfix s3fs Shell Script ssh-key ssh-keygen teapop ubuntu varnish

Archives

    • June 2009
    • May 2009
    • April 2009
    • February 2009
    • January 2009
    • December 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008

Recent Comments

  • heat pump in Installing Symfony Framework in Ubu…
  • Prajith in Best Practices for Speeding Up Your…
  • Alexwebmaster in Apache Load Balance Using Haproxy
  • hoinar in Logging into Mysql without Password…
  • Linux, Solaris,… in Apache URL Rewriting
  • admin in ssh-keygen :: SSH Login without Pas…
  • hastonian in ssh-keygen :: SSH Login without Pas…
  • admin in Running ASP.NET applications on Ubu…
  • Bipin in Running ASP.NET applications on Ubu…
  • tamas in Mount Amazon S3 bucket to a Local L…

Most Comments

  • Best Practices for Speeding Up Your Web Site (6)
  • Google Maps API (2)
  • Mount Amazon S3 bucket to a Local Linux File System (2)
  • Running ASP.NET applications on Ubuntu using Mono (2)
  • ssh-keygen :: SSH Login without Password (2)
  • HTTP performance testing with httperf, autobench & openload (1)
  • Installing and Configuring FTP Server Using vsftpd (1)
  • Favicon icon in the address bar (1)
  • Apache URL Rewriting (1)
  • Logging into Mysql without Password (1)
  • Apache Load Balance Using Haproxy (1)
  • Installing Symfony Framework in Ubuntu (1)

Recent Posts

    • How A Microsoft Veteran Learned To Love Linux And Why It Matters
    • Autocompletion in Terminal is not working
    • Eucalyptus in Ubuntu Jaunty
    • Linux Date Command Option
    • Bad Customer service from Lenovo for their Laptops
    • Setting Up the world Database (Countries, States, Cites, etc)
    • eAccelerator
    • Shell Script To Monit Swap Usage
    • Shell script to notify Hard disk space utilization
    • Configuring Iptables on system startup
Box-Tube Box Modulize WordPress Theme By Dezzain Studio
©2006-2009 Linux, Programming, Telephony, Asterisk, Apache, Tips & Tricks
Wordpress Themes     Valid XHTML    Valid CSS