Sunday, August 5, 2007

perl: warning: Setting locale failed.

I was getting this error

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en_GB:en",
LC_ALL = (unset),
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").


and I did not know what to do.
Yahoo'd and found this link "http://www.linuxquestions.org/questions/showthread.php?t=574006"

needed to create this file "/etc/environment" in my debian etch. I do not know, why this file was not present. I had just bootstrapped and installed debian as dom1 in my xen installation.

within the file you needed this

LANGUAGE = en_US
LC_ALL = en_US
LANG = en_US
LC_TYPE = en_US


Note : besides, I tried to have this dpkg-reconfigure locale.. which ran but still gave the errors. dpkg-reconfigure localeconf, said I did not have the package, when trying to isntall, it said this package does not exist.

So still do not know the details, but I am rid of the issue..

Wednesday, July 25, 2007

Working with ZOOP (Installing and configuring and a simple Hello World

Zoop Installation

1) Download the Zoop Library and unzip into the PHP folder
2) Download the Zoop Pear Library and unzip into the PHP/zoop-ver/ folder
3) Edit the php.ini file..
session.save_path = "E:\tmp"
include_path=".;E:\Program Files\PHP\pear;E:\Program Files\PHP\zoop-1.3b1;E:\Program Files\PHP\zoop-1.3b1\lib\pear"

4) Download the zoop-skeleton and copy it inside you htdocs web (root) folder.

Configuring the Zoop

1)

Friday, July 20, 2007

This Insert comes in Handy..

In Gentoo, the my.cnf, has a default setting of binding the local interface to 127.0.0.1, hence from outside we are unable to connect to the server at port 3306.

Always remember, that before we check all the permissions inside the mysql db, we should check the connection from outside ie. 'telnet romote-address 3306' If this connects and still you get error in connection, then there is an authentication problem..

Check the host table..
if not insert this..
insert into host (Host,Db,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Create_tmp_table_priv,Lock_tables_priv) values ('%','db_name','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

% denotes all hosts.. You can mention an IP address to restrict connection from a certain IP address.


PEAR Installation on Windows..

Firstly get PHP installed on your machine.
next go to http://pear.php.net/go-pear, save this page as go-pear.php.

Assuming your PHP was installed nicely, and you had selected to configure the Env Variables, while Installing PHP, go to command prompt.. ie 'cmd'.
F:>php go-pear.php

Progress herewith by selecting the exact path of your PHP installation and continue henceforth.

How To Install Struts4PHP

Now, that Pear installed do the following things..

1) F:>pear channel-discover pear.struts4php.org
2) F:>pear install struts4php/struts4php
Although the above #2 command did not work on my machine..
I had to force install, it said some comflict with lang package ..
2) F:>pear --force install struts4php/struts4php

Thats all..

Now unto understanding the struts4php...

Friday, June 29, 2007

You never know

You Never know
how And When
The Existence Will Start
Using You For Its Purpose

You Never Know
How And When
You Will Be Filled With
Abundance
And You Will Start Raining
Quenching The Thirst of Many

You Never Know
How And When
You Will Be Full Of
Fruits And Shade
And Travelers Will Take
Shelter And Food From You



You Never Know
How And When
You Will Be Full With
Love And Light
And You Will Start Spreading
The Fragrance of Beauty To Everyone


You Never Know
How And When
The Death Will Come
And Make You Deathless
And Life Will Start
Flowing Out Of You
You Never Know
How & When....Really !


~Sri Sri

Drupal mysql database creation and assigning priviledges

Archived herein so that I can refer to this, whicle createg databases and assigning privileges.

First, you must create a new database for your Drupal site (here, 'databasename' is the name of the new database):

mysqladmin -u username -p create databasename

MySQL will prompt for the 'username' database password and then create the initial database files. Next you must login and set the access database rights:

mysql -u username -p

Again, you will be asked for the 'username' database password. At the MySQL prompt, enter following command:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';

where

'databasename' is the name of your database 'username' is the username of your MySQL account 'password' is the password required for that username

Note: Unless your database user has all of the privileges listed above, you will not be able to run Drupal.

If successful, MySQL will reply with:

Query OK, 0 rows affected

To activate the new permissions, enter the following command:

FLUSH PRIVILEGES;

Tuesday, June 26, 2007

I do not believe in God

Archived, here, since its just so beautiful, copied from the author's discussion at orkut here, his profile is here..
I went to a barbershop to have his hair cut .

As the barber began to work, I began to have a good conversation.
We talked about so many things and various subjects. When we
eventually touched on the subject of God, the barber said:

"I don't believe that God exists."

"Why do you say that?" I asked .

Barber :

"Well, you just have to go out in the street to realize that God doesn't exist. Tell me, if God
exists, would there be so many sick people?

Would there be abandoned children?

If God existed, there would be neither suffering nor pain.

I can't imagine a loving God who would allow all of these things."

I thought for a moment, but didn't respond because I
didn't want to start an argument.

The barber finished his job and I left the shop.

Just after I left the barbershop, I saw a man in the street with
long, stringy, dirty hair and an untrimmed beard. He looked dirty and
unkempt.

I turned back and entered the barber shop again and said
to the barber: "You know what? Barbers do not exist."

"How can you say that?" asked the surprised barber.

"I am here, and I am a barber. And I just worked on you!"

"No!" I exclaimed. "Barbers don't exist because
if they did, there would be no people with dirty long hair
and untrimmed beards, like that man outside."

"Ah, but barbers DO exist! That's what happens when people do not come
to me."

"Exactly!" I affirmed . "That's the point! God, too, DOES
exist! That's what happens when people do not go to Him and don't look
to Him for help. That's! why there's so much pain and suffering in the
world."


The meaning to look to GOD is not to go to the temple or just rituals. Surrender yourself to GOD, kill your ego completely.
God is within U !


In Service with love
Ritesh Sharma

Monday, June 25, 2007

Tata Indicom are Fraudsters

After reading the full blog (here and here), I can only feel sorry that I opted for Tata indicom prepaid. My experience is as bad as any of you, when after using the phone for 2 months it died.

I brought it at the Tata true value (fraudsters) shop, and they told me, that I should take it to the Haier service station some 25 Kms away. I bowed to there insists and went there. They took my mobile away for repair asking me to come after 1 week. so long I am having to bear with no mobile. So after 1 week, like a donkey I go, and they give me a replacement certificate, and ask me to collect the new phone from tata true value (fraudsters) shop.

Like a donkey I go to there showroom, sit there for 1 hr for my turn to come. and then the kid, smartly dressed in jeans and yellow t-shirt, bull shits me, that all such replacements happen at nodal office, Ultadanga. which is another 25 Km from there.

After, requesting and feeling like a donkey, I again endure the long journey, to nodal office, and I meet, with Rikta Roy (033-65551181), and she informs me of the way a replacement is made. it goes like this...

"Once you get the Replacement Certificate you have two ways, either, you can deposit the handset at the True Value (fradusters) shop, and after a week you can get a refund, or, you can ask for a replacement, and if they have the same handset available, then they will replace you after 1 week."

I asked, what if they do not have the handset in stock,
she replied, " Then after a week, you can get another headset, provided you are willing to pay the difference."

And she added " We at nodal office, do not replace the thing, you go to the true value (fraudsters shop, and tell them this is the process."

amazed, I was at my wits end of controlling the bhadrolok (gentleman) dying to kill her. anyway, I came back to the true value (fraudsters) office, and told them the process, and they asked me to come next day and it will be solved.

I went back happy, think at last tomorrow will be the day. The next day, my company sent me off to Coimbatore, and I came back 6 days later. yet I remembered the meeting and went ASAP. The lady kept me waiting. then finaly when my turnm came, she asked me to wait, as she was calling the godown people. wait wait wait all she said and 3 hrs passed. I started fuming, and she told me to come after 4 days, that is the time it will take for the headset to come from the godown. I got angry shouted at my lungs limit, and it fell on deaf years and the kids just made a dissapearing act.

so, I went through another 2 of such torments and finally recieved the money of the headset after exactly 37 days.
Now, I will never ever take an Indicom Connection.

Also, I will tell, you, however, cheap the tataindicom may seem to you, stay away from it. They are fraudsters. They supply the worst handsets on earth.

Incase any of you are planning to sue the company, count me in. I can give you good length of materials.

regards

Monday, June 4, 2007

My Guide To LVM

This is the Logical Volume manager, by default there on Redhat. A nifty tool from redhat, which scores over every other storage system. just because you will run out of space some day.

Firstly..
1) use fdisk to create the partitions. Change the Type to hex 8e (0x8e), on the fdisk (prompt) you need to say '8e' only, when changing type. Remember your partitions ie. /dev/hda1 /dev/hda2 etc..

2) use the pvcreate command to initialize the physical volume.
#>pvcreate /dev/hda1
similarly more if you have more partitions.

3) Create a Volume Group, if you want a knew mount point with the new space. or you can also extend an existing Volume Group. First how we create a new VolumeGroup..
#>vgcreate MyVolGroup01 /dev/hda1 /dev/hda2 ...
The command takes basically two parts, the first one has to be the new name of the Volume Group and the second has to be the Physical Volume which we have already created in step 1.

Now, How to extend to an existing VolumeGroup
#>vgextend VolGroup00 /dev/hdb1 /dev/hdb2 /dev/hdc1
which means the existing Volume Group called VolGroup00 will now encompass the Physical Volumes hdb1, hdb2 and hdc1.

4) Create the Logical Volume (this step is the final step, which creates the Logical Volume)
We can also extend a Logical Volume, we will be covering that next.
First before we create a Logical Volume, we should check the Total PE (Physical Extent available in the Volume Group)
#>vgdisplay MyVolGroup01
Note the PE amounts mentioned in 'Total PE' and 'Free PE'.
Now we can create the Logical Volume..
There are two ways.. we can also spell the Max Space in GB or we can also spell the Max PE's wanted.
A) Max PE.
#>lvcreate -l 340 MyVolGroup01 -n usrlv
this will create the device /dev/MyVolGroup01/usrlv block which will have the MAX 340 PE's (eaCH PE is nearly 4KB).
B) Max Space in GB
#>lvcreate -L 1.3GB MyVolGroup01 -n usrlv
this will create the device /dev/MyVolGroup01/usrlv block which will have the MAX 1.3 GB of Space.
Note: Allocating More space than possible will naturally shoot an error. so you can check what is feasible. Refer to vgdisplay command to know what space is available within a Volume Group.

Now How can we Extend an existing Logical Volume.. ? remember, You can only extend a Logical Volume, if its Volume Group has Free PE's left. ie, say usrlv is a Logical Volume for MyVolGroup01, as laid in step4 and we need to resize the Logical volume for it. We can only do that provided there is 'free PE's left in the Volume Group 'MyVolGroup01'. IF there is no space left, you can create the Physical Volumes as said in step 1 and extend it to the Volume Group, and then do the extend.. as mentioned hereafter.
#>lvextend -l 979 /dev/MyVolGroup01/usrlv (will extend the usrlv to 979 PE's which are free )
or
#>lvextend -L 2.5GN /dev/MyVolGroup01/usrlv

5)resize the restructuring of the Logical Volume, if you have done an extending. Or create the file system on the Logical Volume if its a newly created LV.
#>mkfs.ext3 /dev/MyVolGroup01/usrlv
or resize, while the FS is mounted via 'ext2online'
#>ext2online /dev/MyVolGroup01/usrlv
or unmount the LV. and then resize it via
#>resize2fs /dev/MyVolGroup01/usrlv

Hope this helps.. also I will check back when I need to..

Monday, April 30, 2007

The Geek World

Recovering from overwork. I sometimes have character shift, and feel myself an undefined geek, trying to prove undefined geek-ness. Whatever, I am over that. Mind plays on to make me believe, things which I am not. Its sometimes ok to probably think. But yes, it would have definitely been great, to be a true geek.

Sunday, April 29, 2007

Busy

For some time, I have not posted, because I have been extremely busy.
But my mind had been working..
and here are some of the thoughts which has remained through...
1) feeling of death
2) Drugs abuse
3) relationships
4) finance
5) Exams..

Wednesday, April 4, 2007

copied from here
Okay, this is what I do. I only know the basic. But before doing this, please backup your source code, patch wrongly will screwup your source code.

First, how to create patch file?
Patch file is a readable file that created by diff with -c (context output format). It doesn’t matter and if you wanna know more, man diff. To patch the entire folder of source codes(as usually people do)I do as bellow:

Assume Original source code at folder Tb01, and latest source code at folder Tb02. And there have multiple sub directories at Tb01 and Tb02 too.

diff -crB Tb01 Tb02 > Tb02.patch

-c context, -r recursive (multiple levels dir), -B is to ignore Blank Lines.
I put -B because blank lines is really useless for patching, sometimes I need to manually read the patch file to track the changes, without -B is really headache.

How to patch?
First of all, please do a dry-run before really patch it. Bare in mind, patch will be working very specifically. Let say the version 3 Tb03.patch is use to patch from Tb02, if you apply patch on Tb01, sometimes it will corrupt your source code. So, to make sure it works, do a dry run. Dry-run means a fake-test, do it at the directory of the source code targeted to patch.

Doing dry-run like this:

patch --dry-run -p1 -i Tb02.patch

The success output looks like this:

patching file TbApi.cpp
patching file TbApi.h
patching file TbCard.cpp
...

The failure ouptut looks like this:

patching file TbCard.cpp
Hunk #2 FAILED at 585.
1 out of 2 hunks FAILED -- saving rejects to file TbCard.cpp.rej
patching file TbCard.h
Hunk #1 FAILED at 57.
Hunk #2 FAILED at 77.
Hunk #3 succeeded at 83 with fuzz 1 (offset -21 lines).
....

At last, if the dry-run is giving good result, do this and enjoy the compilation.

patch -p1 -i Tb02.patch

Monday, April 2, 2007

Namesake

Nice movie. After a very long time a simple movie. No Masala. It tasted splendid. Irfan and Taboo's acting was marvelous.

Sunday, March 25, 2007

Lend a helping hand

why should I help him ?

because that would bring in a change in this world. Please help others in whatever ways possible.

Friday, March 23, 2007

KB has left QCD

Well it is sad, but, a long time friend and colleague Kaushik, has left QCD and joined DCPL. I wish him well..

Wednesday, March 21, 2007

remove spaces and comments (archival purpose)

cat /etc/squid/squid.conf | perl -e 'foreach (<>) {if (!/^[#\s+]/) {print;}}' > squid.conf

Thursday, February 8, 2007

How to Download/Upload File Through a FTP Proxy Server With 'curl'

This help is for linux machines behind a FTP proxy.. (Note: Squid is not a true FTP Proxy server)

Say the proxy server is squid configured to be running on ' 192.168.0.10' Port '3128'
then some of the things we can do..

* List Files On FTP Server

curl --proxy 192.168.0.10:3128 ftp://qcd:onevision@sharethespace.com:21

* Download a file

curl -o STSServerInstaller.exe --proxy 192.168.0.10:3128 ftp://qcd:onevision@sharethespace.com:21/STSServerInstaller.exe

* Upload multiple files to the ftp server..

curl --upload-file "{rarlinux-3.6.0.tar.gz,vmlogo.xpm}" --verbose --proxy 192.168.0.10:3128 ftp://qcd:onevision@sharethespace.com:21

Note: We are uploading two files ie. rarlinux-3.6.0.tar.gz and vmlogo.xpm, similarly we can state more files, with a comma seperated list.

* We can also give the username/ password in options which is much safer than using it on the URL.

curl --upload-file "{rarlinux-3.6.0.tar.gz ,vmlogo.xpm}" --verbose --proxy 192.168.0.10:3128 -u qcd:onevision ftp://sharethespace.com:21
curl -o STSServerInstaller.exe --proxy 192.168.0.10:3128 -u qcd:onevision ftp://sharethespace.com:21/STSServerInstaller.exe
curl --proxy 192.168.0.10:3128 qcd:onevision ftp://sharethespace.com:21/path/to/file


CURL is a free GPL'ed Utility available on various platforms. in linux it comes by default.. in case its not there, please visit http://curl.haxx.se/download.html and download the version required for your platform. Windows Binary download is here

Note: The normal FTP client (Shell or ftp on dos prompt) does not work with ftp proxy servers.

Thursday, January 25, 2007

Delete files by size recursively

Delete files by size recursively

find /var/spool/squid/* -size +10k -type f -exec rm -f '{}' \;

The command meaning..
find
args1 =
args2 =
args3 =
args4 =
args5 = <-f means files.. we could have mentioned -d (directory) -b (block), -c (character), -f (regular file), -l (link), -s (socket), -p (pipes) >
args6 = <-exec means what action to perform if all the matches are true, so -exec is for action..>
args7..10 = <>

Cheers...
( Besides the above is for my own bad memory :-) )

Delete files by size recursively

Delete files by size recursively

find /var/spool/squid/* -size +10k -type f -exec rm -f '{}' \;

The command meaning..
find
args1 =
args2 =
args3 =
args4 =
args5 = <-f means files.. we could have mentioned -d (directory) -b (block), -c (character), -f (regular file), -l (link), -s (socket), -p (pipes) >
args6 = <-exec means what action to perform if all the matches are true, so -exec is for action..>
args7..10 = <>

Cheers...
( Besides the above is for my own bad memory :-) )

Monday, January 22, 2007

Are we being caught up in the web of google's sinister design ?

Some of you like myself swear by google, since we cannot imagine living without google search. However some of the discussions on net has made me thinking over an important issue. Will Google control too much of our lives ?

here are the links which discusses an important point on google's future plans ...
Let me add, google has already hired top brains for its (secret project), headed by Robert Pike. It could be soon, the era of booting into a internet harddisk. Otherwise, why is google investing so much into bandwidth ?

There is enough material, above to make the next sci-fi movie, where google controls everything.

I would be glad to hear your inputs..

Note: Irony, that I have to use the google's service to post this.. he he..

Books will Live

I have been reading books and codes... but I understand better with a book in leisure in the corner of my bed relaxing with a cup of coffee, cigarette. I dont think online reading is optimum.

Yes, Its so much helpful to get the thing done (my belief), however for grasping a new language, or learning something cool really takes, an undivided attention, which comes when you are at ease, with yourself and a book. Net study is good if I could perhaps practice a little bit more of self restraint. There are numerous times, that I get swayed from one topic to another, and never really understanding where I started.

Well.. Books will live..

Saturday, January 20, 2007

JOOST TV synonymn for P2P TV (internet TV viewing will never be the same again)

I hope this is a surprise new technology springing from peer 2 peer architecture. Well so many P2P applications on the block that there is so much to talk about them, some of them are extremely well written code, traversing firewall and NAT wink.gif. Yes!

Joost is another of such P2P technology, which aims at providing multimedia content. Its designed to traverse NAT and use UDP, it aims to become very fast and very good quality. If this is a company, you can bet its share prices will rise, and look out for google or yahoo to grab it soon. This is the next Kaaza that the firewall engineers will dread. Since its so difficult to block the UDP NAT traversal mechanism they deploy.

There is a beta evaluation version available.. and I would suggest you to go and have a look at it.. the site is www.joost.org.

some news 1 and 2.

I am too excited after I saw the performance. it has limitless possibilities in the future. just think if its available on the mobile, and you could podcast it into joost TV. [ rolleyes.gif ] I cant think what happens to all the TV soap opera's.

I have a great internal feeling that this concept is going to rock the world.. remember it was me telling you smile.gif

Its not open source so.. there can be an open source alternative initiated right now :)
yes I am a coder, and I am interested, if you too are you can m a i l m e a t saneax AT p2pconnect DOT astahost DOT com

Friday, January 19, 2007

Why Was Mahatma Gandhi Never Awarded the Nobel Prize

read this

It bleeds when it shows of discrimination. Whatever reasons may be given, I don't think any awards are fair enough to judge even a single person. How callous the way the world moves ?

Its funny. who gives nobel prize to whom ? and history stands there. Funny 1948.
damn funny.

There are words indescribable to show the feeling I have for this prize, and the people and there culture. Good for me, its a another one of those lessons, that you cannot measure God, and you cannot measure even his servant. Mahatma Gandhi as a human being was far above my intellectual understanding, However I am a damn person, who comments about anything (after all who cares about what I say), so I say.

Even an ordinary beggar has a story. even an ordinary person fights for right and wrong. That is history when the person the age goes. What One should keep in mind, given the situation one is given we will fare much worse than the person. We judge a person superficially, what he says, what he wears, where he comes from, which country he is from... so on.. but we forget.. we will be history, he will be history... God is All_the_story.

May Shree Lord Hari Bless Us All.. (hari means one who steals, since God is also referred as a thief, since he steals our miseries. :) yes. what does a thief do, he carefully enters through the back door when you are fast asleep, and takes away stuff from you home. You wake up to find your valuables are gone, you scream, you scorn at the thief etc. etc... but the things are stolen. Similarly Lord Hari, enters our heart and mysteriously, steals away our hidden valuables, which are rubbish litter to the path of Self Realization. Let us pray, that, That Sweat Lord Hari may please, mercifully bless us)

Thursday, January 18, 2007

Psychology :)

One who lends his shoulders, needs the most.

I thought that out..( from a feeling, which I could'nt understand )

Big Brother role playing people, sometimes cry too badly, is it Alcohol, or from loneliness.
its a lonely planet after all...

Tuesday, January 16, 2007

squid + squidguard + dansguard (Total Filtering from Unwanted sites)

Here I wish to put in the knowhow that I acquired from building in a stong firewall, with URL and Content filtering on Suse 10.1, with the help of Squid, SquidGuard and Dansguard.

Sunday, January 7, 2007

Another really funny dream

I just watched a hilarious dream in fact 2 of them.. one day before yesterday and one yesterday night.
Let me start with the one I saw first, and I just cant believe it was such an interesting and funny one.

I am in this weird house, I have a gun and I am hiding from someone. I load the gun, and I am making sure, that my fingers are on the trigger, and wishing the gun works... I am hiding on a staircase in one corner, with no roof. Suddenly, I get a feeling that someone is looking down from the roof edge.. I see no one, but a fear grips me, that someone may find out where I am hiding if he just peeks down from the roof. I dash out of my hiding to find a better one, and lo, I am in front of three policemen, and in my excitement I pull the trigger, it goes straight and hits a police in his heart.

Looking at there guns pointed at me, ready to shoot, I shiver, and happily shout out, "I surrender, please dont shoot". The bring out the handcuffs and put it around my wrist. I notice, without there attention, (since, in background some confusion was there, I guess they were under fire, someone else was shooting, its faintly vivid) that the handcuffs dont fit my hand, my hands are much smaller in dimension, and it can easily squeez out (anyway I have the thinnest wrists you can imagine).

In the milee of gun shots and the policemen being bewildered, I release myself from the handcuff and start running as hard I can. between, I may have forgotten, the police wear white uniform, which is the west bengal state police uniform, and the policement looked bengali too. Anyway, I am running, and the policeman start to run after me, but hed for shelter, since someone is shooting. No Harm, I run and I see, I am running in a station platform no.12. Its some wierd station, but I know where I can get out easily avoiding the ticket checkers and also the policemen. So I run heard and reach that place, its an opening on the wall..

I jump out, head across the street, there are buses, rickshaw, and a tramline in between.. I approach a cab, and tell him to drive fast. He asks " where ", I say straight out of Calcutta. he drives and its a long journey, I check my pocket and I have some money. I remember that I can use the ATM, I have some 4000 Rs there.

I reach a desolate place, I ask the driver to stop. he stops, I pay him the money.

Wednesday, January 3, 2007

Work ahead

Another lovely winter day in Kolkata. Winters are just wonderfull. I have heard of stories that the winter here is like summer in london. Whatever.. I guess london has a better climate.. nothing like in Kolkata now.

So a lot of work ahead.. extremely busy day ahead..

Tuesday, January 2, 2007

Stepped into a new year 2007

Welcome 2007

After frenzied drinking, competitions and totaly insane parties, back to square one.. working and toiling hard to get to somewhere. 2007 has come. Similarly 2006 had come and its gone. cannot catch up with time, it makes you wait before it comes and makes you remember when its gone. somehow.. it's too fascinating.

List directories via 'ls -d' - surprised me

List directories via 'ls -d' - surprised me This was one of those feelings where I was left surprised with the humble linux comm...