Making Flash Player Plugin work with Firefox in Ubuntu 7.10

January 2, 2008

Erased previous installation and installed Ubuntu 7.10 afresh. When I tried to check the blog stats in wordpress.com, which uses Flash for the chart, it gave me a missing plugin error. It also showed me a little pop up to install the plugin, but unfortunately it did not work. So I decided to try the alternative Gnash plugin, but it too didn’t seem to work.

A bit of googling took me to some Ubuntu Help Forum post where it was advised to get the Flash Player from the Adobe site and install it. This involves downloading the tar.gz file, extracting it out and running the flashplayer-installation script which installs the player. But this is to be done in the command line, followed by answering some simple questions. It asks to specify where the mozilla plugin directory is, which is /usr/lib/mozilla (and the plugin directory within), but this step kept failing.

This is where the hacker jumped out of me and made me to look into the source code of flashplayer-installation script to find out where it was going wrong and what I rather need to do to install. This script is accompanied by the actual plugin file `libflashplayer.so`. The scripts just performs some checks and copies this file to the mozilla plugin folder with a permission 755 for root:root. Then it checks for the existence of an environment variable `MOZ_PLUGIN_PATH pointing to the plugin directory for Firefox to detect the plugin.

This is the manual step to install the Flash Player plugin for Mozilla Firefox in Ubuntu 7.10

  1. tar xvzf install_flash_player_9_linux.tar.gz
  2. cd install_flash_player_9_linux
  3. sudo cp libflashplayer.so /usr/lib/mozilla/plugins
  4. sudo chmod 755 libflashplayer.so
  5. vi ~/.bashrc and add `export MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins` (i.e. the command within the “)
  6. Run Firefox (all opened Firefox windows should be closed before doing this installation)Adobe site

Thus, we have added the export command to .bashrc of the user so whenever he logs in, the environmental variable gets set and thus his Firefox can detect the Flash player plugin.

When things like installation script fails do not give up. A true geek looks into the script and does what the installer does. This is what that is awesome about GNU/Linux and FOSS, even when one door is locked there is surely another door which can be opened. What needs is an effort to search for the door and try opening it :)

Update: Trying to file a bug lead me to the solution. The md5sum mismatch has been fixed in the package, but uploaded into Hardy repository rather than Gutsy. But we can get the .debs from here and install with dpkg.


Not an easy ride

October 20, 2007

I still have the memories of doing beta testing for Edgy and fighting daily with broken packages. It was an awesome experience, which helped me learn a lot of packages, upgradation, pre and post installation processes and how to face problems out of a broken package. Feisty has started become something of the past, similar to Dapper and Edgy. Now what every one speaks about, writes about, discusses about is Gutsy Gibbon.

This time I missed all the fun of upgrading during the beta days and doing testing, reporting bugs, helping out others fix issues and many more things. The reason is I do not have the luxury of Internet connection at home in Bangalore, as well as we have bandwidth issues in office such that I don’t want to trouble my admins by adding extra load.

Thus I made my trip to Chennai for Dusshera holidays mainly to upgrade my Helios from Feisty to Gutsy. I landed here on the day when the world was busy upgrading to Gutsy. Hence the load was more on the apt mirrors that when I started the download last evening, it took almost 18 hours to finish the whooping 1.65 GB download. I had to wait for additional couple of hours for it to finish the install. But nothing goes without troubles, this time exim4 package’s configuration process was giving me errors and it was messing up the whole upgrade.

I had to resolve to running `dpkg-reconfigure -a` which started configure every piece in my Ubuntu installation. It took 50 minutes to finish up the reconfiguration and finally I cleaned up unwanted stuffs with `apt-get autoremove`. Then I went for a reboot to boot with the new 2.6.22 kernel and my new Gutsy desktop.

I boot in, welcomed by my usual login screen. Nothing new or unusual. I login to KDE to find most things same other than a few icons and menus. I was told it will remove beryl but I still find it there. Then I went to check the GNOME desktop as I had no clue of where the compiz was in KDE. As I knew where to enable the compiz effects in GNOME (Preferences –> Appearance ), I turned them on to find the new desktops effects appear. GNOME is fine but what I need is KDE, so I relogged into KDE to see how it works there.

There is no menu option in KDE, and hence one good way is to add “/usr/bin/compiz” to .kde/AutoStart/ as a symbolic link. This makes compiz to be started when we log into KDE. But I still face the issue I had in Beryl with the multiple workspaces showing a distorted look when changed to and back between compiz and None. Also, if I select 4 multiple desktops in `Desktop preferences`, it produces 8 workspaces but only two of them works with compiz. *sigh* Tried to make things work, but having lost interest any further turned off the compiz thing and removed it from AutoStart.

The other cool things with Gutsy are newer version of OpenOffice (which I don’t care about), Gimp and the Gaim instant messenger now known as Pidgin. One more thing to feel good is the pop ups we get when Thunderbird gets a new mail. This is really useful when you are working in some other workspace and don’t have a audible ping turned on. Yet to try with the new Strigi desktop search (is it new? may be for me). The kernel is now 2.6.22.14 which is another good thing.

Am yet to check other things like bluetooth which people have reported to have improved a lot,as well as things on the KDE side. Will report them once I find them, as well as more bugs here and there as I encounter. For those who are still waiting to upgrade to Gutsy, just do it buddy without any second thoughts. Good luck and Congratz to the Ubuntu developers team and MOTUs for another awesome work :)


Improved desktop

August 28, 2007

Off late, I was not satisfied with my desktop i.e. how it looked. One of the main things I like it to have is display fonts small but still crisp so i can comfortably read them. I like small icons, small window border, etc. This makes me have more stuffs on my small 14″ display. I was even thinking of trying other desktop managers/window managers.

Yesterday when me and Onkar shinde were discussing about something else, he told me about the availability of Intel drivers as the default one. He asked me to install the driver and try. So did I, installed ‘xserver-xorg-video-intel’ and restarted X. The main aim was to get a better resolution option and ability to reduce my resolution at times when projectors ask for a 800×600. When I logged in back, I was surprised to see everything a bit smaller than what they were. Suddenly my desktop seem to be more spacious and I just love it.

Even the font rendering has changed, now I see crisper fonts (am not sure, I feel so). But surely I have more space on my desktop to keep stuffs. I was also trying out gdesklets (on my KDesktop) and with the new drivers, everything seems to be perfuct for me.

If you have an Intel video card and using the ‘xserver-xorg-i810′ driver, then give up a try with intel driver. But remember to edit xorg.conf in the “Device” section as shown below,

Section “Device”
Identifier “Intel Corporation Mobile Integrated Graphics Controller”
Driver “intel”
BusID “PCI:0:2:0″
EndSection


Mutt in Feisty

June 8, 2007

Have been trying to make mutt work since dapper days, did not quite get it right. After seeing a post in ilugc mailing list today, was determined to try again. It did not take me any more than 5 minutes to get mutt working with exim4. Here are the steps..

[1] install exim4 (+exim4-base, exim4-config, exim4-daemon-light) and mutt

[2] configure exim4 as follows,

$ sudo dpkg-reconfigure exim4-config split configuration into small files ? YES

choose "mail sent my smarthost; received via SMTP or fetchmail

System mail name: localhostIP Address to listen on for incoming SMTP connections: 127.0.0.1

Other destinations for which mail is accepted: <blank>Machines to relay mail to: <blank>

Machine handling outgoing mail for this host (smarthost): smtp.gmail.comHide local mail name in outgoing mail ? NO

Keep number of DNS queries minimal(Dial-On-Deman) ? NO

[3] Now configure the password client

$ sudo vim /etc/exim4/passwd.client gmail-smtp.l.google.com:yourAccountName@gmail.com:y0uRpaSsw0RD

*.google.com:yourAccountName@gmail.com:y0uRpaSsw0RD smtp.gmail.com:yourAccountName@gmail.com:y0uRpaSsw0RD

[4] Specify the port,

$ sudo vim /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost # add the following line after the line containing 'host_try_auth ..'

port=587

[5] Add your outgoing email address,

$ sudo vim/etc/exim4/email-address # myuser@localhost: mymail@gmail.com

yourUserName@localhost: yourAccountName@gmail.com

[6] Update the exim4 config

$ sudo update exim4.conf

[7] create a ~/.muttrc and add the following,

# mail check options

set pop_host="pops://username:password@pop.gmail.com:995"

set pop_last

unset pop_delete

# mail send options

set sendmail="/usr/sbin/exim4"

# check for new mail on startup

exec fetch-mail

[8] The necessary configurations are done. Open up a terminal and issue the following command

$ mutt

This will ask you to accept a security certificate and then check your mails. If the configurations are done as given above, you should be able to get the list of mails in your gmail inbox.

If it shows the error “/var/mail/UserName: permission denied (error-13)“, then send a test mail to ‘Username@localhost’. This will create the required /var/mail/UserName and make things work fine.

Happy mutt’ing :)

Sources:

[1] Gmail and Exim4 - Debian Wiki

[2] Using mutt with Gmail


From Edgy into Feisty

April 15, 2007

Since I bought my laptop been running Ubuntu in it. Started with Dapper Beta, upgraded it to stable, then moved to Edgy Beta and then to stable and now, I have moved to the latest Ubuntu Feisty (not sure whether it is Beta or RC). Dapper is still the best distribution out there, though succeeded by Edgy and now Feisty. Edgy was initially highly unstable and got better with time. I had a horrific experience moving from stable Dapper to Edgy beta, breaking a lot of things and having tough time mending things all the way.

When tuxmaniac announced that he had upgraded to Feisty, the first thing I asked was how stable it is? He assured me that he had a smooth installation and really did not have to mend anything. So, I decided to upgrade mine too. The only problem I had was, mine was a Ubuntu installation over which kubuntu-desktop was added later and now I completely use KDE. So, I was wondering from where to start the upgrade, KDE or GNOME. G0SUB clarified the doubt and I started my upgradation.

The upgradation started with the command “update-manager -d”, downloading 1729 files in almost 13 hours. When the download ended, it spewed some error on the screen and the installation stopped. I had to start the installation again with  “apt-get update && apt-get dist-upgrade”. It again fetched some 41MB of files and finished installing them. I went for a reboot, praying that everything should work fine.

Nice to see the kernel 2.6.20 but not pretty impressed with the new usplash theme. Thankfully, it showed the login screen. Logged into KDE (default) and was surprised to see a new icon for power manager and network manager. Indeed, network manager has changed way much and has become more easier to use. Also, xchat now gets placed in the system tray.

Ok, time to check GNOME. When I logged in as a temporary session, there lay the mine. The welcome screen hung in the middle and I could see the panel blinking many times. Then it said some error message stating that it tried to restart the panel many times but in vain. OMG!, things have screwed up again. I went back to KDE for a bit more shock, the terminal was not showing me the bash prompt that I had to use Alt+F1/F2 to get the prompt. I tried installing gnome, gnome-desktop, gdm, metacity and gnome-panel. The gnome-panel installation was the reason for the trouble which got solved in the last re-installation. Luckily the terminal also came back to normalcy without doing anything. Though I new its going to mess up, I tried Beryl and it did mess. I got no window border, windows hung where they were and I couldn’t enter text into them (Xchat and Firefox address bar).

I was determined not to upgrade until the final stable version is out, but giving away to it had thought me some lesson. But, having suffered the worst during Edgy has given me enough courage to fight and solve things. The truth is, I took a back up of important stuff in my /home and was readt to make a new installation of Sabayon. I wanted to give a last try as the installation of new distro and setting up things again would be a PITA. That was a good decision at the end, or else I would have been spending the next couple of days installing, configuring and tweaking stuffs back to where I was (luckily, where I am also ;) ).

Off late I have been seeing too many people migrating out of Ubuntu, inspite Ubuntu still being one of the best distros out there. Am surprised at this as well as pained that I can not just stop them because their experience left some bitter in their mouths. Hope the final and stable release of Feisty Fawn breaks the Ice and does much more in Desktop GNU/Linux than what Dapper did around a year ago :)


Qt4 from source

December 22, 2006

I had installed Qt4, Qt3-designer and Qt3-assistant from Ubuntu repos. I had been using Qt3-assistant examples and writing them in PyQt4, whole the document I was referring actually corresponds to Qt3.

Pradeepto was looking at my earlier blog post which had a PyQt4 code and pointed to me that I was rather working with PyQt3/Qt3. He was the one who suggested to make a source install of Qt4, as everything comes with it in one go. So here are the steps..

1. Download the source tar ball from the Qt’s home page which is Trolltech’s Qt Download site.

2. Untar the tar ball where ever you like to have it.

3. Like a typical source installation, with your current working directory pointing to the directory where you extracted the tar ball, run the following after one another in a terminal/console.


$ ./configure # check ./configure –help to know more options like -debug
$ make -j 4 # this may freeze your computer, do it if you have a powerful horse!

4. The ‘make’ command will build Qt4 from source. Generally, we run ‘make install’ also, which will install the built files in appropriate fixed locations. But, this is not mandatory, we can still run Qt4 from where we built it with a few additional things.

5. First, we need to add the files in /bin of Qt4 into the path; likewise the librariries and docs as well. We can sym link the files to existing path such as ‘/usr/bin’. Or else, we can set a few environment variables and proceed with out work. This can be done with a simple shell script, which needs to be executed before we start working with Qt4 everytime.


export QTDIR=/home/joe/qt-4.2.2
export PATH=$PATH:$QTDIR/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib
export PKG_CONFIG_PATH=$QTDIR/lib:$PKG_CONFIG_PATH

6. When I openned up qt4-assistant, it showed me an error pop up stating that files were not found at a specific location. So, I had to copy these files to that specific location. I tried sym link but unfortunately it did not work, so I copied them rather.

Destination: /usr/share/qt4/doc/html/    Source: $QTDIR/doc/html/
assistant.dcf
designer.dcf
linguist.dcf
qmake.dcf
qt.dcf

The above files can either be sym linked (if it works for you) or copied by creating the destination directory. Now, open up the qt4-assistant and you should be able to see the contents.

7. I have a problem, rather a bug, which I suspect to be specific to Ubuntu Edgy. When I export the above paths and open up qt4-assistant or qt4-designer, as well sym link both to ‘/usr/bin’ or anywhere, the fonts on the window is not rendered properly. But, when I execute them from the place where I built them, which happens to be under ‘home’ directory, they get rendered properly. This is quite odd and till now I haven’t got a reason and solution to this.

This is just an account of my experience of installing Qt4 from source. But it was rather a very good experience. Installing from source is always fun, except when you get caught in a maze of dependencies :D


Gallery - Web/Online Photo Album Service

December 1, 2006

Sometimes we surprisingly get to know some nice software. The world is becoming more and more web oriented than desktop oriented. The things which are done is desktop has become online services like bookmarks, address books, why even presentation and word processing softwares are available as web tools. One such tool is online albums. When I say this, the first thing to come to your mind are either flickt or yahoo/google albums.

But what about one album which you can host in your own web site, if you have one ? It was during the discussion about FOSS softwares being developed by Indians, in the mailing list, it got mentioned about Gallery. I immediately checked out the web site of gallery project. it seemed woth a try. I checked whether I have it in my ubuntu repos and surprisingly it did. There are two versions gallery1 and gallery2, I went for the latter.

The advantage of using apt is that, we neither need to worry about dependencies as well as configurations. 90% things are taken care by it mostly, and rarely it needs some tweaking. I went for an apt-get install of gallery2 package, which also installed libnetpbm10, netpbm and wwwconfig-common packages along with it.

The package got installed in /usr/share/gallery2, while I had to actually access it as a web service. So, I wanted it to be in /var/www/ rather, which is supposed to be my DocumentRoot. I asked this in #gallery-support but did not get a contempting answer. At last, my buddies in #linux-india came to help and suggested to have symbolic link of it in DocumentRoot. This actually worked out and when I accessed `http://localhost/gallery2`, the installation and setup screen opened up in my browser window.

Ok, then walk through the 7 step process and you get your online album service before you. You need Apache2 and either MySQL or PostgreSQL installed.Obviously it works on other webservers and OS as well.

The Gallery main page shows you all available galleries/albums. You can create as many albums and sub-albums as you want. You can modify settings and appearance of the albums and sub-albums individually. If you are on a network, then you can make this service available to other also. I tried it out in my personal laptop and just running it in ‘admin’ mode. In real use, we need to create user accounts for individual users. These is also provisions for large scale user management, which is available as optional modules during installation. If you are doing an installation in stand-alone machine, better install only modules pertaining to your needs and not all those which is available.

There are two things which may trouble you during installation.

  1. You need to copy a text file login.txt, which contains a key generated by the gallery app itself, and copy it to your installation directory (/usr/share/gallery2).
  2. You need to change the value of maximum memory limit in your php.ini file, which is in /etc/php5/apache2 directory. In addition or alternate to this, is to create a .htaccess file in your /usr/share/gallery2 containing the following line,

php_value memory_limit 20M

This is by default set to 8M, which is not sufficient. The suggested value is 16M or above and I have given 20M.

Also, when you create an user account, the confirmation mail will be sent and for it we need a mail service such as sendmail installed, configured and working. Else, it results in an error and the user account is not created.

Here are a few screenshots of the Gallery…

The main album page

Main Page of Gallery2 Album

Individual albums inside view

Sub-albums view

View of a single photo, where the properties of the photo are shown below the photo.

Individual Photo view


e17 on Ubuntu - A brief enlightenment

November 19, 2006

e17 is the DR17 version of the Enlightenment window manager. Enlightenment is one of the other well known window managers in Unix/Linux world and its advantage is light weight and simplicity. e16 was simpler, yet it did not satisfy the eye candy that the users migrating to Linux demanded. But, e17 has solved this much by bringing in some elite eye candy which doesn’t ask you for much RAM.

I had used e16, though GNOME has been my favourite. But, I wasn’t confortable with e16 much. When I came across an article in LFY about e17, I wanted to have a look. The enlightenment which is available in ubuntu repository is e16 (am afraid so!). And, it messed up along with my GNOME/metacity that when I booted back in metacity, it was showing elements of enlightenment along with it. I had a bad day clearing all the mess it did.

But yesterday, Sudharsh told me about e17 and showed me a script which will download the required files from the CVS repos and compile-install it on my machine. I tried it in my workbox at office, but it demanded some dependencies which weren’t met. But, I thought of checking it out in my Laptop at home.

I tried it today. We need to just get this script in your local machine, give it executable permission and run it in a terminal. The script will run in 2 phases, phase 1 takes care of downloading all the files and phase 2 compiles the downloaded files and installs them in the local system.

$ sudo apt-get install build-essential cvs libtool libltdl3-dev automake1.9 autotools-dev libpopt-dev libcurl3-dev libx11-dev x11proto-xext-dev libbz2-dev libid3tag0-dev libpng12-dev libtiff4-dev libungif4-dev libjpeg62-dev libssl-dev libfreetype6-dev bison flex xlibs-dev gettext libimlib2-dev libxml2-dev libxcursor-dev libgtk1.2-dev autoconf pkg-config libpng3-dev libxine-dev libxkbfile-dev libsqlite3-dev giblib-dev libxmu-dev libxdamage-dev libxcomposite-dev libtag1-dev libtagc0-dev giblib-dev libasound2-dev

A small note on this, rather a warning: you need an additional library which is missed in the list of dependencies to be installed prior to running the script. The missing thing is libxslt and do an apt-get install for these 2 packages - libxslt1.1 and libxslt1-dev

$ sudo apt-get install libxslt1.1 libxslt1-dev

To run the script

$./easy_e17.sh –skip=etk_server -i

The `–skip` option skips the download and installation of ‘etk_server’ which I was adviced to.

If you want any additional help then,

$./easy_e17.sh –help

If you encounter any problem, especially dependency, then install the corresponding package. If it happens during compilation stage, later you can run the script skipping the download part using this command,

$./easy_e17.sh –skip-cvsupdate -i

After it has compiled and installed, there is one step you need to do before you can login into e17. Do the following

$sudo vi /usr/share/xsessions/e17.desktop

Add the following lines into the file and save

[Desktop Entry]
Encoding=UTF-8
Name=E-17
Comment=
Exec=/opt/e17/bin/enlightenment_start
Icon=
Type=Application

If you refer to the actual ubuntu forum page, then you will notice it is ‘enlightenment’ instead of ‘enlightenment_start’. But, when you boot it using that option then when you login it will ask you to change the option as I have given.

The last thing to do is that add the path ‘/opt/e17/bin/’ to your $PATH. This is because e17 got installed in ‘/opt/e17/bin’ and hence we need to put in on the PATH environment variable to be found.

$ export PATH=$PATH:/opt/e17/bin/

Now, logout of the current desktop. While loging in back, remember to change the session to e17. I will advice you to select ‘Use for this session only’ option, so you can first experience, hang around and change if you do like. Otherwise, you have the existing desktop/window manager as the defaulft.

Will add more about my e17 experience later. Enjoy the enlightening experience.


Faster Browsing !?

November 10, 2006

We all do browse and wish we can browse faster. Am not meaning the ability of the individual to browse faster, neither the ability of the browser like FireFox, but some thing else which looks techy but really determines the speed of browsing. It is called resolving domain names or Domain Name Servers (DNS).

If you have ever tried to configured your network, even your Internet connection at home, you would have encountered something called as DNS. DNS can be simply said as a service which resolves domain names into the corresponding TCP/IP address. For example, when we type www.google.com in the address bar of our browser and press enter/go, something happens in the background which we haven’t worried much till now. The domain name which you typed (google.com) gets translated into the corresponding IP address which will specify the server where google.com is hosted or where the actually request for the page `google.com` should be sent. This is done with the help of DNS servers which help our computer to resolve the domain name to its IP address.

But where are these servers and how will I know them ? Do not worry, your system can obtain them automatically from your Internet Service Provider (ISP). Or else, there are enough number of DNS around the web, which are globally accessible and available for public.

Ok, lets come to the point.. making the browser resolve the domain names faster. Is it with the browser, your computer hardware, operating system, your ISP or the DNS itself ? Hmmm.. its within our reach, perhaps within the reach of our operating system.

How ? There are some software tools which can help you with this. One such tool, which is available for all famous distributions of Linux, all flavors of BSD, Mac, is dsnmasq.

The official site of dnsmasq defines it to be a light weight, easy to configure DNS forwarder and DHCP server. Let us now mind about the DHCP part now. The dnsmasq can pick up the addresses of the local machines which are not in the global domain as well. Hence, it is more suitable for small home networks where using BIND is an overkill.

How does dnsmasq help us ? What dnsmasq does is that, it caches the nameserver lookups and make use of this cache for future looks ups. Its nothing but similar to taking a history of the dns lookups and referring this history for future. Thus, when we lookup for a domain name resolution, then the cache is searched first. If there is an entry there, then the domain name gets resolved within our local system itself. Else, the DNS servers are contacted and an entry is added to the cache for the resolved domain name.

How to get dnsmasq ?

  1. From the official archive of dsnmasq at thekelleys.org
  2. From the repository of your distribution, using apt-get (if present)
  3. Using package managers like Synaptic, if dnsmasq is supported by your distribution.

Installation and Configuration

First, get dnsmasq installed using apt-get,

$ sudo apt-get install dnsmasq

Once dnsmasq got installed, we need to fiddle with some configurations before everything works fine.

Edit the file /etc/dnsmasq.conf, uncommenting the line that reads

listen-address=127.0.0.1

The next thing to edit is /etc/dhcp3/dhclient.conf, to ensure that the following lines are present.

prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;

This line just makes sure, the first place the domain name is looked up is 127.0.0.1 which is nothing but your own computer, a place where your dnsmasq is running to serve you. Thus, the dnsmasq cache is first searched for domain name resolution and then proceeded to the other DNS servers listed in /etc/resolv.conf.

There are couple of steps left, first is to edit /etc/resolv.conf once and add the following line,

nameserver 127.0.0.1

Next, the final step, is to restart your dnsmasq service for the changes we made till now to take effect. To do this, type the following in the terminal,

$ sudo /etc/init.d/dnsmasq restart

Testing ?! Yes, indeed we have to test to make sure its really working out. Hmm.. being connected to the Internet, fire up your terminal and execute the following…

$ dig yahoo.com

The output will be as follows…

; <<>> DiG 9.3.2 <<>> yahoo.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32837
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 5

;; QUESTION SECTION:
;yahoo.com. IN A

;; ANSWER SECTION:
yahoo.com. 68 IN A 216.109.112.135
yahoo.com. 68 IN A 66.94.234.13

;; AUTHORITY SECTION:
yahoo.com. 172691 IN NS ns2.yahoo.com.
yahoo.com. 172691 IN NS ns3.yahoo.com.
yahoo.com. 172691 IN NS ns4.yahoo.com.
yahoo.com. 172691 IN NS ns5.yahoo.com.
yahoo.com. 172691 IN NS ns1.yahoo.com.

;; ADDITIONAL SECTION:
ns1.yahoo.com. 172268 IN A 66.218.71.63
ns2.yahoo.com. 172268 IN A 68.142.255.16
ns3.yahoo.com. 172270 IN A 217.12.4.104
ns4.yahoo.com. 172270 IN A 68.142.196.63
ns5.yahoo.com. 172268 IN A 216.109.116.17>

;; Query time: 325 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Nov 10 21:10:08 2006
;; MSG SIZE rcvd: 229

It took 325 msec. But, we expected it to be fast, isn’t it ? Wait! This is the first time we are resolving the domain name. Lets see what it happens when we try it again. Execute the same command again and check, it will result as below..

; <<>> DiG 9.3.2 <<>> yahoo.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7500
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;yahoo.com. IN A

>;; ANSWER SECTION:
yahoo.com. 66 IN A 66.94.234.13
yahoo.com. 66 IN A 216.109.112.135

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Nov 10 21:10:10 2006
;; MSG SIZE rcvd: 59

See, the query time is 0 msec. This is really fast isn’t it (unless you expected some negative numbers there :p). Good work, dnsmasq!

So, the post ends here ? Naah! I have a little more to say. I had the problem that everytime I connected, the resolv.conf got replaced with the DNS nameservers sent by the ISP. The reason is I have configured pppoe to obtain the nameservers from the peer during connecting up. Also, i wasn’t having resolvconf. So, if you are in a similar situation that you have to manually add “127.0.0.1″ every time you get connected, then better do the following.

$ sudo apt-get install resolvconf

Edit the file /etc/resolvconf/resolv.conf.d/head and add this line to it,

nameserver 127.0.0.1

In addition to this, you can edit the file /etc/ppp/peers/dsl-provider and comment the following line.

usepeerdns

Now, disconnect your Internet connection and connect again. Check out the resolve.conf file whether you have the entry for “127.0.0.1″ at the top of the list. If you have, then you have done everything fine. If not, then you have messed up somewhere. You can also check this blog, which is the one I used up to set dnsmasq :)

Happy Browsing! Faster Browsing! :)


Emacs 23 - Phase II

November 6, 2006

Things keep changing with time, rather they evolve and improve to better things. This is one such an occasion to look back at something which has moved to the next stage. wondering what ? Am talking about emacs-snapshot which I wrote about a month ago.

I was really surprised to hear from G0SUB that emacs-snapshot was available in the repository as .deb package. And still happier to know that I could update my earlier emacs-snapshot with our favorite `apt-get update`.

Baishampayan Gose has set up an APT repository, from which we can install it over Ubuntu Dapper machines. And, I successfully installed it in my Ubuntu Edgy laptop. The steps are as follows…

#1. Add the following line to /etc/apt/sources.list

deb http://people.ubuntu-in.org/~ghoseb/apt/ dapper main

If you are interested in getting the source and install from it then,

deb-src http://people.ubuntu-in.org/~ghoseb/apt/ dapper main

#2. Do sudo apt-get update to update your package list with the newly added repository.

#3. To do a fresh install of the emacs-snapshot package do,

sudo apt-get install emacs-snapshot-gtk

#4. If you already have a vanilla emacs-snapshot package, which I wrote about in my earlier blog post, then do this…

sudo apt-get upgrade

This will upgrade your earlier installation to the new version.

#5. If you are doing a fresh install, then you have to edit your .emacs file, provided you have emacs21 in your system. If so, then put the following code into the .emacs file.

(set-default-font "Bitstream Vera Sans Mono-8")

#6. To launch the new emacs-snapshot type this into the terminal and press ‘Enter’,

emacs-snapshot-gtk --enable-font-backend

You can also create a launcher and add the above command into the command field.

Experiment, enjoy and get us feedbacks :) If you have further queries or suggestions, you can post them in G0SUB’s blog post about the same :)


GNU/Emacs 23 Snapshots

October 19, 2006

Been using emacs from the day I started to use my Linux box. First it was all ‘Greek and Latin’, rather felt Gedit was much more easier to use. But once I started coding, I felt the need of a really good editor. There were two choices, Emacs & Vi. I felt the CTRL + keys method of emacs to be more comfortable than ‘command mode - insert mode’ in Vi. From that day 1, been using emacs21. And today, tried a snapshot of emacs23. I know what people might be reacting to this “w00t!?”, again notice the ’snapshot’ in my statement. Yes, Baishampayan Ghose or G0SUB led me to this peep into the future experience. Got the chance to explore and experience something which is going to be there in the future.

This time, I put it down in an interesting and lively manner - the Cause, the Effort and the Outcome of my endeavour. Here we go..

The Cause: (Location: #ubuntu-in @ irc.freenode.net)

<G0SUB> techno_freak: do you use GNU Emacs?
<techno_freak> G0SUB: I do
<G0SUB> techno_freak: in that case, you are welcome to use my specially built version of GNU EMacs
<techno_freak> :)
<techno_freak> thats great
<G0SUB> it has a lifetime guarantee & 2 years free maintenance
<techno_freak> oh ok
<G0SUB> haha
<G0SUB> techno_freak: it looks a bit like this http://people.ubuntu-in.org/~ghoseb/emacs-23.png
* techno_freak fires FF
* techno_freak doesn’t want a black background in Emacs
<G0SUB> techno_freak: it’s not about a black bg
<G0SUB> techno_freak: look at the fonts. there is no difference between the fonts in emacs & gnome terminal
<techno_freak> G0SUB: I just said that
<techno_freak> ya i agree
<techno_freak> Emacs 23 :-?
<techno_freak> w00t
<G0SUB> techno_freak: yes, 23
<techno_freak> G0SUB: where do I get it ?
<techno_freak> can I have both this and emcs21 ?
<techno_freak> s/emcs/emacs
<G0SUB> techno_freak: yes
<G0SUB> techno_freak: mine is a modified version of emacs-snapshot package
<G0SUB> techno_freak: you can have it with emacs21
<techno_freak> oh ok

The Effort:

Download the below file and untar the folder which contains the .debs. http://people.ubuntu-in.org/~ghoseb/emacs-unicode-xft.tar.bz2

(Location: #ubuntu-in @ irc.freenode.net)
Oct 19 14:44:57 <techno_freak> G0SUB: I have downloaded the file, how do I install it i.e. where do I untar it ?
Oct 19 14:45:25 <G0SUB> techno_freak: those are debian packages
Oct 19 14:45:39 <G0SUB> techno_freak: untar anywhere and sudo dpkg -i *.deb
Oct 19 14:45:49 <techno_freak> ok
Oct 19 14:47:29 <G0SUB> techno_freak: if it fails midway, apt-get -f install will fix it
Oct 19 14:47:40 <techno_freak> ok :)

Location: Terminal @ My Linux Laptop)
technofreak@dapper:~$ cd Apps/
technofreak@dapper:~/Apps$ cd emacs-xft-debs/
technofreak@dapper:~/Apps/emacs-xft-debs$ sudo dpkg -i *.deb
Password:
Selecting previously deselected package emacs-snapshot.
(Reading database … 171680 files and directories currently installed.)
Unpacking emacs-snapshot (from emacs-snapshot_20061008-1_i386.deb) …
Selecting previously deselected package emacs-snapshot-bin-common.
Unpacking emacs-snapshot-bin-common (from emacs-snapshot-bin-common_20061008-1_i386.deb) …
Selecting previously deselected package emacs-snapshot-common.
Unpacking emacs-snapshot-common (from emacs-snapshot-common_20061008-1_all.deb) …
Selecting previously deselected package emacs-snapshot-el.
Unpacking emacs-snapshot-el (from emacs-snapshot-el_20061008-1_all.deb) …
Selecting previously deselected package emacs-snapshot-gtk.
Unpacking emacs-snapshot-gtk (from emacs-snapshot-gtk_20061008-1_i386.deb) …
Selecting previously deselected package emacs-snapshot-nox.
Unpacking emacs-snapshot-nox (from emacs-snapshot-nox_20061008-1_i386.deb) …
Setting up emacs-snapshot-common (20061008-1) …

Setting up emacs-snapshot-el (20061008-1) …

Setting up emacs-snapshot-bin-common (20061008-1) …

Setting up emacs-snapshot-gtk (20061008-1) …
emacs-install emacs-snapshot
.
..

…. <snip>

..
.
Setting up emacs-snapshot-nox (20061008-1) …
emacs-snapshot flavor installation already done, skipping…

Setting up emacs-snapshot (20061008-1) …
emacs-snapshot flavor installation already done, skipping…

technofreak@dapper:~/Apps/emacs-xft-debs$ cd ..
technofreak@dapper:~/Apps$ cd ..
technofreak@dapper:~$ emacs-snapshot
technofreak@dapper:~$ emacs-snapshot-gtk –enable-font-backend

The Outcome: (Location: #ubuntu-in @ irc.freenode.net)

Oct 19 14:49:05 <techno_freak> G0SUB: done
Oct 19 14:49:26 <techno_freak> how do i start it, emacs23 ?
Oct 19 14:49:49 <techno_freak> or emacs-snapshot ?
Oct 19 14:51:25 <G0SUB> techno_freak: /usr/bin/emacs-snapshot-gtk –enable-font-backend
Oct 19 14:52:20 <techno_freak> G0SUB: i just types emacs-snapshot and it opened :D
Oct 19 14:53:22 <G0SUB> techno_freak: yes, but it won’t enable the anti-aliased fonts
Oct 19 14:53:30 <techno_freak> ya, saw that
Oct 19 14:53:33 <techno_freak> :)
Oct 19 14:55:35 <G0SUB> techno_freak: but, to use ood fonts, add this to your ~/.emacs
Oct 19 14:55:44 <G0SUB> s/odd/good
Oct 19 14:56:04 <techno_freak> ok
Oct 19 14:56:12 <G0SUB> (set-default-font “Bitstream Vera Sans Mono-7.5″)
Oct 19 14:56:22 <G0SUB> (set-default-font “Bitstream Vera Sans Mono-8″)
Oct 19 14:56:30 <G0SUB> 7.5 may be too small for you
Oct 19 14:56:43 <G0SUB> or even use 9 or 10
Oct 19 14:57:02 <techno_freak> will try it out, which ever looks fine, i am comfortable with small fonts generally
Oct 19 14:58:14 <G0SUB> techno_freak: try now :)
Oct 19 14:58:30 <techno_freak> trying :)
Oct 19 14:59:42 <techno_freak> G0SUB: error: “Font `Bitstream Vera Sans Mono-7.5′ is not defined”
Oct 19 14:59:54 <G0SUB> techno_freak: –enable-font-backend
Oct 19 15:00:00 <techno_freak> oh ok
Oct 19 15:00:11 <techno_freak> i tried that one in emacs21 :s
Oct 19 15:00:17 <G0SUB> bah
Oct 19 15:00:24 <G0SUB> emacs21 will bork at that
Oct 19 15:00:30 <techno_freak> it showed me errors
Oct 19 15:00:32 <techno_freak> ok
Oct 19 15:00:38 <Casanova> G0SUB: ?
Oct 19 15:00:38 <techno_freak> it looks good in yours :)
Oct 19 15:00:47 <techno_freak> and 7.5 is fine with me
Oct 19 15:01:43 <techno_freak> G0SUB: can i create a symlink for `/usr/bin/emacs-snapshot-gtk –enable-font-backend` as a whole, like emacs23 or so ?
Oct 19 15:02:04 <techno_freak> or everytime i got to give than –enable-font-backend ?
Oct 19 15:02:07 <G0SUB> techno_freak: you can write a bash script and put it in ~/bin/


SVN, the first steps - A Mini HowTo for n00bs!

August 13, 2006

I had to deal with teaching a few Linux n00bs on how to start with SVN. Though my last post deals with using the SVN basically, it missed one big point which I perhaps myself learnt today - How to create a reposiroty and start with a working copy. I agree, I had difficulty over creating a repository though I very well know how to work on a working copy. This day, I had more things to learn and especially to find a list of things to be learned. Thus, I wrote a simple step-by-step howto for those who haven’t tried their hands on SVN before. As usual, I blog them too therefore someday when I myself couldn’t figure out how to do things, I can look at my own blog (Which I did today while dealing with MySQL).

Here goes my mini how-to for noobs on SVN….

Procedure to Create a Repository using SVN and basic operations with Subversion:

Step1. Create a repositry named mysvn in your home directory (assuming your shell’s current directory is your home, which is by default),

noob@dapper:~$ svnadmin create mysvn

Step1(b). Check whether your repository is created in the intended location,

noob@dapper:~$ ls
Apps Django-0.95 GNUstep Collections Documents Linux Music confman Downloads LUG mysvn WorkSpace
Desktop

Step2. Create a directory called code in your home, crate 3 sub-directories under it namely branches, logs and trunk. If you have some files to be placed, place it in the ‘trunk’ sub-directory.

noob@dapper:~$ mkdir ./code
noob@dapper:~$ mkdir ./code/branches
noob@dapper:~$ mkdir ./code/logs
noob@dapper:~$ mkdir ./code/trunk
noob@dapper:~$ ls ./code/
branches logs trunk

Step3. Now, import your newly created directory, named code to the repository using the SVN’s import command as follows,

noob@dapper:~$ svn import ./code file:///home/noob/mysvn/code -m ‘Initial Import’
Adding code/trunk
Adding code/trunk/testfile.txt
Adding code/logs
Adding code/branches

Committed revision 1.

Step3(b) This will add an invisible directory named code in the repos, though you cannot see them by getting into mysvn repos direcotry manually from FileManager or so. Don’t worry.

Step4. Checkout the newly created project in the repos, namely code, thereby cretaing a working copy in local filesystem. (may be in the same name or a slightly different name like mycode)

noob@dapper:~$ svn co file:///home/noob/mysvn/code code
A code/trunk
A code/trunk/testfile.txt
A code/logs
A code/branches
Checked out revision 1.

Step5. Now, change the content of any file in the local working copy under trunk and save the file. Now a file in your working copy is changed and lets have some fun with svn :)

Step6. Lets check the difference between the file in the repository and the local working copy, as we have made a change. The changes will the printed on the terminal, where a + denotes addition and - dentoes deletion or change.

noob@dapper:~$ cd code/
noob@dapper:~/code$ svn diff
Index: trunk/testfile.txt
===================================================================
— trunk/testfile.txt (revision 1)
+++ trunk/testfile.txt (working copy)
@@ -1,3 +1,6 @@
-This is a test text file. This file is intended to be moved to local
+8.20 PM: This is a test text file. This file is intended to be moved to local
repository (not working copy) named ‘mysvn’ under the project
‘code’. Hope everything works fine :)
+
+8.25 PM: Repository creation successful. Added files to repos and created a
+local working copy of the same name.

Step7. The change is found. Now as we have a modified working copy, we need to commit the changes so it gets updated int he repository as well.

noob@dapper:~/code$ svn commit -m ‘changed text contents’
Sending trunk/testfile.txt
Transmitting file data .
Committed revision 2.

Step8. Update your working copy so that you get the laest revision in your working directory.
noob@dapper:~/code$ svn update
At revision 2.

Note:
#1. This procedure is for creating a repository in your local machine, as well as the working copy in the same machine. This is a simple example of how to do the basic things. Read the SVN documentation available in the SVN’s official web site.

#2. Did you see, when we added the files from code folder using an import command, the revision changed to ‘revision 1′ from the initial ‘revision 0′ (sorry, how did i miss the output which showed revision 0 ?? :( ). And check again, when we did a ‘commit’ at step7, the revision again got updated to ‘revision 2′. Wow! It’s cool, isn’t it ?! :D

*********************Licence*******************************************
This work was created by Parthan.S.R. on 13th August, 2006. Parthan can be contacted at parth.technofreak@gmail.com
This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit
tp://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.


Subversion - A Scoop of it!

August 9, 2006

Subversion, famously known as SVN in the open source world, is a vesrion control and management system. It forms a vital part of software development, where the code development is a continuous process and hence results in frequent change of small part of the code. Thus, it is veri important to keep track of the change so that the various modules and components of the project are in sync with one another.

SVN serves three main purposes:

  1. Tracks the changes done by individual contributors of the project and produces a new version with each release.
  2. Helps in collaborative development of the project, where many developers can work over a stable main code.
  3. The modifications done by one developer can be easily tracked by others and hence they can modify their work to keep themselves in sync with the main trunk of the project.
  4. It allows branching of a main project, where the branches run parallely with the main project but still keeps in sync with those components which it has got from the main trunk.

How does SVN do this ?

SVN consist of a main repository in a central server location which can be accessed from the individual clients who are contributors to the project. Each individual developer has a working copy of the project code, which he has got from the main repos and ensures it is updated with the changes made to the repos code. His local working copy is where he makes his own changes as well as where he adds his own new codes. Before he starts his work, it is his responsibility to update his working copy so that it is in sync with the main project code. Once he has the updated working copy, he starts his work. When he has finished his work, he adds these to the repository. At this point, SVN checks with the existing version of the project. If both are same, i.e. the developer hasn’t made any changes with respect to the repository, then he is intimated that there is nothing to be updated. If he has modified or added some files, then his files are marked for addition to the repository trunk. When he ‘commits’ his changes, the files are added/modified as per his working copy, creating a new version of the project code. The SVN creates a new version in the repository, which is one more than the previous version. The term version is known as ‘Revision’ in SVN. Thus when another developer checks the his working copy with the repos, SVN finds out that the code has changes and ask him to update his local copy so that it is aware of the changes made. Then the second person updates his working copy and continues with his work.

A peculiar case that can occur at odd times is, two persons making change in the current version at the same time. That is, they start with the same version/revision, make their own changed and commit. Whoever has comited first, updates the repos and hence a new version/revision is made. When the latter commit is obtained, the second persons working code is obscure and hence the SVN warns him that some one has made changes since he updated his code last time. Then he checks with the current code, what are the changed made. If the changes made don’t affect his code, he goes on with a new version. Else, he has to get the new copy and make changes in it to incorporate his work. He can also accept a part of the changes made, if he finds them to be correct.

To make things clear here is a small example. Consider that a repos named sandbox to be created and a local working copy is named as sbox. The repos is accessed by https at example.com. Here is a simple step-by-step to create and manage with SVN:

1. Create a local copy of svn for the corresponding repos

$svn co https://svn.example.com/public/sandbox sbox

2. Having a local working copy been created as above, we check the status of the svn as follows,

$svn status

3. Now, after creating our new file ‘ReadMe’, we add it to the repos.

$svn add ReadMe

4. Commit the changes made to the local copy, so that it is updated in the main trunk

$svn commit -m ‘First change’

5. Check the svn log for more info,

$svn log ReadMe

6. To check whether there is any difference between working copy and local copy, use dif command with svn,

$svn diff

This will give those codes in the working copy that differs with the current active revision in the repos.

7. When a conflict occurs with the current version and the local copy, to make the svn accept the corrected loca copy, issue resolve command as follows,

$svn resolved ReadMe

8. To delete a file in the current version, isse a remove command..

$svn remove ReadMe

These are the basic commands for common svn operation. Manual/Tutorial for svn, called as the Subversion Book, is available at http://svnbook.red-bean.com/nightly/en/svn-book.html.

Enjoy svn, enjoy collaborative development! :)


The Birth of ‘foss4mylang’ - Tamil Localization

July 16, 2006

When 10 people unite, the work done by a single person for a week finishes in a day! This became true when 14 people united to translate around 400 strings of software terms for ‘Django’ , a well known web interface, into equivalent thamizh strings.

This endeavor also led to the formation of a group or perhaps the birth of a community who will strive to translate every other Open Source Software in thamizh, that one day every OSS will be available in thamizh itself. This was also a show which proved that Open Source community has all the enthusiasm and determination to do things which are otherwise put in shelves for years.

The members of this group come from different domains and even geographical locations, and necessarily need not be software professionals. But all have the passion to involve themselves in the community efforts to make this world, at-least this ‘part’ of the world, OSS aware. We mainly had people from our own NRC-FOSS and CDAC, as well as many active volunteers from ilugc. We formed a google group, christened it as ‘foss4mylang’, perhaps in a democratic way of collecting names and voting for each name. Finally ‘foss4mylang’ was what everyone wanted our group to be called.

The day started with a brief introduction to Tamil Translation Endeavours that have been taken up in the past as well as the success stories of the same. We were lucky enough to have Vel Murugan who had been into one such effort and later joined by Shivakumar who had been indeed one of the initiators f such effort. We had a long session of setting up ’scim’ and ‘kbable’ in our Linux machines - Fedoras’ mostly with my Ubuntu and one Debian being an exception. I had some initial hitches in making scim actually work, though i had almost everything right.

The gimmick to make tamil translation is…

1. Turn on your tamil/indic language support in your linux boxes,

2. Download ’scim’ and all its additional modules for your language. Yum and apt may help you with this.

3. Make sure you have these modules for your scim:

scim-gtk2-immodule, scim-modules-socket, scim-modules-table, scim-tables-additional, scim-m17n and finally scim-uim.

These modules are very much important for you to get Indian languages running under scim.

4. Go to the ‘SCIM Setup’ and select the languages you wish to turn on and the keys for turning them on, off and to toggling between them.

5. Download and install kbable, which is the translation software. If you have a database of translated words as ‘po’ files, then upload them in kbable so that you wont be translating same words again and again, espeicially in your own way.

6. There is a small gimmick which you have additionally play to make thing work in the end. Make a symbolic link for the xinput.d folder to your home directory. This will give you the option to configure your own personal input settings, though you need not alter this file at this stage.

ln -s /etc/X11/xinit/xinput.d/scim ~/.xinput.d/en_US

Now, load the to-be-translated files in KBable and start translating. the words which you are not sure of proper tamil translation can be marked as fuzzy. And if you find some fuzzy and know how to spell it right, translate and remove the fuzzy mark.

I very well understand that my above description is too simple for the task, its only by practice we learn things. We learnt it yesterday and that’s why am writing this blog today. If you have any difficulty when trying your own hands at translation, then you are free to refer foss4mylang@googlegroups.com. You can also add this to your groups by joining the group and thereby join the team of tamil-loving translators.

Note: The group is named ‘foss4mylang’ rather than ‘foss4tamil’ because we are not restricted to ‘thamizh’ alone. As the people who were there yesterday were thamizh speaking souls, we did a tamil translation. We also help and support all other Indian languages, and we indeed welcome people from other languages to join our team and do translations in their own mother-tongue. :)

வாழ்க தமிழ் ! வளர்க தமிழர் பெருமை !


First time with MySQL !

November 11, 2005

Everybody will have a day when they decide to try something which they knew for a long time. That day is very unique, they will try their best, seek help from many, refer to many things and finally it ends up in merry when they succeed in running it. I have been learning SQL for the past 50 days but I could not have a hands on experience till today. I decided to somehow run SQL today, and the reason I am on FC4 made me to go in for MySQL. My Window’ian friends have always been complaining that I am becoming more into Open source softwares / Linux there days, and to add fire into that burning fuel I wanted to successfully run MySQL :DI began the endeavor by first installing MySQL server using the Add/Remove programs option. After successfully installing MySQL, I searched the Main Menu for a MySQL option. Not finding them there ( I know where to go now ;) ) I opened up the terminal and typed ‘mysql’. To make me smile, MySQL started up and showed me ‘ mysql> ‘ prompt. As I assumed to have successfully got into MySQL, i tried my first command straight away !

mysql > CREATE TABLE PDATA (NAME CHAR(10), PHONENUM CHAR(10));

Like hitting me in the head, it said ” Error: No database found”. I resolved to use the help to find something

mysql> help

The help gave me many commands but there wasn’t one how to create a database. Luckily I had my LinuxGuru on line, so IM’d him to find what to do. He said I have to create a database using,

$ mysqladmin create data_base

It created the corresponding database “data_base” and gave me the result ” Query OK, 0 rows selected (0.01 sec) “. I again assumed the process has ended and I can go on with creating tables, issuing the CREATE TABLE statement. To my surprise again got an error message but this time as ” Permission denied to access database as @localhost”.

This time he suggested me to refer the MySQL site for help. Then I created the required permission for me to login as parth@localhost and access the MySQL server. Then I again tried to login as user, but still wasn’t able to as it needed a slightly different command. Finally, after again referring to the MySQL Site I was able to finally start MySQL as user and create tables and insert data into it.

The entire procedure for a first-time-run of MySQL is as follows,

1. Loging in as ‘root’ or obtaining root permission with ’su’, issue the following command at shell,

[root@localhost]$ mysql –user=root mysql

mysql > GRANT ALL PRIVILEGES ON *.* TO ‘user_name’@'localhost’
IDENTIFIED BY ‘passwd’ WITH GRANT OPTION;

This assigns ‘all’ privileges to the user ‘user_name@localhost’ who can be identified and can access mysql using the password ‘passwd’.

2. We have to create a database for the user to use, by issuing the following command as root ( or su ),

[root@localhost]$ mysqladmin create user_database

which will give the reply as ” Query OK, 0 rows affected (0,01 sec) ” on successful creation of the database.

3. Login as user by issuing the following command in the shell,

[user_name@localhost]$ mysql –user=user_name –password=passwd

The welcome text will indicate your successful login: “Welcome to MySQL Monitor.” and you will get the ‘mysql’ prompt.

4. Now, we have to change the database into ours by issuing the following command,

mysql > USE user_dbase

which will be confirmed with “Database changed”.

5. Now, you can issue the MySQL statements at the ‘mysql’ prompt and your ‘user-dbase’ will be the used database.

To Create Table : mysql > CREATE TABLE PDATA (NAME CHAR(10), PHONENUM CHAR(10));To add data into the table : mysql > INSERT INTO PDATA (NAME , PHONENUM) VALUES ( Name , 9880098800 );

To view the table : mysql > SELECT * FROM PDATA;