How to use Celcom Broadband Prepaid on Ubuntu Linux

Here’s how to use the latest Celcom offering – Celcom Broadband Prepaid on Ubuntu GNU/Linux distribution. As its name implies, Celcom Broadband Prepaid works in a prepaid basis, using the following plan: RM 6 /day or RM20/week of unlimited internet use.

Celcom Broadband Prepaid

This guide assumes you use Huawei E160* or E220 series 3G modem.

First, plug-in the 3G modem to USB connector. After a while, a dialog will appear :

Ubuntu Wizard : Celcom Broadband

Press next, you will see a list of local broadband service provider. Select “Celcom”.

Ubuntu Wizard :Service Provider Selections

The dialog will close after you click “Forward”. However for Celcom Broadband Prepaid to work, you need to change the APN to “celcom3g”, and PIN to “1234”

To do that, you need to right click on the network connection icon, and select “Edit Connections”:

Edit Connections - Network Manager

Then change the APN value to “celcom3g” and set the PIN to “1234”.

Network Manager - Celcom Broadband 3G Prepaid Setup

Sending SMS to subscribe Celcom Prepaid Broadband
Users of Celcom Broadband Prepaid would know that they need to send SMS containing the message “Broadband Daily” or “Broadband Weekly” to 28882 to activate their internet subscription.

In order to do that in Ubuntu GNU/Linux, you need to install ‘gammu’ package from Synaptic Package Manager. ‘gammu’ allows you to send SMS using your Huawei 3G Modem, and it works sweetly with Celcom Broadband Prepaid.

Using ‘gedit’ or your favorite text editor, create ~/.gammurc config file containing these information :
[python]
[gammu]
port = /dev/ttyUSB0
model =
connection = at19200
synchronizetime = yes
logfile = gammu.log
logformat = textall
use_locking =
gammuloc =
[/python]

To send SMS, you need to open the terminal application and type “gammu sendsms text 28882”, it should look like this :
[python]
$ gammu sendsms text 28882
Enter message text and press ^D:
Broadband weekly
If you want break, press Ctrl+C…
Sending SMS 1/1….waiting for network answer..OK, message reference=33
[/python]

Note: “Broadband weekly” for subscribing Celcom Broadband Prepaid at RM20/week.

Then send another SMS, execute “gammu sendsms text 28882” :
[python]
$ gammu sendsms text 28882
Enter message text and press ^D:
Broadband Yes
If you want break, press Ctrl+C…
Sending SMS 1/1….waiting for network answer..OK, message reference=33
[/python]

Send “Broadband Yes”, to confirm your subscription. You can then enjoy the Celcom Broadband Prepaid right from your Ubuntu Desktop ! No need to depend on Microsoft Windows based “Mobile Partner” or Vodafone striped-down application to connect to the internet!

To read sms from your Celcom Broadband Prepaid SIM card, type “gammu getsms folder 1 15” and you will see a list of SMS received in your SIM card inbox memory.
[python]
$ gammu getsms folder 1 10
Location 1, folder “Inbox”, SIM memory, Inbox folder
SMS message
SMSC number : “+60193900000”
Sent : Sun 05 Jul 2009 06:48:50 PM +0800
Coding : Default GSM alphabet (no compression)
Remote number : “28882”
Status : Read

Enjoy 24hrs of unlimited usage @ only RM6. To confirm yr subscription, type Broadband Yes & send to 28882. RM6 will be charged to yr account upon confirmation.

Location 2, folder “Inbox”, SIM memory, Inbox folder
SMS message
SMSC number : “+60193900000”
Sent : Sat 19 Sep 2009 04:01:24 PM +0800
Coding : Default GSM alphabet (no compression)
Remote number : “28882”
Status : UnRead

Enjoy 7days of unlimited usage @ only RM20.To confirm yr subscription, type Broadband Yes & send to 28882.RM20 will be charged to yr account upon confirmation.
[/python]

Happy surfing !

How to block ads and malware websites using /etc/hosts files in Ubuntu

Here’s an easy way to block annoying advertisement and malware sites using ‘/etc/hosts’ file.

First edit the /etc/hosts files using your favorite text editor :

sudo gedit /etc/hosts

Then, paste the list of ads/malware servers in the ‘hosts’ file. You can get the list from http://someonewhocares.org/hosts/ or by searching through Google.

Close the file, and Save. The change will take effect immediately after that. One of the side-effect from this modfication is that your web surfing experience would be significantly faster because your browser does not have to wait for the annoying advertisement to load.

MultiGet – a multithread download manager for Ubuntu Linux desktop

It’s extremely frustrating to have your download progress interrupted, especially when you are downloading several (relatively large) files over the Internet. Fortunately, there’s MultiGet, a download manager that supports multi-connection and parallel downloads.

MultiGet is easy to user, and from my observation, it’s interface closely resemble Flashget download manager from Microsoft Windows platform. The differences is, that MultiGet runs natively on Linux, and it supports multiple operating system too.

MultiGet has a simple, friendly user interface that is easy to use. Best of all, it supports batch task downloading.

MultiGet Screenshot

MultiGet Screenshot Ubuntu

MultiGet is available from Ubuntu universe respository

How to Embed Web Browser in Python GTK application using pymozembed

Embedding web browser or a screen for parsing HTML is easy in PyGTK. You only need to import the pymozembed, and add a few lines of code in your pygtk library, and you are set to go.

Here’s a sample PyGTK application that embeds a web-browser as well as a “Back” button for demonstration purpose :

PyGTK + browser Screenshot
PyMozEmbed PyGTK+ Mypapit Demo

[python]
#!/usr/bin/python
#
# demo by mypapit (info@mypapit.net) – Sept 2009
# http://blog.mypapit.net/
#
import pygtk
pygtk.require(‘2.0’)
import gtk
import gtkmozembed

class PyMoz:

def delete_event(self,widget,data=None):
print(“Exit”)
return False

def destroy(self,widget,data=None):
gtk.main_quit()

def button_clicked(self,widget,data):
data.go_back()

def __init__(self):
#init mozembed
self.moz = gtkmozembed.MozEmbed()
#create a Vertical Box Container to whole the browser
#and the “Back Button”
box = gtk.VBox(False,0)

#create a basic GTK+ window
win = gtk.Window()
win.add(box)

#create and connect “Back” button, to add functionality
self.button = gtk.Button(“Back”)
self.button.connect(“clicked”,self.button_clicked,self.moz)

#include both back button and the browser in the vertical box
#and the GTK+ window
box.pack_start(self.button,False,False,0)
box.pack_start(self.moz,True,True,0)

#load the URL
self.moz.load_url(‘http://blog.mypapit.net/’)

#set the window title
title=self.moz.get_title()
win.set_title(“browser demo”)

#show all the stuffs on screen
win.show_all()

#connect the delete_event and destroy event to make sure
#the app quits when the window is closed
win.connect(“delete_event”,self.delete_event)
win.connect(“destroy”,self.destroy)

if __name__ == “__main__”:
PyMoz()
gtk.main()

[/python]

Download demo source code : pymoz.py

Working hard publishing papers and learning PyGTK

For the last few weeks I’ve been working hard to finish up my research project, most of it concerning about on mobile phone application usability and context-aware applications. This leaves me with less  time to devote for this blog and I started to realise that I might have a ‘burn-out’ issue at the same time.

I’m still using Ubuntu in my daily work if you are curious (Ubuntu Netbook Remix 9.04 for netbook) and Ubuntu Jaunty Jackalope for my Intel Core 2 Duo Desktop PC. Besides writing those research papers, I’ve use what left of my time to learn PyGTK to enable me to code RAD app for GNU/Linux desktop environment.

I found out the references around the internet regarding PyGTK is very helpful to aid me in understanding the GTK+ bindings in python, which is not much different from its C counterpart.

Now that I’ve some time to spare until Hari Raya, I’ll try to use that time wisely to fill up this blog with a couple more of fresh new posts. So, keep reading!