Wednesday, March 25, 2009

Flex Intro and advanced......

Hi All,

I would be posting some Flex Applications to my readers from today onwards.

Keep waiting.

PS: The first post on Flex would be tonight, March 25th, 2009.

Thanks,
Ananth Gouri

Sunday, March 22, 2009

Breathing space for Mulit OSes to boot

Hi All,

Many would have multiple Operating systems installed in your systems. When you install a new Linux or upgrade any OS, you may need to change the default time the GRUB (GrandUnified Boot Loader) has to wait to load the default OS.

Solution:

If your OS is Ubuntu, login to root or just follow these steps:
1. sudo vi /etc/grub/menu.lst
2. Search for the line Timeout 5
3. Give any integer value you want there, ex 1000 for 1000 seconds
or approximately 17 minutes.
4. Next time you login your system loads GRUB, it will wait for 1000 seconds.
5. There is another section called Default where you can set your default OS.

A post would be post to teach how to install and configure GRUB / LILO. Keep waiting

Friday, March 20, 2009

Problem with Slackware with SyncMaster

Hi All,

Problem: The GUI crashes in Slackware older versions (older than 11) for Samsung Syncmaster 17'' monitor.

Finer Details: I dont know how many of you still use the old monitors with a picture tube fixed to it. I meant that this is the age of LCD and Flat Screen monitors. But people like me who unfortunately could not pay to LCDs in the earlier years of 2000, and especially lucky to have got a Samsung SyncMaster, oh my.....

Solution: Slackware is known for stability. You may did not think that the recent Slackware 12.2 still uses KDE 3.5.x and not KDE 4.0

I refer here in this post to Slackware versions 10 and earlier to them.

I did install the OS as usual (For newbies dont try Slackware without guidance; I would be posting a Detail post of how to install Slackware. For people who cant wait, Get the March Month Issue LFY and do read the article that explains how to install Slackware 12.2. Thanks to Abhijit for a great writeup.).

In Slackware by default, the GUI does not pop up for logging. By GUI I mean the KDM or the GDM.
You have to login to root after install or create another user using the 'useradd' command. Then you have to use the command 'startx' or just 'X', which starts the Xsession of Xorg.

The Problem lies in:

The very moment you issue the command startx or X, the OS tries to load the GDM or KDM without success. This was a big problem to me especially using the Samsung SyncMaster, the series being 773 or so.

The solution lines:

Dont try to issue the command startx multiple times when the GUI load fails. Be careful, since you may burn your picture tube.

Try to restart your system.

Then when you again get the console login screen, do the following:

1. Login to root a/c.
2. Edit /etc/X11/xorg.conf by this command vi /etc/X11/xorg.conf
3. Go to the Screen section.
4. Find the lines Modes, Default Depth and Depth.
5. Try giving different Modes like "1240x840" , "1024x768" , "800x600", different Default Depths like 24, 16 and Different Depths like 16, 8 and so on until you succeed.
6. Then type startx or X. All the best for the GDM/KDM to start.

Please send me your Monitor details and the Slackware OS you are trying to use, if you face this peculiar problem. Then I will send you the exact configuration for these 3 values.

PS: Concepts taught to Ananth Gouri by Deepak, my Linux Guru, who is also a Java Developer in IGate.

Have a happy weekend,
Ananth Gouri

Thursday, March 19, 2009

MP3 on Fedora 10 using Fluendo MP3 Plugin

Hi All,

This post just describes how to get MP3 support to Fedora 10.

Fluendo is a website which provides codecs for Linux systems. Check out www.fluendo.com

In particular fortunately to all MP3 lovers, Fluendo provides free MP3 plugin.

Go to www.fluendo.com/shop/product/fluendo-mp3-decoder/.

Create an account and then download the plugin.

Installing is pretty simple.

Use this command as root:
rpm -i fluendo-codecs-mp3-7-1.i386.rpm

Thanks to many changes made at Fluendo.

The older plugin install procedure is also given below for your ref:

The file downloaded would be a zip file.

Just unzip it. In the unzipped folder you would find a .so file.

Copy paste this .so file as follows:

1. Login as root or issue the su command.
2. Go to your root's home folder and type ls -a.
3. Then you find a gstreamer plugin folder which is a hidden folder.
4. Find the plugins folder or something as input folder.
5. cp /from__folder/*.so /home/gstreamer/

Thats it you are done.

Enjoy MP3.

Also if possible try out Mandriva Spring 2008 with which Fluendo Plugin Manager is
provided.

Take care,
Ananth Gouri

Wednesday, March 18, 2009

Today the Date is Mar 18th, 2009

Hi All,

Just thought of posting my second post on Java before going to bed.

As you see from the title, you might have guessed that I would try to write a simple program that would print the Date. You are absolutely out of sync with my mind.

Ok coming to the point, if we write a program to do my fickle (I said you were out of sync) mind's problem, i.e to print today's date.....

The code a normal newbie of Java would do is:

import java.util.Calendar;
public class DatePrint {

public static void main(String[] args) {

Calendar cal = Calendar.getInstance();

System.out.println(cal.YEAR);
System.out.println(cal.MONTH);
System.out.println(cal.DAY_OF_MONTH);
}

}


If you have enough time, do run this program.

Guessing you did that, don't hit me if you did not get 2009, 3, 18.

Alright let me tell you that, the above code seems to be extremely beautiful and if you think that it yields amazing results, I am sorry.

Now just try to add the following 3 lines after the last syso (aka, System.out.Println):

System.out.println(cal.get(Calendar.YEAR));
System.out.println(cal.get(Calendar.MONTH));
System.out.println(cal.get(Calendar.DAY_OF_MONTH));


Note that the above 2nd syso would still print the value as 2, since March has the Integer value of 2 in Calendar class.

Hope now after this, you got the catch of mistake a newbie would do.

Now cheer up, come out of the world of newbie/fresher/inexperienced and et al.

Please do mail me if you in your Java newbie life ever did this mistake. It would be fun to post it.

Take care, Good night.

Connecting to a MS SQL Server which is older than version 7.0 using Java

Hi All,

This would be my first Java tweak in this blog.

Problem: Same as title.

Common Thought: There is a common thought by most of the Java Developers reading this blog. They may think what is the big deal in this.

Complexity is involved in: It is very common in Java to connect to the Oracle Databases. But as you see in the title, this post is about trying to connect to a MS SQL Server. People might think that this is also a very common problem solved by all Dev folks.

But as you see, things get complex if you want to connect to a MS SQL Server which is older than version 7.0.

Solution:

To solve this complexity, here comes jTDS.

"jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000 and 2005)", unquote from [1].

Once you get this driver (jar file) into your Eclipse/NetBeans IDE's project's build path, then the rest of it is known to you all.

Now I would just write a code that would connect to the MS SQL Server and just executes a "select" on a table.

Please note the Class.forName driver value. This is most important.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class MailAttachData {

static Connection con=null;
static
{
try
{
Class.forName("net.sourceforge.jtds.jdbc.Driver");
con = DriverManager.getConnection("jdbc:jtds:sqlserver://your_host_name:port number/table_name","userName","passwd");

}
catch(Exception e)
{
System.out.println(e);
}
}

public void getData()
{
String query = "select * from Contactid";
Statement statement = con.createStatement();
ResultSet rs = statement.executeQuery(query);

String emails = null;

while(rs.next())
{
emails = rs.getString(TABLE_COLUMN_INDEX #);
System.out.println(emails);
}

}

public static void main(String args[])
{
getData();
}
}


[1]: http://jtds.sourceforge.net/
Let me know your problems if you face any.

Let me know your feedbacks too.

Take care all. Keep visiting and waiting for some more posts.

Monday, March 16, 2009

What if your Windows never boots?

Hi All,

Finally, posting my first technical post to the world's most commonly faced problem.

Problem:

You login to your laptop and you find that your Windows XP is taking long time to startup. The problem exaggerates with finally the system crashing down. You have a HDD of 80 Gb with full data in it.

Extreme Thought:

You start getting the fear of - " What if all the 80Gb data is lost? "

Ananth Gouri Solution:

Many of us have faced this problem many times and we have never been able to think for a moment for the simplest solution readily available. Here comes in Linux from nowhere.

The easiest solution is to use a Bootable Linux CD like Ubuntu 8.10, or Knoppix. I would prefer to use SystemRescue CD. [The links to all the Linux OS are given at the end.]

Step by step procedure with Ubuntu:

1. Restart Windows.
2. Put Ubuntu Live CD in the DVD writer.
3. Login to the live system of Linux.
4. Mount the windows partition with the following commands:
ananth@ubuntu$ mkdir windowsDrive
ananth@ubuntu$ mount /dev/sda1 windowsDrive
5. Now your windows drive is mounted to your windowsDrive in Ubuntu.
6. Use the mouse and copy paste what all files required from your Windows to Linux.
7. But you would require an External HDD to move all the files to.
8. Or you can burn the data to a dvd after the content is mounted.

Note: For users with multiple windows partitions, create different folders and execute the commands in step 4.

In this way you back all your data too and can happily re-install your Windows.

This idea is known to many people around the world. But for me it was my assembler - Ananth Ram who gave me this idea.

After reading this blog post if you feel, "Why did not I get this idea?", don't worry because..........

Failure is the stepping stone to success.

Links :

1. www.ubuntu.com
2. www.knoppix.org
3. www.sysresccd.org
Thanks,
Ananth Gouri

This blog would contain.....

Hi All,

Ananth Blog 0.1

Starting off in a few days, this blog will contain articles about the following stuff:
1. Linux tweaks.
2. Java code snippets.
3. Hardware short tips.
4. Web Design and 3D design ideas.
5. Best OS Hunt

Keep visiting for more and more.

Depending upon the response from the readers, I may include the following too in the so called version 0.2 of Ananth Blog. the list will be revealed shortly. Keep waiting.

Thanks,
Ananth Gouri

Sudden change of blog address

Hi All,

I am really sorry for suddenly changing the blog address without an intimation. I sent out the link to folks all over and then I had to face a problem. Many people wanted to contribute to this blog. My lecturers, my friends, my cousins et al. Now that I had kept the name as Linuxgeek, I had to fore go a change and make it to something general that would suit the geekiness of my friends.

And many complained that, they were new to both linux and Java. So was this sudden change. Hope you all are happy with the change now.

Thanks,
Ananth Gouri

Sunday, March 15, 2009

Excitement the cause for second post on Day 1

I could not sleep before posting my second post for the day. This post would give much more info about me.

I started my Linux stuff with Fedora Core 1 way back in 2005 and then had a glimpse at Knoppix 3.1. Thanks to my mentor-friend BNK and to my system assembler Ananth Ram.

These 2 people gave me a kick off with a basic installation procedure of Linux. And from then on, it is no looking back. Now that I teach my gurus with the Linux stuff I do and keep them updated.

Playing with Linux has never been an easy road too. There have been times when I did not know what to check for a process status to the extreme cases of getting my Windows Drive formatted while installing Linux.

I will post more and more details about me and also meantime educate my readers with Linux freaks and of course on Java too.

I sign off this post by telling, use Linux and stop piracy.

Take care all.

Day 1 of LinuxGeek

Hi,

To all those folks who ever tried to visit my site, give me time, as this is my day 1 and am yet to plan things for my site.

About myself, I am a Linux freak / geek and have been using Linux for the past 4 years or so.

I have been trying to use Linux distros and my collection of Linux goes beyond 250+

I tried Debian 5 last and I am yet to try Mepis8 and Slackware 12.2.

Give me time to make this a wonderful site which will have lots of Java on Linux stuff.

Thanks for visiting,
Ananth Gouri