Tuesday 16 February 2010

Google Buzz or Privacy Play

Hi Friends , m back

Recently launched google buzz is having a lot of media cover not for good reasons but all for bad reasons. Is it a new application or is google conquering the privacy controls of individual users. Their experimentation has caused lot of problems for people. They are working on it. But it seems google is taking the privacy of users very lightly.

One wrong step can bring the gaint's popularity to their knees. So the powerful company has to play safe.

Three cheers for google's new innovation called buzz and affections from heart to people who's privacy was leaked without their own fault.

Friday 29 January 2010

Installing Ubuntu Remix

Hi,

M back.
Yesterday i decided to install ubuntu remix. I wanted to test the new operating system. The installation is pretty cool and easy. I think ubuntu is improving at a very fast rate. Now a days when i see ubuntu , I feel peace of mind. If at all you will ask me in my sleep, about what OS i am experimenting with, i would say the word Ubuntu.

You have to just click on next button and the installation will be fine. Only step that can be confusing is when it ask you to install completely on the hard disk or let it install with the other OS. I selected it to be installed with other os. My other os was also Ubuntu. It installed nicely , but when i rebooted the system, the grub loader did not recognised my previous os and displayed some error on the screen, I still have to correct the problem. But i think Ubuntu remix has some flaw in it , as it overwrote my grub and messed with it.

I further booted ubuntu remix. Nice fast boot and very nice interface.



The ubuntu remix is a very mature OS with all the basic functions that you want. But a stripped down version of Ubuntu 9.10.

I checked with it, it used very minimum ram and is very cleverly designed by not including the menu system in it. It detected my all system devices properly. No problem in using wireless lan and also i think it is using less of my laptop's battery.


I am still experimenting with it, more updates after i complete my experiments.

Bye for now.

Friday 22 January 2010

Installing 32 bit Adobe Reader 9 to a 64 bit Ubuntu 9.04

Hi,

M Back again.

I wanted to install the Abode acrobat on my ubuntu 9.04. Checked the site, it had only i386 version of Acrobat in the Deb format. It is really bad on their behalf.

So tried to install the i386 version on to my 64 bit machine and it displayed many errors.

So had to use a proper option with the dpkg command to install the 32 bit version.

dpkg -i --force-architecture AdbeRdr9.2-1_i386linux_enu.deb

And it installed properly.

I do not understand one thing ,linux community wants it to be more fexible than windows, then why differentiate between 32bit and 64bit binaries and create a problem for the users who want to install the 32 bit programs on the 64 bit machine.

They have to find a solution for this. Comman man can not use linux unless such problems are removed or handled properly.

Bye for now, I will be back again some day.

Enabling a Microphone on Ubuntu

i am back again after many days.

i installed ubuntu jaunty on my laptop and was tryin to configure the microphone but it failed to work. so after 2 days of search , i finally meet with a solution.

Carried out following things to enable the microphone settings.

1. Open the “Volume Control” panel.
2. In the “Volume Control” panel: “Edit” → “Preferences”.
3. In the “Volume Control Preferences” panel: tick “Microphone”, “Capture”, and “Capture 1”.
4. Close the “Volume Control Preferences” panel.
5. In the “Volume Control” panel, “Playback” tab: unmute the microphone.
6. In the “Volume Control” panel, “Recording” tab: enable audio recording from capture.

finally i was able to test sucessfuly the skype account. Hope this thing will help u.

Bye for now.

Nice song from Bandh Premache

Hya asha rimzhimi jhirmir paus dhara,
tan man phulaun jati

oo hya rimzhimi jhirmir paus dhara,
tan man phulaun jati

shwaas tuzha madhumass phulacha,
rang sukhacha haati

ha dhund gaar wara, ha kowala shahara
ujalun rang aahe, swachand pritiche

Chimb bhijalele, rup sajalele
barasuni aale rang pritiche.

kon jaage raat sari, antari sukhauni
sapt rangi pakharu he , endradhanu banu aale

laat hi , waadali, mohuni gaate
hi mithi ladaki mogara hote.

padasaad bhawananche, re bandh na kunache
daahi dishat gaane , be dhund pritiche
Chimb bhijalele, rup sajalele,
barasuni aale rang pritiche.

Running a syntax check on /etc/my.cnf

To verify the my.cnf parameter changes

/usr/libexec/mysqld –help –verbose

Finding out versions of java, apache , php and mysql

Hi,

Use the following to find out the version info

java -version
java version “1.6.0_03″
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)

php -v
PHP 4.3.9 (cgi) (built: Apr 17 2009 19:13:06)
Copyright (c) 1997-2004 The PHP Group

mysql -V
mysql Ver 14.7 Distrib 4.1.22, for redhat-linux-gnu (i686) using readline 4.3

httpd -v
Server version: Apache/2.0.52

Hope this will help you to determine the versions of the softwares.


You can visit my second blog : devenix.wordpress.com

Thoughts by Swamy Vivekananda

When I Asked God for Strength
He Gave Me Difficult Situations to Face

When I Asked God for Brain & Brown
He Gave Me Puzzles in Life to Solve

When I Asked God for Happiness
He Showed Me Some Unhappy People

When I Asked God for Wealth
He Showed Me How to Work Hard

When I Asked God for Favors
He Showed Me Opportunities to Work Hard

When I Asked God for Peace
He Showed Me How to Help Others

God Gave Me Nothing I Wanted
He Gave Me Everything I Needed

postfix error RCPT from unknown[some ip address] host rejected

Hi,

Some times we see some messages to be rejected by postfix with erro RCPT from unknown

Solution.
RCPT from
unknown[some ip address]: 550 Client host rejected: cannot find your hostname

if you do

dig -x your ip +short

you will get some hostname as the dig output. (reverse dns)

Reverse DNS of your ip exists and points to some hostname, unfortunately the same host name does not exist in forward dns file. That is the reason why Postfix regards your host as “unknown”.

Don’t use reject_unknown_client in your postfix configuration. It may reject the valid mails also.

This message is looping: it already has my Delivered-To line. (#5.4.6)

DESC:

When I send a message now to a user on my server from an outside account.
I am getting this from qmail.

OBSERVATION:

You are probably forwarding mail to yourself.

SOLUTION:

Check your /var/qmail/control/smtproutes file to make sure you are not
sending mail to a relay which is sending back to you, and also look at
your forwarding files, .qmail, .qmail-default etc.

LWP failed with code[400] message[FTP return code 150]

Hi ,

M back,

while installing the cpan modules for perl , i was getting the above error.

so following below solution worked out for it.

Use the cpan command-line tool. This can also be invoked via the command

perl -MCPAN -e shell

In the shell, type

install

where is something like Time::HiRes or Tk.

If it hangs for ages whilst trying to download files over FTP, or get errors like

LWP failed with code[400] message[FTP return code 150]

then try setting the FTP_PASSIVE environment variable before running cpan:

export FTP_PASSIVE=1

You can visit my second blog : devenix.wordpress.com

5.1.2 – Bad destination host ‘DNS Malformed Query Error looking up domain.com. (MX)

Resolution

Remove the trailing character from the recipient’s email address in the Address Book or in the To field.

example :

if ur sending to abc@example.com , you may be mistakenly using email address as abc@example.com. , a trailing dot can make this error to happen.

error installing amavisd-new clamav on centos 5

Hi friends ,

m back

when trying to install amavisd-new on centos 5 , i was getting following error.

yum install amavisd-new spamassassin clamav clamd unzip bzip2 unrar

there is the message no match argument found.

So i googled few mins as usual and found the solution

Thing to check:

1. Check your /etc/yum.repos.d/
CentOS-Base.repo CentOS-Media.repo

Let say you already have this two repos.
To get the dag repo manually try this:

Use your favorite editor (vi or nano or etc) create rpmforge.repo

1. nano /etc/yum.repos.d/rpmforge.repo
2. Copy the code below and paste it into rpmforge.repo

# Name: RPMforge RPM Repository for Red Hat Enterprise 4 – dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever – RPMforge.net – dag
#baseurl = http://apt.sw.be/redhat/el4/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

3. Type this command

rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

This key will store in this directory /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag.

You may also download the GPG key manual and store it. Then just type “rpm –import RPM-GPG-KEY.dag.txt”

4. Type this command

yum –enablerepo=rpmforge list amavisd-new spamassassin clamav clamd unzip bzip2 unrar

still it gave me following error on centos 5 :

—> Package compat-db.i386 0:4.2.52-5.1 set to be updated
–> Running transaction check
–> Processing Dependency: lha for package: amavisd-new
–> Finished Dependency Resolution
Error: Missing Dependency: lha is needed by package amavisd-new

wget http://dag.wieers.com/rpm/packages/lha/lha-1.14i-19.2.2.el5.rf.i386.rpm

rpm -ivh lha-1.14i-19.2.2.el5.rf.i386.rpm

###############################################################################

yum –enablerepo=rpmforge install amavisd-new spamassassin clamav clamd unzip bzip2 unrar

###############################################################################

So i had a happy ending to my story, hope u liked the story.

Bye and enjoy with linux

tc


You can visit my second blog : devenix.wordpress.com

SquirrelMail and Courier IMAP

Hi ,

I was getting error when dealing with courier imap and squirrelmail .

ERROR : Could not complete request. Query:CREATE "INBOX./Sent" Reason Given: Invalid mailbox name

To correct this for all your users and run ./conf.pl (must be run from config/ in Squirrelmail’s root dir) select option 3 then 1 and enter ‘none’ (without the quotes). Save your changes and exit.

That might fix it, but in the most current version (1.4.0) from the main screen in ./conf.pl choose “D” and then pick your imap server.

If you are still having problems maximize your PHP error reporting by editing php.ini and changing:

display_errors = on
error_reporting = E_ALL

Then restart your web server.

Hope this helps you all.

How to resolve primary virus scanner (auto) error in Mailscanner

You may find you get an error like:

Unable to select a regular expression for your primary virus scanner (auto) – please see the examples in functions.php to create one.

This happens when you are using newer versions of MailScanner and have the auto setting turned on in your MailScanner.conf file. Edit the configuration and set the string for your virus scanner instead of using the auto setting like:

##Virus Scanners = auto
Virus Scanners = clamav

Postsuper commands

Requeue the messages with
“postsuper -r ALL”.

Delete All messages in the queue

“postsuper -d ALL”.

Delete a single message

“postsuper -d message-id”.

How to reset MySQL root password?

If you forgot root password for your MySQL server, you can follow the steps below to reset it.

1. Login to the server as root and stop MySQL service.

# /etc/init.d/mysqld stop

2. Start mysqld_safe service.

# mysqld_safe –skip-grant-tables &

3. Login to MySQL server now. It won’t ask you for a password.

# mysql -u root

4. Set up a new MySQL root user password:

mysql> use mysql;

mysql> update user set password=PASSWORD(”NEW-ROOT-PASSWORD”) where User=’root‘;

mysql> flush privileges;

mysql> quit

5. Restart your MySQL service.

# /etc/init.d/mysqld restart

6. Try to login using new password. It should work fine.

# mysql -u root -p

That’s it !!!


You can visit my second blog : devenix.wordpress.com

Checking disks for errors using the badblocks command

For better or worse I’ve been needing to check drives for errors quite a bit recently and have been using the badblocks command to do it. It’s definitely a command that people should become familiar with. Where fsck checks the file system for problems, badblocks attempts to ascertain the status of physical media which can include hard disks, usb drives, and other usb devices such as media players. I’ve compiled a detailed list of commands I’ve been using.

Read-only Test

This is a non-destructive read-only test which can be run on disk even if it contains a mounted filesystem. It simply verifies that each block can be read; it does not test for write errors.

* sudo badblocks -s -v -c 10240 /dev/sdx
o -s = show progress
o -v = verbose mode
o -c 10240 – check 10K blocks at a time

Read-write Test

This test is non-destructive read-write test which reads each block, writes it, then verifies it. It should not be used on block devices with mounted filesystems as it can lead to filesystem corruption.

* sudo badblocks -n -s -v -c 10240 /dev/sdx
o -n = non-destructive read-write mode
o -s = show progress
o -v = verbose mode
o -c 10240 – check 10K blocks at a time

Write-mode Test

Using this command will erase all data on the device so only use it if that is what you want. This will write a few patterns to each block, verifying that each one is written and read correctly.

* sudo badblocks -w -s -v -c 10240 /dev/sdx
o -w = destructive write-mode test
o -s = show progress
o -v = verbose mode
o -c 10240 – check 10K blocks at a time

Prepare a disk for encryption

The command will completely erase the data on a disk and replace it with random data. This is often a preferred way to prepare a disk for encryption as it is faster than other methods of filling a disk with random data and serves the purpose of checking the disk for errors before the encryption process.

* sudo badblocks -w -t random -s -v -c 10240 /dev/sdx
o -w = destructive write-mode test
o -t random = write random data onto the disk
o -s = show progress
o -v = verbose mode
o -c 10240 – check 10K blocks at a time

A nice article by Swami Vivekananda….

I once had a friend who grew to be very close to me. Once when we were sitting at the edge of a swimming pool, she filled the palm of her hand with some water and held it before me, and said this:

“You see this water carefully contained on my hand? It symbolizes Love.”

This was how I saw it:

As long as you keep your hand caringly open and allow it to remain there, it will always be there. However, if you attempt to close your fingers round it and try to posses it, it will spill through the first cracks it find. This is the greatest mistake that people do when they meet love…they try to posses it, they demand, they expect… and just like the water spilling out of your hand, love will retrieve from you. For love is meant to be free, you cannot change its nature. If there are people you love, allow them to be free beings.

Give and don’t expect.
Advise, but don’t order.
Ask, but never demand.

It might sound simple, but it is a lesson that may take a lifetime to truly practice. It is the secret to true love. To truly practice it, you must sincerely feel no expectations from those who you love, and yet an unconditional caring.” Passing thought… Life is not measured by the number of breaths we take; but by the moments that take our breath away…..

Convert -File System- ext2 to ext3

Hi all,
The tune2fs program can add a journal to an existing ext2 file system without altering the data already on the partition. If the file system is already mounted while it is being transitioned, the journal will be visible as the file .journal in the root directory of the file system. If the file system is not mounted, the journal will be hidden and will not appear in the file system at all.

To convert an ext2 file system to ext3, log in as root and type:

tune2fs -j /dev/xxx

This will create ext3 file system in the partition specified. Once this is over “without any errors” you should change the “file system type” in /etc/fstab and make it ext3. Then do a

mount -a

To check whether its mounted properly and the file system type, do

mount

PostgreSQL error (FATAL: invalid value for parameter “lc_monetary”: “en_US”)

Hi ,

If u get some error like this after installing postgresql

(Note m using a ubuntu Linux )

* Restarting PostgreSQL 8.1 database server * The PostgreSQL server failed to start. Please check the log output:
FATAL: invalid value for parameter “lc_monetary”: “en_US” [fail]
Check which locales u are using.

for a unix system u can check it with this command

root@mail:/home/devenix# locale

Output wat i got is

LANG=en_US.UTF-8
LC_CTYPE=”en_US.UTF-8″
LC_NUMERIC=”en_US.UTF-8″
LC_TIME=”en_US.UTF-8″
LC_COLLATE=”en_US.UTF-8″
LC_MONETARY=”en_US.UTF-8″
LC_MESSAGES=”en_US.UTF-8″
LC_PAPER=”en_US.UTF-8″
LC_NAME=”en_US.UTF-8″
LC_ADDRESS=”en_US.UTF-8″
LC_TELEPHONE=”en_US.UTF-8″
LC_MEASUREMENT=”en_US.UTF-8″
LC_IDENTIFICATION=”en_US.UTF-8″
LC_ALL=

so with this u got wat locale u are using

after that copy the locale and paste in ur postgresql config file at defined locations

File Path: /etc/postgresql/8.1/main/postgresql.conf

change following entries with the locale wat u got

lc_messages = ‘en_US.UTF-8′ # locale for system error message
# strings
lc_monetary = ‘en_US.UTF-8′ # locale for monetary formatting
lc_numeric = ‘en_US.UTF-8′ # locale for number formatting
lc_time = ‘en_US.UTF-8′

and restart postgresql and check .

You can visit my second blog : devenix.wordpress.com

words of Swami Vivekananda

Be a hero. Always say, “I have no fear.” Tell this to everyone — “Have no fear.”. Fear is death, fear is sin, fear is hell, fear is unrighteousness, fear is wrong life. All the negative thoughts and ideas that are in the world have proceeded from this evil spirit of fear.

These words can help you in realizing your potential.

Bye

Howto base64 encode and decode with C and OpenSSL

The first here is how to base64 encode a chunk of memory using OpenSSL.
#include #include
#include
#include
#include
#include char *base64(const unsigned char *input, int length);

int main(int argc, char **argv)
{
char *output = base64(“YOYO!”, sizeof(“YOYO!”));
printf(“Base64: *%s*\n“, output);
free(output);
}

char *base64(const unsigned char *input, int length)
{
BIO *bmem, *b64;
BUF_MEM *bptr;

b64 = BIO_new(BIO_f_base64());
bmem = BIO_new(BIO_s_mem());
b64 = BIO_push(b64, bmem);
BIO_write(b64, input, length);
BIO_flush(b64);
BIO_get_mem_ptr(b64, &bptr);

char *buff = (char *)malloc(bptr->length);
memcpy(buff, bptr->data, bptr->length-1);
buff[bptr->length-1] = 0;

BIO_free_all(b64);

return buff;
}


base64 decode goes here:
#include
#include
#include
#include
#include
#include
char *unbase64(unsigned char *input, int length);int main(int argc, char **argv)
{
char *output = unbase64(“WU9ZTyEA\n“, strlen(“WU9ZTyEA\n“));
printf(“Unbase64: *%s*\n“, output);
free(output);
}

char *unbase64(unsigned char *input, int length)
{
BIO *b64, *bmem;

char *buffer = (char *)malloc(length);
memset(buffer, 0, length);

b64 = BIO_new(BIO_f_base64());
bmem = BIO_new_mem_buf(input, length);
bmem = BIO_push(b64, bmem);

BIO_read(bmem, buffer, length);

BIO_free_all(bmem);

return buffer;
}

You can visit my second blog : devenix.wordpress.com

Enable GTALK from Gaim in Linux

Gaim is what you probably use if you use Linux and want to connect to Yahoo or MSN. Lately google talk has been steadily becoming popular among people. Not many know that you can use Gaim to connect to the google talk servers and chat with your gtalk friends! Here’s how you go about it -

1.Click Accounts > Add (At the main login screen)
2.From the protocol dropdown select Jabber
3.Your screen name will be your gmail address except @gmail.com Example: If your address is abc@gmail.com then your screen name will be abc
4.Change the server from jabber.org to gmail.com
5.Password will be the same password that you use for Gmail
6.Click show more options
7.“Use TLS is available” should be checked
8.The connect server should be “talk.gmail.com”

You can visit my second blog : devenix.wordpress.com

moving your filesystem to a new hard drive

Hi,

M back again after many days , i was facing a problem of moving my working partition to other HDD. Searched a lot (of course on Google) and found a very nice solution.

U just require two commands under your belt to make it possible.

Copying the / filesystem is as follows (assuming for the example the new drive is mounted at /media/temp):

find / -xdev -print0 | cpio -pa0V /media/temp

When you run this command, it will recursively copy everything on the / filesystem, without crossing over into other mounted partitions. It will properly handle any special files, and it will completely preserve permissions.

You simply would mount each of the new partition you want to copy onto and repeat this above operation for each of those. Upon execution, you will see a series of dots fly across the screen. Each dot represents a file that is being copied.

Bye For Now.

You can visit my second blog : devenix.wordpress.com

windows vista backuppc and samba problem

Hi,

m back with one more issue.

if u have windows vista as one of your client machines and you want to back up it using Backuppc software. U may get some problems. As Windows Vista does not work with all versions of smbclient.

So if check ur smbclient and samba-common version installed in ur computer. if they are less that 3.0.25 , then u can get problems with acessing ur vista shared drive.

Some errors like session setup failed: NT_STATUS_LOGON_FAILURE can be encountered.

Fiirst check if u can access the vista share using following command.

smbclient //ip-of-the-machine/shared-partition -U vista-user-name

if u can access the vista share , u are very lucky. if not upgrade to newer samba-common and smbclient packages as i mentioned earlier.

Second imp thing to do is:

from http://forums.windowsvistamagazine.com/forums/2111/ShowThread.aspx

To get Vista to work with Samba follow the simple instructions below:

Run secpol.msc

Go to: Local Policies > Security Options

Find “Network Security: LAN Manager authentication level”

Change Setting from “Send NTLMv2 response only”
to
“Send LM & NTLM – use NTLMv2 session security if negotiated”

Not a lot of use in my case as I have Vista Home Premium that does not have secpol.msc which is only found in Business an Ultimate. A little more looking revealed:

If you’re running a version of Vista that cannot use secpol.msc, you can edit the registry instead. Just change the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\LMCompatibilityLevel from a 3 to a 1.

Then I started thinking (dangerous thing probably triggered by an aversion to registry edits) if Vista wants you to use NTLMv2, it is probably because LAN manager is inherently less secure than NTLMv2. Therefore would it not be better to enable this in Samba that is supposed to support it in version 3?

now if u can smbclient to that vista machine without any problems then u can easily use backuppc with any vista share.

some problems that i faced when setting up a mail server

Hi all,

While setting up a mail server, i had faced some problem while trying to make it run properly.

Hope if u encounter such errors, this thing might help u all.

All the errors started , when i installed amavis and configured it.

Error 1

file master.cf

amavis unix – - – - 2 smtp
-o smtp_data_done_timeout=1200

Error message in the log file:

bad transport type: smtp_data_done_timeout=1200

Solution: note that you need leading whitespace before the -o directives.

so do not forget to give a white space.

Error 2

When starting amavis , you may get this error.

/etc/init.d/amavis start
Starting amavisd: The value of variable $myhostname is “aganith”, but should have been a fully qualified domain name; perhaps uname(3) did not provide such.
You must explicitly assign a FQDN of this host to variable $myhostname
in amavisd.conf, or fix what uname(3) provides as a host’s network name!
(failed).

Solution: Just include $myhostname=’mail.yourdomain.com’; in the 50-user file within the amavis directory. Remember to include a FQDN.

Note: I am using ubuntu as my server OS. Dono where to add this line in RedHat based versions.

Error 3:

connect to 127.0.0.1[127.0.0.1]: Connection refused (port 10024)

and

TROUBLE in pre_loop_hook: db_home directory is not writable: /var/lib/amavis/db at /usr/sbin/amavisd-new line 6451

Solution:

For this , i just changed the permission for the db directory

chown -R virtual:virtual /var/lib/amavis/db

This command solved both of my problems.

Just restart amavis, clamv(dono if required, i did it) and finally postfix .

and enjoy using the mail server.

Increasing squirrelmail maximum attachment size

Hi,

Its is very natural that users may some day wana upload files that are bigger in size than squirrelmail’s default 2 MB limit.

so to increase the limit of upload , just do the following things.

1. Locate your php.ini.
2. open file is some editor.
3. Search for upload_max_filesize.
4. Change 2M to something else, for example 5M.
5. If the upload_max_filesize is larger than post_max_size, you must increase post_max_size so that it’s bigger than upload_max_size
6. If the value of post_max_size is larger than memory_limit, you must increase memory_limit so that it’s larger than post_max_size.
7. Save your changes to the file.
8. Restart your apache web server.

and enjoy using squirrelmail.

You can visit my second blog : devenix.wordpress.com

ldap user account update using a shell script

hi,

It is very easy to update ldap entry using a shell script.

function update_user_ldif {
user_name=$1

cat > $UPDATE_USER <<- TEMPLATE_LDIF
dn: uid=$user_name,ou=users,dc=aganith,dc=com
changetype: modify
replace: employeeType
employeeType: $emp_type

TEMPLATE_LDIF
}
ldapmodify -h $LDAP_HOST -w $LDAP_ROOT_PASSWD -D $ROOT_BIND_DN -x -f $UPDATE_USER

* LDAP_HOST :- ldap server ip
* LDAP_ROOT_PASSWD :- ldap access password
* ROOT_BIND_DN :- account used for admin access. eg: cn=admin,dc=aganith,dc=com

Mysql and C API

//Just a simple example to show that we can work with mysql using c language

// Happy programming
#include
#include
#include

static char *opt_host_name = “yourip”; //eg 192.168.0.254
static char *opt_user_name = “userdatabase”;
static char *opt_password = “userpassword”;
static unsigned int opt_port_num = 3306;
static char *opt_socket_name = NULL;
static char * opt_db_name = “dbname”;
static unsigned int opt_flags = 0;

static MYSQL *conn;

int main(int argc, char *argv[])
{
conn = mysql_init(NULL);

if(conn == NULL)
{
fprintf(stderr,”mysql init() failed\n”);
exit(1);
}

if(mysql_real_connect(conn,opt_host_name,opt_user_name,opt_password,

opt_db_name,opt_port_num,opt_socket_name,opt_flags) == NULL)
{
fprintf(stderr,”mysql_real_connect() failed\n”);
mysql_close(conn);
exit(1);

}
else
{
printf(“connected to mysql server on:%s\t”,opt_host_name);
}

mysql_close(conn);
return 0;
}