Just another WordPress.com weblog

TCP/IP

Today i started to learn python cgi. In the begining, i had to know the network concepts like how data are transferred over the network. I got clear idea about TCP/IP(Transmission Control Protocol/Internet Protocol), that is, It is a rule to be followed for transferring data over internet. First data are divided into small packets and packed with relevant information and IP assigns destination address to each packets

Now all packets are no need to follow the same path. Router will direct the packets to manage data traffics over internet to reach its destination.

And there are different type of HTTP requests GET, POST, PUT, CONNECT, TRACE, DELETE, HEAD, OPTIONS.

CGI – Common Gateway Interface

It is external program to a web server which process the client requests and return respective results.
CGI Concept and Processing Steps :
1. Client sends requests
2. Server receives requests
3. Contacting external program called CGI script
4. CGI script process client data and returns the result to server
5. Server serves response to Client

It can be written in Ruby, Python, PHP, Perl. CGI mostly uses GET and POST.

I got tired to configure the apache server to make working python file. Finally, i succeeded to work with python cgi.

These are all the steps which i did,

First i created folders /var/www/python/cgi-bin/ and changed folder permission

as $ sudo chmod -R 777 /var/www/python

Then i created this test file to check in the browser and saved it as index.py in cgi-bin folder

#!/usr/bin/python
print “Content-Type: text/plain\n\n”
print ‘python works’

And i added the cgi-bin directory path in /etc/apache2/httpd.conf file as follows:

<Directory “/var/www/python/cgi-bin”>
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

<Directory “/var/www/python/cgi-bin”>
    Options All
</Directory>

          If cgi-bin directory path is not set, apache will throw 403 Forbidden error, that means, either you dont have enough permission or this folder is not having 777 permission. Next is, restarting apache server sudo /etc/init.d/apache2 restart to reflect the changes in server.

               Now i tested the index.py file, It downloaded the python file instead of opening in browser. This is where i got stuck to go ahead. I googled and tried to fix the solution. After struggling more than one hour, i found that browser is not recognized the the cgi script file.

        It means that some configuration is missing for setting up MIME type in apache server.  The actual file to be configured is mime.conf in /etc/apache2/mods-enabled/mime.conf. I just uncomment this line

AddHandler cgi-script .cgi

and add .py at the end of this line to look like

AddHandler cgi-script .cgi .py

Now restart your server $ sudo /etc/init.d/apache2 restart and run the index.py file in browser.

Cheers,

FATAL ERROR: MODx Setup cannot continue.

To use PHP 5.3.0+, you must set the date.timezone setting in your php.ini. Please do set it to a proper timezone before proceeding. A list can be found here

Read the rest of this entry »

I joined in Nuveda Learning Pvt Ltd on 4th March 2011 as Software Product Engineer.

I mingled with the training team on the first itself. The project is based on the learning systems.

Flex as front-end and Modx Revolution as backend for this project. My training started with Modx Revolution. In the begining, modx revolution was difficult for me to understanding the concept. It took 2-3 weeks for learning it. Modx Revolution supports HTML, XML, JSON, RSS feed and PHP&MySQL. Hence, I had to learn more about these languages.

Modx Revolution is one of the Content Management System( or PHP Framework). It has great features and plugins for creating a website.

Modx Revolution download : http://modx.com/download/ (Standard Distribution – Traditional version)

Modx Installation :

  • Extract the downloaded file
  • open the terminal  and copy the downloaded file to localhost
  • $ sudo cp -R source/path/of/downloadedfile to /var/www/
  • open your web browser, type localhost/<modxfoldername>/setup
  • follow the link for installation : Basic Installation

Here, I had Internal server 500 Error issue because of timezone setup. Then i cleared it by setting the timezone to Asia/Culcutta in php.ini file

My modx learning started with the modx official documentation : http://rtfm.modx.com/display/revolution20/Home

As i mentioned before about my project using pygtk and glade, it is now been completed.

Project Description :
This application is applicable to retail business. You can import your Product details in your business into the database. It has different modules User Management, Product Management, create stock details, Billing, Report automation and Production and Sales report etc.,

Features:
It provides stocks details and sold product details and Report Automation on the daily basis. User can be created by admin with some restriction. Product can be added to database by admin.

I hosted my project in code.google.com : http://code.google.com/p/py-retail/

Here is screenshots :

Python 2.7 Vs Python 3.1

Date : 06/02/2011

Place : KanchiLUG Meet

I explained some new features added which was been lacking in Python 2.7 to the Python 3.1 at KanchiLug weekly meet. I gave the demo using both Python 2.7 Interpreter and Python 3.1 Interpreter about those features such as output of divisonal operator, file object creation, dictionary’s ordered list, Indentation exceptional error, format specifier etc., To know more details of the new features in Python 3.1, use this link New Python 3.1 Features

Booming GNU/Linux,

செல்வமணி.  ச

Place : Birla Planetarium, Chennai.

Date   : 30/12/2010.

Mr. Lenin, authority of Birla Planetarium, organized one hour FOSS(Free/Open Source Software) session with Students(7th Standard to 9th Standard) on Dec 30 2010. Mr. T. Srinivasan asked Dhastha to conduct this session. I got this message from Dhastha to accompany him.  This program was arranged only for the Students. I met Dhastha at there. The session started exactly at 10am. There were around 60 people.  At the beginning what I thought is “All were looking small, so they don’t know anything about Operating System. So It will take so hard to make them clear understand about Linux”.To make this session very useful to the students, before we started we got some information from them to know their knowledge of computer. Everyone had experience with Windows. Their knowledge about computer was so helpful and saved our time to reach our points easily.

I and Dhastha started to talk with student with the as usual story of Ritchard M Stalman and Linus Torvalt. Everyone  impressed with Linux. We showed them Ubuntu and its compiz features. Then we played BigBugBunny animation clip. All kids enjoyed this.

Next question session. Followings are some question, which We never expected from them

1. At the session I explained about kernal orally. 8th standard student asked us that ” How can I see the source code of kernal?”. Thats it, a few moment I was kept silent.

2. How can I install linux in my system?

3. Where can I get help regarding linux?

4. Some kids said, can you give your mobile number? I will call you with my dad, and elder brother and explain about linux to them.

5. How to play games?

6. One student asked me a critical question that is “Linux is a free OS and have all kinds of softwares, then Why it is not famous. I mean why we dont know about linux?

7. Will Linux affect by virus?

That was really amazing.

At the end of the session, we met another unexpected incident. Some kids came forward to asked us “Autograph”. What to say? That was my memorable day..

Booming GNU/Linux,

செல்வமணி. ச

You can commit you project using subversion as follows:

svn commit -m “Your comment here for your modification on the project” –username <gmailusername>

Then the following prompt should be opened for commiting your project successfully…

Password for ‘<gmailusername>’:

For this password, you should give your code.google.com password assigned to you while hosting your project.

First time commiting project using svn commit will work properly.

If you are commiting your project next time, you can get the prompt like

Password for ‘(null)’ GNOME keyring:

which means, Multiple keyrings are present on a users system. All users will have a default keyring, and another which is only stored in memory. For each commit, gnome-keyring stores the user details in another keyring. To disable this, open the config file in the subversion from the home folder as follows:

selva@selva-laptop:~$ cd .subversion/

selva@selva-laptop:~$ ls

auth  config  README.txt  servers

open the ‘config’ file with any text editor,

selva@selva-laptop:~/.subversion$ gedit config

inside the text file, look for the line ‘password-stores = no’ under ‘[auth]‘ section and uncomment it & remove the value ‘no’ for it to look like ‘password-stores = ‘. Then, save and close config file.

Finally, open another file named ‘servers’ in text editor,

inside the text file, look for the line ‘store-passwords = no’ under ‘[global]‘ section and just uncomment it. Then, save and close ‘servers’ file.

That’s it. Now, you can commit your project anytime with the code.google password assigned to you.

 

Booming GNU/Linux,

செல்வமணி. ச

I  discussed about Glade to the new luggies to Kanchi LUG.

Around 10 people attended the class.

Introduction : Glade is a GUI interface to design front end application and its specialty is that it can be bound with any languages ( C, C++, Ruby , Python , Java) .

I showed a live demo for the widgets available in glade like toplevels, containers, controls and display and some miscellaneous widgets and its use in application. And I explained about how to make front end design.

I used python language as a backend. I taught that how to connect the Glade file with python through GTK(Gnome Tool Kit) called ‘PYGTK’. I created a sample Hello world program in gtkBuilder format and made connection using pygtk with it.

Here you can view the file attached.

Glade design in gtkBuilder format and Pygtk

Boomin GNU/Linux,

செல்வமணி. ச

What is ChennaiPy?

ChennaiPy is one of the FOSS(Free & Open Source Software) activity where people can know more about python language. MIT College supports for conducting this activity at every third Saturday of  each month. Anyone who are all Students and Public willing in programming can participate and attend the ChennaiPy program.

Discussion:

I shortlisted the standard sequence types such as Numbers, Strings, Lists, Tuples and Dictionary available in Python. I discussed all string handling methods like capitalize, find, ljust, index, translate, Constant string methods and many more. It really gave me good experience and a chance to have discussion with the new people. That discussion was healthy one. I really proud of spreading the foss world to the outside world. This activity is welcomed by many people. I also will always give my cooperation.

Booming GNU/Linux,

செல்வமணி. ச

Follow the steps given below to delete and remove your google account permenantly

1. First Login into your gmail account

2. Click Settings menu at top corner of your gmail.

3. Then click Accounts and Import tab from the Settings menu.

4. The last option will be Change account settings. Click Google Account settings next to it.

5. It will be redirected to another page. Here, you select Edit link next to “My products”.

6. Here, you can see the link like

  • Remove Gmail permanently
  • Remove Web History permanently
  • Remove Orkut permanently

7. Click the first one Remove Gmail permanently.

8. There will be question to remove your gmail account followed by a check box. Click on checkbox.

9. Then give your gmail account like <anyemailname>@<hostname.com or co.in> in New, and your gmail password in Current password column.

Where hostname may be yahoo.com or yahoo.co.in or gmail.com.

10. Finally, click on Remove Gmail button. You will receive a message for verifying whether it is deleted or not. To verify it, go to alternative mail address you gave while removing gmail account. where you would get an email from google. Click that link to confirm for deletion of your gmail account. Now your gmail account removed permanently.

Booming GNU/Linux

செல்வமணி. ச

Tag Cloud

Follow

Get every new post delivered to your Inbox.