December 29, 2008

Connecting to the Internet on Ubuntu Linux using GPRS, Bluetooth enabled mobile

Mobile phones can act as a gateway between our computer and the Internet. In this post I will discuss how to connect your computer(with Ubuntu 8.10 Interpid Ibex as operating system) to the Internet using a mobile phone(Nokia, Sony Ericsson, Treo etc.) with Bluetooth and GPRS functionality.

To make the connection, we first need to setup a link between mobile phone and Ubuntu system. Steps:

Discovering the mobile phone
We
will use hcitool utility to discover the mobile phone. First of all, TURN ON the bluetooth on both mobile phone and computer. Then launch the Terminal from Applications->Accessories->Terminal. Now type the following:

mohit@mohit-laptop:~$ hcitool scan
Scanning ...
00:16:BC:F4:6E:EF mNokia

Note down the address of your mobile, in my case it was 00:16:BC:F4:6E:EF.

Adding the mobile device to /etc/bluetooth/rfcomm.conf
We will now add an entry for our mobile phone in /etc/bluetooth/rfcomm.conf. Open the rfcomm.conf using the command given below.

mohit@mohit-laptop:~$ sudo vim /etc/bluetooth/rfcomm.conf

Now, we have to specify our mobile phone's address ( which we found in the previous step using hcitool scan)
My rfcomm.conf looks like this:

rfcomm0 {
bind yes;
# Bluetooth address of the device
device 00:16:BC:F4:6E:EF
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "Nokia";

}

Making the connection
Use the command sudo rfcomm bind rfcomm0 to make the connection. Now we have a modem on /dev/rfcomm0

Creating some PPP Scripts
First of all we will create a chatscript
/etc/chatscripts/BluetoothPhone. Here APN should be replaced with the Access Point Name that the service provider uses. In my case it is "airtelgprs.com".

TIMEOUT 10
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'ERROR'
SAY 'Starting GPRS connect script\\n'

# Get the modem's attention and reset it.
"" 'ATZ'

# E0=No echo, V1=English result codes
OK 'ATE0V1'

# Set Access Point Name (APN)
SAY 'Setting APN\\n'
OK 'AT+CGDCONT=1,"IP","airtelgprs.com"'

# Dial the number
ABORT 'NO CARRIER'
SAY 'Dialing...\\n'
OK 'ATD*99***1#'
CONNECT ''

Second, we have to create /
etc/chatscripts/BluetoothPhone-Disconnect

""      "\\K"
"" "+++ATH0"
SAY "GPRS disconnected."

Finally, we have to create /etc/ppp/peers/BluetoothPhone

/dev/rfcomm0 # Bluetooth modem
115200 # speed
defaultroute # use the cellular network for the default route
usepeerdns # use the DNS servers from the remote network
nodetach # keep pppd in the foreground
crtscts # hardware flow control
lock # lock the serial port
noauth # don't expect the modem to authenticate itself
local # don't use Carrier Detect or Data Terminal Ready
replacedefaultroute
debug

# Use the next two lines if you receive the dreaded messages:
#
# No response to n echo-requests
# Serial link appears to be disconnected.
# Connection terminated.
#
lcp-echo-failure 4
lcp-echo-interval 65535

connect "/usr/sbin/chat -V -f /etc/chatscripts/BluetoothPhone"
disconnect "/usr/sbin/chat -V -f /etc/chatscripts/BluetoothPhone-Disconnect"

Connecting to the Internet
Now to connect to the Internet, type the command sudo pppd call BluetoothPhone. Internet can be disconnected anytime by pressing Ctrl+C.

December 28, 2008

About Me

Who are you?
I'm Mohit Soni. I started hacking computers at the age of 10 with my PC. My exploration of computers started with Microsoft Windows 98 and QBasic. I continued my computer journey  with Visual C++ 6.0. I also spent significant time with Visual Basic 6.0 and Visual Foxpro 6.0. I am now quite comfortable with Java, PHP, C, C++.
I started hacking GNU/Linux when I was 17, with Ubuntu 6.06. But now, I am an avid openSUSE user and fan.

May 25, 2008

openSUSE a Linux by Novell

OpenSUSE is an amazing Linux distribution by Novell. As the name implies OpenSUSE is free to use and distribute. OpenSUSE can be downloaded from openSUSE's website.

The best thing about openSUSE are as follows:

1. Installation: The openSUSE team has done a considerable work at it. The openSUSE installer provides optimum partition layout by default. It recognizes available empty partition and then provides a layout that suits the scenario. Most of the time users can accept the default layout and can proceed with the installation.

2. Desktop Environment: OpenSUSE gives its users to choose between various desktop environments including GNOME and KDE. Both GNOME and KDE are configured by the openSUSE team to be more user friendly.

3. Application Base: OpenSUSE comes with a rich application base to support a wide range of users.

I am using openSUSE since January, 2008 with Windows Vista in a dual boot configuration and we all are happy(Me, Windows and OpenSUSE :) ).

If you are looking for a Linux distribution that is safe to install, use and maintain then I think you should get your hands dirty with OpenSUSE.

April 10, 2008

Portable Python

Portable Python is a portable programming environment that is preconfigured to run from a portable device. Portable python includes:
Portable Python comes as a standalone zip package that contains python for windows and other utilities. Just download Portable Python, and unzip it to your portable device.
As Portable Python is preconfigured you can start out instantaneously with your Python Application.
Now, just plug-in your portable device in any windows system, and start working on your python application.

April 9, 2008

Google App Engine

Google’s new landmark in the devsphere is Google’s App Engine.

App Engine web applications will:

  • Be reliable
  • withstand heavy loads
  • handle large amount of data

App Engine applications will be programmed in Python initially. But Google promises to provide support for more languages in future.

App Engine can be downloaded from Google App Engine Site.

According to me, App Engine will definitely bring more developers under Python Camp. Also, the blogosphere is flooded with people who say that App Engine will definitely expand Google’s Internet.

February 17, 2008

Installing Ubuntu 7.10 Gutsy Gibbon with Vista installed first(Dual Boot)

Ubuntu 7.10 better known as Gutsy Gibbon runs perfectly with Windows Vista in a dual boot configuration. So, to install Ubuntu you have to follow the steps given below.
1. Download the installation media from http://www.ubuntu.com/ or obtain it from your nearest LUG or get it from someone who has the installation media.
2. It will be a good idea to back up your data before proceeding with the installation.
3. So, log on to windows and back up your data.
4. When finished insert the installation media into your DVD or CD drive and reboot.
NOTE : I hope you have already configured your boot sequence so that computer boots from DVD/CD drive before Hard drive.
5. You will get a UBUNTU splash screen.
6. Select the first option from the menu which says that you have to install Ubuntu.
7. Wait while the ubuntu desktop loads.
8. Double click on the Install icon present on the desktop, an installation wizard will open.
9. Select your language, key board layout and time zone.
PARTITIONING:
CASE I: If you already have an empty partition(atleast 10 GB) then select it and press the edit partition button. Select the filesystem as ext3 and mount point as '/' and apply changes. It will take some time. Once the process is completed select the same partition and edit it. Enter the new partition size as atleast 512 mb less then the current size. Click on apply. Wait while the process is not finished. Now, select the new partition and edit it. Select the filesystem as 'swap'. Apply changes.
Once finished, check on the ext3 partition and press next.
CASE II: If you want to take out the space from the windows partition.
Select the windows partition and edit it. Enter the new size as atleast 10 GB less then the current size. Apply changes. Select the newly created partition and follow the procedure given above in CASE I.
10. Now you can proceed with the installation.

February 15, 2008

Increasing the Performance of Linux Kernel by Tweaking the CPU configuration

The default installation of Linux installs a generic kernel. The generic will compromise compatibility with speed. In order to increase the we have to specify manually the processor installed on board. Doing so will help in increasing the performance of the kernel.

So, let's start. (You must have installed the kernel source in order to proceed further)
1. Start your terminal or shell.
2. Go to the filesystem root folder i.e. '/' folder.
3. cd /usr/src/kernels
4. Now open the folder containing your kernel source.
5. Pick one of the following:
  • make config (Bash shell script)
    make menuconfig (uses text window curses)
  • make xconfig
  • make oldconfig

6. Select Processor type and features and then select Subarchitecture Type and then check the appropriate choice.
(X) PC-compatible
( ) AMD Elan
( ) Voyager (NCR)
( ) NUMAQ (IBM/Sequent)
( ) Summit/EXA (IBM x440)
( ) Support for other sub-arch SMP systems with more than 8 CPUs
( ) SGI 320/540 (Visual Workstation)
( ) Generic architecture (Summit, bigsmp, ES7000, default)
( ) Support for Unisys ES7000 IA32 series

7. Then select Processor family and select the processor installed on your system.

8. Save and exit.

9. Reboot the machine.

(NOTE: The list given above may vary.)

Installing nvidia driver on fedora 8

Fedora 8 doesn't come with nvidia or ATI drivers preinstalled. So in order to fully utilize the 3D features of Fedora 8, you have to install the respective drivers of your graphic card. Fedora's 3D features will work fine with pre-installed Intel GMA.

Steps:

1. Start your web browser and open http://www.nvidia.com/page/drivers.html.
2. Be patient while the page loads.
3. Select your Product Type, Product Series, Product from the drop down boxes.
4. Select your operating system as Linux( again 32 bit or 64 bit depending on your OS).
5. Select search.
6. Download the link given in Step 2 labeled Download.
7. Once downloaded saves all your work and get ready to leave the graphical world.
8. Press CTRL + ALT + F1 to enter in the command mode.
9. Go the directory where you have saved the driver file.
10. Type sh followed by the driver file name.
11. Follow the instructions that follow.
12. Once the installation is completed, type reboot and press enter to reboot the machine.