15 October 2007

Drupal Configuration Problem on Godaddy

Hi Friends :
Today , I configured Drupal on my Godaddy hosting account.

Problem : Initially it was unable to configured and showing some problem, unable to connect local host,,

Solution : i went to hosting account and then mysql and clicked on open manager, i was that , mysql data base server was there at location,,,,
I clicked on advanced configuration and then changed localhost to
not every thing goes correct

Hope you will get benefited by this :

To Know , why I am posting this. Click Here ;)

11 October 2007

How to change extention of multilple files at once in shell

keywords : files, shell , backup extension

1 Add a extension (for example .old ) to selected files
======= content of file ./backup ======

for FILE in *.$1 ;do cp $FILE $FILE.old; done
exit 0
--------- end of file ---------------------
./backup html

result : all .html files are now .html.old

2 . Remove the extension to selected files

======== content of file ./unbackup =====
for FILE in *.old ; do cp $FILE `basename $FILE .old`; done
exit 0
all .html.old files are now copied to .html

3 . Remove all backup files

rm *.old

Search in side the bookmarks

First way =>
You can bookmark your bookmark page,
see all the bookmarks , are stored in html page.,
For example in my system the path to bookmarks page is
so open it in web browser,
like this,
Now press Ctrl+F and now you can search any bookmarks.
there is one good feature about the highlighting, so you can just click on highlight and scroll to see, (no need to click on next and next)

2 nd way
Google toolbar provide the way you can search
see this window , you can see it,

10 October 2007

Firefox proxy Bug : Firefox is not responding

I use firefox with proxy setting. I use squid proxy server which is installed locally on my system.
I observed that many time clicking on firefox button doesn't work. if you click double it says that , firefox is already running. i was lucky that i found that this is due to squid proxy. Stopping the squid service will help you. after correct startup of firefox again start it.

Now if squid server is on remote location that you cannot edit the setting.
i have not checked answer for this question, may be you need to open the firefox in command line as off-line working mode, or detach the network cable, or may be you need to go firefox directory and edit the configuration. (I have not checked out any of these method , as i use local proxy server).

07 October 2007

Godaddy 404 Problem

Godaddy 404 Problem
This is a copy of customer request , i made on godaddy, iwill upload their response, if they give!!
Hello sir , I am sending the problem and solution at the same time.
The Problem : I wanted to verify my site on some google services. verification can be done in two way. 1st by uploading a html file and second is adding a meta tag to home page. due to some reason i have to verify using uploading a html file. after uploading the file , the verification fails as it gives following code.
<-- Verification status: NOT VERIFIED Last attempt Oct 6, 2007: We've detected that your 404 (file not found) error page returns a status of 200 (Success) in the header. -->
This happen because your default 404 error page is not a real 404 page. it shows that files is nor there but this is a 200 OK response. you can see this using command line. use wget utility to download unavailable web page on some others user's website. command line clearly shows about the 200 OK response for the ftp upload information. What to do with setting so that it makes a real 404 response.

Solution :

there are three option in 404 error handling. default is 3rd one , which is my problem.

1st option which redirects 404 error to homepage is not a solution as it gives 200 OK status , and more over doing this is again a problem see

Now 2nd option is some custom file upload.

Can you give a way to create a file which i will upload and that will exist on your system and it gives some "file not found" display on browser but at the same time it gives 404 not found error code on command line? If you do not have any answer then this trick works !

actually I made a trick to do so, I ticked the 2nd option, and set a path to some custom uploaded file. now the trick is i have not uploaded the my custom error file. so whenever any user is making a invalid request , then i you are redirecting to my uploaded file. since i have not uploaded any file like that so,, now your server is making a real 404 not found page.

Sunday, October 07 2007 11:49 AM
Narendra Sisodiya

20 August 2007

Speed up Hostel PC using Port Forwording using ssh

Heart of this trick is this command
ssh -L 8080:localhost:80 narendra@

see my hostel pc is use 100 Mbps
and lab pc is use 10Mbps very slow

now hostel pc is very slow so, i put this command so that all the communication on my port 8080 will be directed to port 80 of my lab pc , so my hostel pc is as slow as previous but only one difference that my port 8080 is very fast , because all the communication of this port is actually is connected to PC lan, and not hostel lan,

So to make my hostel pc fast now we need to edit the proxy setting. go to "Network Proxy Preference" from menubar by click on system then preferences then Network Proxy on Fedora 7. This my updates of yumex goes very fast and download speed is also very fast, but from lab PC i can access my neighbour PC which is but i tried to access smb:// from hostel but not working so i will try latter to edit some setting so that you will be present to virtually on lan of institute from hostel PC.

Now its time to hack VNCVIEWER, from hostel PC you cannot connect the remote desktop to linux using vncviewer because of lan and network setting. and more over it you able to connect , then also the connection is not secure because nature of vnv protocol, so you can actually tunnel the vnc traffic inside a ssh in which you can forward your VNC port.
for more details

But most simple way , which i use with-out port forwarding,, ;)
$ ssh -X user-name@ip-address
$ vncviewer localhost

13 August 2007

How to copy all pdf from a folder and subfolder

Sometimes We get a big directory which has a lot of many subdirectories and so on, generally I use to copy a courses form websites. i use to copy full or part of a site (that include every files and folder) using wget command. but only pdf files are need mainly. So here is command which copy all the pdf files to a single directory.
here is the situation

now using command line go to the BIGFOLDER directory using cd command
then copy past this line

mkdir ../allpdf;find -name '*.pdf'|while read Filename ; do cp "$Filename" ../allpdf/ ; done
after applying we will get a new folder named allpdf parallel to the search folder. like this

If you want to copy all .ppt files you apply this command
mkdir ../allppt;find -name '*.ppt'|while read Filename ; do cp "$Filename" ../allppt/ ; done
I hope you got the logic if you want to search copy all .doc files.
now suppose you want to delete all .pdf files instead of copying then your command will be

find -name '*.pdf'|while read Filename ; do rm "$Filename" ; done

You may not want to delete .pdf files but you may want to delete all .ini files form some virus infection, as i have removed from my pen drive once and latter from a 80 GB harddisk of my friend when it was infected by virus.

If you know shell programming then you can add much more functionality to this little command.

12 August 2007

PIC microcontroler : Day 1

Day 1
So Here our journey is starting.
I assumes that you should have some knowledge of programing , micro-controller and digital electronics and how to turn on a computer. We are going to use PIC mico-controller (these are microchip company product). We will start form very small device. PIC10F2xx series where xx can be 00, 02, 04, 08, 20, 24.
This is a 6 pin IC (in PDIP package 2 pins are not connected)

You must go through the data-sheet of PIC10F200. you can get functionality of pin also in datasheet.
The software tool we are going to use is piklab. you can easily install in Linux by any package manager. In windows you can use MPLAB IDE. ya we will use MPLAB assembler also. see step
  • first you need to write a code in assembly language. We can latter use C language also. I have found a very good tutorial on assembly. 1 . Assembly language 2. MPASM assembler , MPLINK object linker , MPLIB object librarian USER GUIDE
  • you need to convert your asm code to hex file using MPASM or gpasm depending on plateform
  • you need to download you hex code to flash memory of micro-controller (mcu). you need to have a programmer for it and a software to drive it, we will discuss it latter. for the timing I will use software simulator for it.
Before we start programming we need to look inside it. our mcu has some 16/24 Byte data memory and 256/512 flash memory.

have you remembered about registers in processors. well our PIC10F22x has some limited register set. these register are present on data memory.
pattern of data memory or more precisely register file map is given in data sheet page 17. We have two set.
1. special function (named) regiter
2. general purpose register

in special you can see STATUS which hold many status of accumulator and various thing,
you can see GPIO register. whenever you need to put data or read data to GPIO pins (general purpose input out pins), you need to access this register. now in our devide we have only 4 GPIO. GP0, GP1 and GP2 are bidirectional and their direction must be set before using them, GP3 is in input pin only. TRISGPIO is a register which set the direction, We will not jump in to every details of everything. slowly slowly we expand our knowledge by programming exercises also.

in PIC10F200/204 have 9 bit memory address but 512x12 memory is not there for you, you can access first upper 256x12 memory only. simply for now forget about 9th bit.
in PIC10F202/206 have 10 bit memory address but 1024x12 memory is not there for you, you can access first upper 512x12 memory only. simply for now forget about 10th bit.

10 August 2007

PIC microcontroller

Hi Friends,
I am new to micro-controller's world. I am doing a course embedded systems and we have decided to go with small MCU.
In This column i will put a details of everything form the basic and and detailed projects. so keep watching it.

Most probably I will use PIC10F20x series where x can be 0, 2, 4, 6.
related links

19 February 2007

Simple Calculator in TCL/TK

I got this as an assignment in software lab, the code which i am presenting is not a good and highly optimized but the logic which is used is something good and that what i want to share with you,,,
so this is the package that contain readme.pdf and code file named skycal1.1.tcl
but wait, first you need to learn how to run the code
using command line,,,,
$ wish skycal1.1.tcl
so simple....
download the package.
but readme.pdf you can study form here also

Subject : EEP 702 (Software Lab)

Assignment #1 : Simple Calculator ( SkyCal 1.1) using TCL/TK

Author : Narendra Sisodiya 2006EET2473


  1. Its a free Application

  2. Backspace button is supported

  3. +/- button is supproted.

  4. Clear Button for resetting the calculation

  5. Result is carried is next calculation. It means if user presses 12+23 then * 10 then /2 it will give result as 175.

  6. floating point calculation is supported

  7. Event Driven State Model is used. (Author did not copied this architecture from any where, he himself derived this and named it like this). It is a highly Modular and Scalable Architecture. As initial code (named Skycal 1.0 )was not supporting the +/- button and Backspace button. They were added now , without modifying the existing code , only a little code was added with least efforts.

Snapshot :

What is Event Driven State Model:

It is a simple State Model in which a system is triggered from one state to another state using key events. Every event is corresponds to some action. Because of this feature when i wanted to introduce two new button for +/- and BackSpace, I added two new events to each state. One more feature is that the event also has argument here.


Various Events :

  1. Event 1 : num_button click event. if user clicked any of numeric button from 0 to 9 or '.' it has key label as argument

  2. Event 2 : Equal button click event if user ckicked '=' button for calculating the result

  3. Event 3 : Clear Button click event

  4. Event 4 : Operator button click event

  5. Event 5 : +/- button is clicked. it also has key label as argument.

  6. Event 6 : Backspace button is clicked

Varoius States:

  1. State_0 : IDLE : Calulator starts from this state. will remain in this state until any num button is clicked.

  2. State_1 : Taking_Operand1: at this state user is keep entrying the value of operand1. during this if we encounter any operator then we jump to next state2

  3. State_2 : Taking_Operator :at this user may enter many operator. only last entered opearator is considered, if we find any numeric button then it goes to next state for taking the next operand.

  4. State_3 : Taking_operand2 : now at this state user will give second argument to program and if user press '=' button then it evaluate and goes to state_4 : FreeState. if user press any operator then it evaluates the expression and put result in operand1 and goes to state_2

  5. State_4 : Free State : at this state if user press numeric key then it goes to state 1 to take operand 1 if user press operator key then last obtained result is hold by operand2 and program goes to state 3

Varoius Events Handler:

the whole code is operated through events handlers. We have six events so that we are having 6 events handler (simply they are functions called whenever a key is pressed).

Operation :

the operation is very simple. Thers is a globel variable state by which every function can see at what state the system is present. Whenever any key is pressed it envokes a correspondind event hander function. Event handler funcion see what is the state and according to state it performs some actions,

State Diagram :

next figure shows state diagram. Note that this is an old state diagram , that does not include the event those were added later,,,main thing you need to do,,, understand the state diagram and correlate with coding architecture.

download this image

14 February 2007

DMOZ : The Open Directory Project

HI Friends, I found this is a very good site,
site name :

The Open Directory Project is the largest, most comprehensive human-edited directory of the Web.

It is constructed and maintained by a vast, global community of volunteer editors.

whenever you want a number of links on a topic, just go to it and have a number of links related to it,

for example, if you want to know some links about operating system,

see the result of the search.
click on specific topic and you will get a large number of links,, you can add some links also, and become a editor.

28 January 2007

Ultimate Fedora core 6 Help !!!!!!!!!

first install yumex by
then type password then
$yum -y install yumex
whenever you want to install ,, install by yumex,,, GUI mode of yum..........
path is
Application -> System Tools -> Yum Extender

  1. ultimate help for core 6
  2. Official Documentation website
  3. Replace the fives with sixes as appropriate. Fedora Core 6 Linux Installation Notes
  4. Unfficial Fedora FAQ
  5. Fedora Core 6 Tips and Tricks
  6. Mauriat Miranda's Personal Fedora Core 6 Installation Guide
  7. Fedora Forum
  8. Fedora Solved
  9. Other places
I Highly recommend to go 6. then 1. then others..........
Fedora Live CD
SHA1SUM: 8771d21af1974492424438cbe42f1bae0161ea96 FC-6-i386-livecd-1.iso

26 January 2007


Linux :
Creating Static Libraries
we have 4 files with us
  • fun1.c => it store code of “add” and “sub” function.
  • fun2.c => it store code of “mul” and “div” function.
  • header.h => it store prototype of “add” , “sub” ,“mul” ,” div” function
  • user_pro.c =>user program that calls the function.
We have some intermediate files
  • fun1.o object code for fun1.c
  • fun2.o object code for fun2.c
  • mylib_sta.a static library made by combining both object file
  • user_pro.o object code for user_pro.c
we have final executable file user_pro_final
  • user_pro_final binary file ( executable file )
coding of each files
int add (int a , int b){return a+b;}
int sum (int a , int b){return a-b;}
int mul (int a , int b){return a*b;}
float div (int a , int b){return ((float)a)/b;}
int add (int a , int b);
int sub (int a , int b);
int mul (int a , int b);
float div (int a , int b);
int a,b;
printf("Enter a: ");
printf("Enter b: ");
printf("\naddition of a and b is %d: ",add(a,b));
printf("\nsutraction of a and b is %d: ",sub(a,b));
printf("\nmultiplication of a and b is %d: ",mul(a,b));
printf("\ndivide of a and b is %f: ",div(a,b));
return 0;
apply this procedure
$ pwd

step 1 : create object code for all three .c file
$ gcc -c fun1.c fun2.c user_pro.c
$ ls *.o
fun1.o fun2.o user_pro.o
step 2 : create static named mylib_sta.a library from fun1.o and fun2.o
$ ar rcv mylib_sta.a fun1.o fun2.o
a – fun1.o
a – fun2.o
step 3 : create executable file named user_pro_final
$ gcc -o user_pro_final user_pro.o mylib_sta.a
step 4 : execute the user_pro_final
$ ./user_pro_final
Enter a: 45
Enter b: 12
addition of a and b is 57:
subtraction of a and b is 33:
multiplication of a and b is 540:
dividing of a and b is 3.750000:

Creating Shared Libraries
Load time Linking
we will work with some files from previous namely fun1.c fun2.c user_pro.c .
but we will produce mylib_shr.a this time
$ pwd
step 1 : create object code of all .c files
$ cc -Wall -fPIC -c fun1.c fun2.c user_pro.c
$ ls *.o
fun1.o fun2.o user_pro.o
step 2 : create shared library with fun1.o and fun2.o
$ cc -shared fun1.o fun2.o
$ mv a.out
step 3 : linking of shared lib to user code to produce user_pro_final again
$ cc user_pro.o -L. -o user_pro_final
step 4 : laod library path
$ LD_LIBRARY_PATH=/home/student/Narendra/shared
step 5 : run the executable file
$ ./user_pro_final_exe
Enter a: 45
Enter b: 12
addition of a and b is 57:
subtraction of a and b is 33:
multiplication of a and b is 540:
dividing of a and b is 3.750000:

Lazy Linking
we have to modify the code in main program
int main()
void* funptr;
int (*add)(int a,int b);
int (*sub)(int a,int b);
int (*mul)(int a,int b);
float (*div)(int a,int b);
funptr = dlopen("/home/student/Narendra/dyna/", RTLD_LAZY);
if (!funptr)
fprintf(stderr, "Error during dlopen(): %s\n", dlerror());
return 1 ;
add= dlsym(funptr, "add");
sub= dlsym(funptr, "sub");
mul= dlsym(funptr, "mul");
div= dlsym(funptr, "div");
int a,b;
printf("Enter a: ");
printf("Enter b: ");
printf("addition of a and b is %d: ",add(a,b));
printf("\nsubtraction of a and b is %d: ",sub(a,b));
printf("\nmultiplication of a and b is %d: ",mul(a,b));
printf("\ndividing of a and b is %f: ",div(a,b));
return 0;
$ pwd
step 1 : create object code of all .c files
$ cc -Wall -fPIC -c fun1.c fun2.c user_pro.c
$ ls *.o
fun1.o fun2.o user_pro.o
step 2 : create shared library with fun1.o and fun2.o
$ cc -shared fun1.o fun2.o
$ mv a.out
step 3 : create executable file
$ cc user_pro.o -L. -o user_pro_final -ldl
step 4 : run the executable file
$ ./user_pro_final
Enter a: 45
Enter b: 12
addition of a and b is 57:
subtraction of a and b is 33:
multiplication of a and b is 540:
dividing of a and b is 3.750000:
Windows Environment:
In windows we use VC++ to create the dll. The following process have to be
followed to make the dll.
Creating a Win32 dll:
• Open the New Project Wizard.
• Select Win32 Dynamic-Link Library.
• Name the project as dllfun1.
• In the next screen, select "A dll that exports some symbols" radio button.
• Click Finish. The dll project will be created.
• Now open the file dllfun1.cpp. We can see a function definition for
"DLLASSIGN_API int fndllfunl(void)".
• Replace this function with the code of your library function. Like this you can
define any number of functions in that file.
// dllfun1.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "dllfun1.h"
DWORD ul_reason_for_call,
LPVOID lpReserved
switch (ul_reason_for_call)
return TRUE;
DLLFUN1_API int add (int a , int b){return a+b;}
DLLFUN1_API int sub (int a , int b){return a-b;}
// This is the constructor of a class that has been exported.
// see dllfun1.h for the class definition
• Open the dllfun1..h file and insert the declaration
#define DLLFUN1_API __declspec(dllexport)
#define DLLFUN1_API __declspec(dllimport)
// This class is exported from the dllfun1.dll
class DLLFUN1_API CDllfun1 {
// TODO: add your methods here.
DLLFUN1_API int add (int a,int b);
DLLFUN1_API int sub (int a,int b);
• Create a new file named "dllfun1.Def" and add the following code in that file.
; dllfun1.def : Declares the module parameters for the DLL. LIBRARY "dllfun1"
DESCRIPTION 'DemoDll Windows Dynamic Link Library'
; Explicit exports can go here
• Add this dllfun1.def into the project.
• Build the project.The dll will be created.
• Follow the above steps to create another dll file “dllfun2.dll” that contain function
mul and div1 .
• Store both dll files into C:\mydll folder
Using the dll
This part explains only the dynamic loading using loadlibrary. The following sample
code I have used in a new console application which uses the library functions defined in
dllfun1.dll and dllfun2.dll library.
typedef int (*FunPtrTypeInt)(int a,int b);
FunPtrTypeInt add , sub , mul ;
typedef float (*FunPtrTypeFloat)(int a,int b);
FunPtrTypeFloat div1 ;
void main()
hDll = LoadLibrary("C:/mydll/dllfun1.dll");
if(hDll == NULL)
{ cout<<"Error loading dllfun1.dll"<
add = (FunPtrTypeInt)GetProcAddress(hDll,"add");
if(add == NULL)
sub = (FunPtrTypeInt)GetProcAddress(hDll,"sub");
if(sub == NULL)
hDll = LoadLibrary("C:/mydll/dllfun2.dll");
if(hDll == NULL)
cout<<"Error loading dllfun2.dll"<
return ;
mul = (FunPtrTypeInt)GetProcAddress(hDll,"mul");
if(mul == NULL)
div1 = (FunPtrTypeFloat)GetProcAddress(hDll,"div1");
if(div1 == NULL)
int a,b;
cout<<"Enter a:";cin>>a;
cout<<"Enter b:";cin>>b;
cout<<"a + b = "<<
cout<<"a - b = "<<
cout<<"a * b = "<<
cout<<"a / b = "<<
running to this program will show the result
Enter a:
Enter b:
a + b = 53
a - b = 33
a * b = 540
a / b = 3.750000

24 January 2007

3D effects of Fedora-core-6

path is => System | Preference | Desktop Setting
enable the effects,,, i will suggest you to download the Beryl that have very fantastic 3D effect
for that you have to go to => Application | Add Remove | search for Beryl and apply install to get mare effects...............

bookmarks : Best Way To Share Web Resource

Hi Friends
I Love Fedora core 6 (a Linux Operating System) and unbeatable Firefox 2.0 (best internet browser, i dont know why people use Internet Explorer),
In Firefox you can make a bookmark (just like add to favorite in IE), you can save a lot of time of browsing by adding links to bookmarks, you can even group bookmarks into "logical folders" ,
I use to add useful pages to bookmarks and organize them properly so that others get benefited,
in Firefox you can export and import the bookmarks, the feature is : it export all bookmarks as .html file ,,
come to the point now :
i think if we share our bookmarks , it will be best resource as you can easily find out good links and organized way, so My bookmark page is just resealed
click it to see my bookmarks (hope somebody will definitely get benefit)
(i will update it regularly)
now what can you do is : you save this page and go to menu bar of firefox and click
Bookmarks | Organize Bookmarks ...
new window will pop up click
file | import | from file |
and give path of saved file narendra_bookmarks.html and click open
hope i will work properly to your system..........
publish your bookmarks also, Google provides ways to publish your files and pages..
but donot forget to send me a e-mail if publish your bookmark, i will make a mega bookmark page that will contain such bookmarks in very organized way... i need your help to help in case...
so hope we will see that bookmarks library soon so that every related information you will be able to achieve in few minutes.........

contact me :

18 January 2007

UNIX shell programming

hi friends:
currently i am learning UNIX shell programming:
so i would like to give a good links related to it

1 hour Tutorial : This is very good for start up ....
Teach Yourself Shell Programming in 24 Hours : ultimate book for studying... no need to search any other book and online resource,,, first learn it fully ,,,it will take normally 1 month to master..
but you can go to two more resource after 5 to 6 days for programming......
Advanced Bash-Scripting Guide
you will also find many good examples at....Richard's UNIX Shell Scripting Universe

as per my knowledge this is a good resource,,,, if you find a better one plz post comments here....

15 January 2007

Reverse the Linked List

Hi friend
This is a good example of algorithm and it related to data structure please try it and put you results here. we will discuss bad and good thing about your coding skill,

Q. Make a function that reverse the linked list. reversing the linked list means that the last element will becomes first one , again need not to go for fancy coding , you can work on algorithm also (best thing),

I have prepared nice ppt and coding algorithm that will tell how to do it efficiently, I will put but after getting some response to you. please ask queries here. tell friend about community may be he may need this community more than you.

Click here for Solution :

01 January 2007

Scope Rule of for loop in C++

Q. what is the result of this program with and without static?

variable i is defined at two place. So confusion arise as there are two i++, which i is incrementing at both place. Let name them as “frist i++” that is round bracket and “second i++” that is in curly bracket

Now if you see the diagram below then you will be at stage of giving answer.

The above code is equivalent to

Important thing is above diagram is curly brackets {} that tells the scope provided by a for loop. see outside i is initialized with zero, that has scope in main function. Statement i<5>

Now see curly brackets, in that i is defined as static means i will be created and assigned once that is if we some how managed to come again this place by goto statement or by using loop or calling the function again the statement will not execute moreover this will preserve its value also. statements like “second i++” an cout<<i will print value 5

so output will be







if static keyword is omitted then i inside curly bracket will be created again and again whenever loop runs

so the output will be







Q. now based on abode discussion i am modifying the code, don’t see answer now write your result first then and match it with my answer,


see the difference , first field is empty and one more cout is present which has scope in main. so first i++ and cout<

the flowchart will be

so the result will be












readers can easily justify the output without static in this case

hey if you are on orkut why do not you join my "c++ help for all " community