Thursday, May 10, 2012

Connecting Internet in Ubuntu using mobile as modem via bluetooth or datacable





When I installed Ubuntu 8.04 in my computer I found no way to connect internet using my mobile as modem via bluetooth. So I switched to XP and googled some forums and found the solution.
I think this might be much useful for new users.
To know how

Here the things i used.
1) Ubuntu 8.04
2)Airtel Mobile Office
3)Nokia 6600 also i checked with Nokia N72 and Moto L6i mostly all are working.

Here are the things you should do it may look like a long process but all can do it !
For users who are using bluetooth:
1: Switch on bluetooth on your phone and the computer. Make both your computer and phone visible to other devices.
2: Do a search from Ubuntu for bluetooth devices near you. For this, you need to do as follows:
application > accessories > terminal (it is like cmd in XP)
Give the command :
sudo hcitool scan
It will ask password you just enter it but no * or dot will appear in screen so give your password with out any mistake and press enter
After sometime you will get the list of devices with their device address (also called as MAC address) and the device name. . . It will look something like:
12:12:12:12:12:12 PhoneName
Number may vary from phone to phone after that MAC address your phone’s bluetooth name will appear
Note down the device address of your phone (it will appear the place of the 12:12:12:12:12:12 , but in a similar format). You will need to use it later.
3: Now, you need to find which channel on your phone is assigned to what service on the phone. For this you will need to browse the device services. To do this, pass the following command:
sudo sdptool browse 12:12:12:12:12:12
NOTE: Replace 12:12:12:12:12:12 with your phone address.
You will get something like this:
Code:
Browsing 00:18:13:47:13:BE .
Service Description: Sony Ericsson W810
Service RecHandle: 0×10000
Service Class ID List:
“PnP Information” (0×1200)
Service Name: OBEX SyncML Client
Service RecHandle: 0×10001
Service Class ID List:
UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 1
“OBEX” (0×0008)
Service Name: Dial-up Networking
Service RecHandle: 0×10002
Service Class ID List:
“Dialup Networking” (0×1103)
“Generic Networking” (0×1201)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 2
Profile Descriptor List:
“Dialup Networking” (0×1103)
Version: 0×0100
Service Name: Serial Port
Service RecHandle: 0×10003
Service Class ID List:
“Serial Port” (0×1101)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 3
Service Name: HF Voice Gateway
Service RecHandle: 0×10004
Service Class ID List:
“Handfree Audio Gateway” (0x111f)
“Generic Audio” (0×1203)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 4
Profile Descriptor List:
“Handsfree” (0x111e)
Version: 0×0101
Service Name: HS Voice Gateway
Service RecHandle: 0×10005
Service Class ID List:
“Headset Audio Gateway” (0×1112)
“Generic Audio” (0×1203)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 5
Profile Descriptor List:
“Headset” (0×1108)
Version: 0×0100
Service Name: OBEX Object Push
Service RecHandle: 0×10006
Service Class ID List:
“OBEX Object Push” (0×1105)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 6
“OBEX” (0×0008)
Profile Descriptor List:
“OBEX Object Push” (0×1105)
Version: 0×0100
Service Name: OBEX File Transfer
Service RecHandle: 0×10007
Service Class ID List:
“OBEX File Transfer” (0×1106)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 7
“OBEX” (0×0008)
Profile Descriptor List:
“OBEX File Transfer” (0×1106)
Version: 0×0100
Service Name: OBEX IrMC Sync Server
Service RecHandle: 0×10008
Service Class ID List:
“IrMC Sync” (0×1104)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 8
“OBEX” (0×0008)
Profile Descriptor List:
“IrMC Sync” (0×1104)
Version: 0×0100
Service Name: NAP service
Service Description: NAP description
Service RecHandle: 0×10009
Service Class ID List:
“Network Access Point” (0×1116)
Protocol Descriptor List:
“L2CAP” (0×0100)
PSM: 15
“BNEP” (0x000f)
Version: 0×0100
SEQ8: 0 6
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“Network Access Point” (0×1116)
Version: 0×0100
Service Name: Mouse & Keyboard
Service Description: Remote Control
Service Provider: Sony Ericsson
Service RecHandle: 0x1000a
Service Class ID List:
“Human Interface Device” (0×1124)
Protocol Descriptor List:
“L2CAP” (0×0100)
PSM: 17
“HIDP” (0×0011)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“Human Interface Device” (0×1124)
Version: 0×0100
4: We need to see which channel is assigned to the service “Dial Up networking”. Do not be worried by the long output. It is easy to find it.
In the above output (in the code box), search for the lines which say “Service Name” and find the one which says “Dial Up networking”. You can see that in the above output, the area below matches our requirements:
Quote:
Service Name: Dial-up Networking
Service RecHandle: 0×10002
Service Class ID List:
“Dialup Networking” (0×1103)
“Generic Networking” (0×1201)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 2
Profile Descriptor List:
“Dialup Networking” (0×1103)
Version: 0×0100
In this entry, the channel number is given. We see that the channel is ’2′ (as shown by the line Channel : 2).
Note down the channel number. We will need in the next step.
5: Now you have all the required information for the work to be done. Now you need your computer to recognize the phone as the modem. for this, pass the following command:
Code:
sudo rfcomm bind 0 12:12:12:12:12:12 2
Remember to replace the address 12:12:12:12:12:12 with your device address and the number ’2′ at the end with the channel number you will get for YOUR phone.
Now skip to “Common to both using bluetooth and datacable” area below
For Datacable users:
1: Connect the data cable to the phone.
2: Some phones as for selection of modes e.g. nokia phones ask to select either the data mode or PC suite mode and Sony Phones ask to select either the ‘file transfer’ mode or ‘phone mode’. Select the one which you use on Windows to connect to internet (on nokia it is PC suite mode or Nokia mode and on Sony phones it is ‘phone mode’). Wait for 2-3 seconds to get the device detected by Ubuntu.
3: launch the terminal (application > accessories > terminal (it is like cmd in XP) ) and switch to root by passin
g the command: su . Enter the password and you will get the # prompt.
give the following command
cd /
4: go to the /dev directory by passing the command:
cd dev
5: Check for the ttyACM devices. issue the command :
ls ttyACM*.
It should show either ttyACM0 or ttyACM1 as output.
NOTE: If it does not show any output, then your phone is not detected !
6: Note the output which is mostly either ttyACM0 or ttyACM1.
Common to both using bluetooth and datacable:
So till now, you have made Ubuntu recognize the phone as a modem either via Bluetooth or via Data cable. Now you need to dial to connect to the internet.
For this you will have to copy the following as save it as /etc/wvdial.conf using the root account:
To do this give the following command:
sudo gedit /etc/wvdial.conf
if it asks for password give it.
A text editor will open with name wvdial.conf
copy the code below and save it:
[Modem0]
Modem = /dev/rfcomm0
Baud = 230400
SetVolume = 0
DialCommand = ATDT
FlowControl = Hardware(CRTSCTS)
[Modem1]
Modem = /dev/ttyACM0
Baud = 230400
SetVolume = 0
DialCommand = ATDT
FlowControl = Hardware(CRTSCTS)
[Dialer GPRS]
Username = 1
Password = 1
Phone = *99***1#
Mode = 1
Inherits = Modem0
[Dialer DATA]
Username =
Password =
Phone = *99***1#
Mode = 1
Inherits = Modem1
[Dialer Defaults]
Modem = /dev/rfcomm0
Baud = 230400
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”airtelgprs.com”
ISDN = 0
Modem Type = Analog Modem
Area Code =
Phone = *99***1#
Username =
Password =
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Force Address =
Idle Seconds = 3600
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1
Now when dialing via Bluetooth, give the following command:
sudo wvdial GPRS
When dialing via datacable give the following command:
sudo wvdial DATA
It will ask for the root password. Enter it and it should connect.
Main things:
1. Don’t close the terminal window if once connected. If you close, then net will be disconnected

2.Keep your browser in online mode to do this open Firefox

file> uncheck work offline
It is 100% working even I am posting this post using the internet connection which I made using the above method.
Any doubts please post your comments i will try to solve it.

Friday, April 15, 2011

Restore GRUB

GRUB is the default bootmanager in linux. It helps to choose the desired OS to boot on the booting stage.It shows a list of OS, so that we can choose anyone to boot. GRUB is so powerful that can understand the filesystem without booting the system.

The modern linux come with the latest GRUB and they recognize all the existing operating systems and add them into the list.

But the problem comes with the other OS like windowz. They dont believe that the system can have other OS too. They believe that they are the only OS in the earth.

In the dual boot machines, often the windows should be reinstalled because of various reasons. When we do the reinstallation of windows, it erases the GRUB which resides at MBR normally.

So, after re-installing windows, Most of newbies think that we have to re-install linux too. No. No. No. Linux never went out. It is safely in its partition only, until you deleted that partition.

Only the GRUB is washed out by windows. we can recover it easily.

Here are some ways to do it.

Needed Materials:
1. Any LiveCD or Live DVd like ubuntu, knoppix
or
The installation CD of your or any Distro.

Way – 1:

1. Pop in the Live CD, boot from it until you reach the desktop.

2. Open a terminal window or switch to a tty.

3. Type “grub”

4. Type “root (hd0,6)”, or whatever your harddisk + boot partition
numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for
grub).

5. Type “setup (hd0)”, ot whatever your harddisk nr is.

6. Quit grub by typing “quit”.

7. Reboot.

Way -2:

1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.

2. Open a Terminal. Go SuperUser (that is, type “su”). Enter root passwords as necessary.

3. Type “grub” which makes a GRUB prompt appear.

4. Type “find /boot/grub/stage1″. You’ll get a response like “(hd0)” or
in my case “(hd0,3)”. Use whatever your computer spits out for the
following lines.

5. Type “root (hd0,3)”.

6. Type “setup (hd0)”. This is key. Other instructions say to use
“(hd0)”, and that’s fine if you want to write GRUB to the MBR. If you
want to write it to your linux root partition, then you want the number
after the comma, such as “(hd0,3)”.

7. Type “quit”.

8. Restart the system. Remove the bootable CD.

Way – 3:

1. Boot with any live CD (I’ve done it with Knoppix 3.x and Ubuntu)

2. Get a root shell and make a folder (mkdir ubuntu)

3. mount the root (/) partition of ubuntu (e.g. mount /dev/hdb ubuntu if you have two disks)

4. chroot the mounted partition (chroot ubuntu)

5. grub-install /dev/hda

5. Exit the shell

6. Reboot

Try any of the three ways.

There may be also so many ways to do this same thing. Try yourself and keep learning.

Setting up LAMP on your Ubuntu desktop

Many of you must be wanting to try some web development and would like to setup their own LAMP(Linux, Apache, MySQL, PHP/Perl/Python) stack. Ubuntu has a special Server Edition for setting up your own LAMP server, most of you may want to install it on your desktop (I like it that way).

This involves installing Apache, PHP, Python and MySQL. I think
Python will be installed by default and we only need to install
mod_python for Apache. I use Ubuntu Edgy Eft 6.10.

Apache 2

Apache is the most popular web server and I use it for my
development work. Apache 2 can be installed by running this command in
the terminal.

sudo apt-get install apache2

All your files should be placed in the /var/www/ folder to be viewed from your server.

PHP5

PHP is on version 5 and can be installed by running

sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart

You can easily test whether you have correctly installed PHP by writing a simple test file.

gksudo gedit /var/www/testphp.php

This will open a text editor and here insert this line. There should
be no space between < and ?. WordPress inserts a space in between. < ?php phpinfo(); ?>

Point your browser to http://localhost/testphp.php

MySQL Server

Next install MySQL server

sudo apt-get install mysql-server

MySQL by default allows connections only from 127.0.0.1 i.e., only
from your own computer. This is ok if you are developing only on your
own system. If you want to access your MySQL server from a network,

gksudo gedit /etc/mysql/my.cnf

Find the line bind-address = 127.0.0.1 and comment it. Comments start with ;(semicolon).

If you want to set a different password to your MySQL server (than the default none),

mysqladmin -u root password your-new-password
mysqladmin -h root@local-machine-name -u root -p password your-new-password
sudo /etc/init.d/mysql restart

Install MySQL for Apache

sudo apt-get install libapache2-mod-auth-mysql sudo apt-get install php5-mysql
sudo apt-get install phpmyadmin

After this, you have to enable the MySQL extension in your php.ini. Edit the file

gksudo gedit /etc/php5/apache2/php.ini

Here uncomment the line “;extension=mysql.so”

extension=mysql.so

After this restart Apache 2

sudo /etc/init.d/apache2 restart

Python

Python for Apache can be installed by installing the libapache2-mod-python package.

sudo aptitude install python
sudo aptitude install libapache2-mod-python

Javascript trick to edit the page displayed

Goto any website and paste

javascript:document.body.contentEditable='true';
document.designMode='on'; void 0

in the address bar.

Now you can edit anything in that page. Really cool trick.

Source:
http://fslog.com/2007/01/21/javascript-trick-to-edit-the-page-displayed/

Wednesday, March 16, 2011

Open source

Introduction

Open source doesn't just mean access to the source code. The distribution terms of open-source software must comply with the following criteria:

1. Free Redistribution

The license shall not restrict any party from selling or giving away the software as a component of an aggregate software distribution containing programs from several different sources. The license shall not require a royalty or other fee for such sale.

2. Source Code

The program must include source code, and must allow distribution in source code as well as compiled form. Where some form of a product is not distributed with source code, there must be a well-publicized means of obtaining the source code for no more than a reasonable reproduction cost preferably, downloading via the Internet without charge. The source code must be the preferred form in which a programmer would modify the program. Deliberately obfuscated source code is not allowed. Intermediate forms such as the output of a preprocessor or translator are not allowed.

3. Derived Works

The license must allow modifications and derived works, and must allow them to be distributed under the same terms as the license of the original software.

4. Integrity of The Author's Source Code

The license may restrict source-code from being distributed in modified form only if the license allows the distribution of "patch files" with the source code for the purpose of modifying the program at build time. The license must explicitly permit distribution of software built from modified source code. The license may require derived works to carry a different name or version number from the original software.

5. No Discrimination Against Persons or Groups

The license must not discriminate against any person or group of persons.

6. No Discrimination Against Fields of Endeavor

The license must not restrict anyone from making use of the program in a specific field of endeavor. For example, it may not restrict the program from being used in a business, or from being used for genetic research.

7. Distribution of License

The rights attached to the program must apply to all to whom the program is redistributed without the need for execution of an additional license by those parties.

8. License Must Not Be Specific to a Product

The rights attached to the program must not depend on the program's being part of a particular software distribution. If the program is extracted from that distribution and used or distributed within the terms of the program's license, all parties to whom the program is redistributed should have the same rights as those that are granted in conjunction with the original software distribution.

9. License Must Not Restrict Other Software

The license must not place restrictions on other software that is distributed along with the licensed software. For example, the license must not insist that all other programs distributed on the same medium must be open-source software.

Monday, February 21, 2011

Fake Office - காட்டிக்கொடுத்த மைக்ரோசாஃப்ட்! பட்டையைக் கிளப்பிய Zoho!!


சமீபத்தில் மைக்ரோசாஃப்ட், தன்னுடைய Cloud Computing புரோகிராம்களைப் பற்றி பேசும்போது , சும்மா இல்லாமல் கூகிள் அப்ஸ், Zoho, Zimbra போன்ற ”Fake Office” வசதிகளை கொடுக்கும் எவரும் மைக்ரோசாஃப்ட் ஆஃபீசுக்கு மாற்றாக வர முடியாது என்று தம்பட்டம் அடித்துக் கொண்டது.

இன்னும் சொல்லப்போனால் கூகிள் டாக்ஸ் வழங்கும் Docs, Spreadsheets, Presentation ஆன்லைன் அப்ளிகேஷன்கள் போல் மைக்ரோசாஃப்ட் இன்னும் எதையும் அதிகாரபூர்வமாக வழங்கவில்லை.

2010 வருட முதல் பாதியில்தான், கூகிள் டாக்ஸ் போன்ற ஆன்லைன் ஆஃபீஸ் அப்ளிகேஷன்களை மைக்ரோசாஃப்ட் அளிக்க இருக்கிறது.

Zoho. Com, கூகிள் டாக்ஸ் போன்று
Zoho CRM,
Zoho Recruit,
Zoho Invoice உட்பட நிறைய ஆன்லைன் அப்ளிகேஷன்களை உருவாக்கி தனக்கென்று ஒரு நல்ல பேர் வாங்கி இருக்கிறது.


மைக்ரோசாஃப்டின் இந்த கருத்துக்கு Zoho-வின் பதிலடி முற்றிலும் எதிர்பாராத வகையில் இருந்தது.

”ஆஹா! ஆஹா!! நாங்க Fake Office-னு மைக்ரோசாஃப்டே மெடல் கொடுத்துவிட்டது! இது எங்களுக்கு பெரிய அங்கீகாரம் தெரியுமா!” என்று Zoho CEO தன் கம்பெனி ப்ளாகில் சந்தோஷப்பட்டுக் கொண்டார்.

மேலும் அவர் “Zoho-வை பயன்படுத்த யாரும் காசு கொடுத்து சிடியோ டிவிடியோ வாங்க வேண்டாம். பெரிய சைஸ் ஃபைல் எதுவும் டவுன்லோடு செய்து இன்ஸ்டால் செய்ய வேண்டாம். நூற்றுக்கணக்கான டாலர்கூட கொடுக்கத் தேவையில்லை. ”

”Zoho.com போய் லாகின் செய்தாலே போதும். உடனே எல்லா அப்ளிகேஷன்களையும் பயன்படுத்த துவங்கிவிடலாம்.”

”அதனால்தான் மைக்ரோசாஃப்டுக்கு நாங்கள் Fake Office-ஆக தெரியுது. ”

”ஒருவர் தனது ஃபீல்டில் முதலிடத்தில் இருக்கிறார் என்பதாலேயே, மற்ற போட்டியாளர்களை Fake என்று சொல்வது சரியென்றால், நாங்கள் ஒரு விஷயத்தை சொல்லிக்கொள்ள விரும்புகிறோம்.”

”Search-ல் கூகிள் முதலிடத்தில் உள்ளது. அதனால் உங்கள் Bing-ஐ “Fake Search" என்று பெயரிட்டு அழைத்தால் சரியாக இருக்குமா?”


மைக்ரோசாஃப்ட் MS-Office-ல் 90% ஆபரேடிங் லாபம் அடிப்பதாகவும் அவர் சொல்லி இருக்கிறார்.

அத்தோடு விட்டார்களா Zoho.com?

ட்விட்டரில் இதற்கு என்று ஒரு பக்கம்
http://twitter.com/fakeoffice

FakeOffice.Org என்று ஒரு வெப்சைட்.

Fake Office - The movie என்று ஒரு இசை டாக்குமென்டரி என்று பட்டையை கிளப்பிவிட்டார்கள்.



அந்த ட்விட்டர் பக்கத்தை பார்த்தால் ”மைக்ரோசாஃப்ட் Zoho-வை Fake office என்று சொல்கிறது. அப்படி என்றால் மைக்ரோசாஃப்டின் Zune மீடியா பிளேயரை எப்படி அழைப்பது? ” என்று ஒரு ட்வீட் கேட்கிறது.

”இதுதான் Fake office-னா எனக்கு இன்னும் நிறைய வேண்டும்”- இப்படியும் ஒரு குரல்.

இந்தக் கூத்து, Zoho.com பற்றி தெரியாதவர்கள்கூட Zoho-வை பற்றி தெரிந்துகொள்ள ஒரு விளம்பரமாக அமைந்துவிட்டது,Zoho.com CEO ஒரு தமிழர்.

பெயர் ஸ்ரீதர் வேம்பு.

ஓஹோ! Zoho என்றாலே மைக்ரோசாஃப்டுக்கு வேம்பா கசக்க இந்த பேர்கூட காரணமாக இருக்குமோ?