Get updates of completed torrents via SMS Part 2

The other day one of my friends Ankur , made a python script to get updates via sms using twitter account.
Check here :

I have changed the script to use Gmail SMTP instead .

import dbus,base64,urllib2,urllib
from dbus.mainloop.glib import DBusGMainLoop
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email import Encoders
import os

ver = "v1.0"
gmail_user = ""				                #Gmail Username

gmail_pwd  = ""					#Gmail Password
gmail_alias=" "+gmail_user                       #Gmail Nickname
gateway=""	# Check

def mailz(text):

    mail = MIMEMultipart()
    mail['From'] = gmail_alias

    mail['To'] = gateway
    mailServer = smtplib.SMTP("", 587)
    mailServer.login(gmail_user, gmail_pwd)
    mailServer.sendmail(gmail_user, gateway, mail.as_string())


s = dbus.SessionBus()
kt = s.get_object("org.ktorrent.ktorrent","/core")

def update(k):
        torrent = s.get_object("org.ktorrent.ktorrent","/torrent/"+k)
        name = torrent.get_dbus_method("name","org.ktorrent.torrent")
        mailz("ktorrent: finished " +name())


import gobject
loop = gobject.MainLoop()

Fedora 10 Fglrx

Finally the RPMFusion Stable NonFree Updates repositories have the fglrx driver
All steps are to be executed in root/super-user mode

1) Get RPMFusion Repos.

rpm -Uvh

2) Install Fglrx

yum  install akmod-fglrx xorg-x11-drv-fglrx xorg-x11-drv-fglrx-libs -y

3) Blacklist radeon

blacklist radeon

to /etc/modprobe.d/blacklist

4) Reboot

5) Make initrd

– While booting at grub press ‘e’ in line starting with kernel. Add ‘single’ to the end. Press ‘ESC’ & press ‘b’

cd /boot/
rm initrd-`uname -r`.img
mkinitrd initrd-`uname -r`.img `uname -r` --with=fglrx


NOTE: You might have to do

aticonfig --initial -f

Install XBMC

XBMC (a.k.a. XBOX Media Center) is a great media center available on all platforms

If you have Ubuntu then see this

For Fedora an unofficial rpm is available at

Installing From source:

0) Get Latest SVN Snapshot

svn co

1)Get RPMFusion Repo:

rpm -Uvh

2)Install Dependencies :

yum install SDL* glew glew-devel libmad-devel tre tre-devel libogg libogg-devel libvorbis libvorbis-devel boost 
boost-devel bzip2-devel bzip2-libs fribidi* lzo lzo-devel mysql-libs mysql-devel jasper jasper-devel faac faac-devel 
enca enca-devel hal hal-devel hal-libs cmake gperf nasm libXmu-devel fontconfig-devel freetype-devel libXinerama-devel 
pcre-devel gcc-c++ sqlite-devel curl-devel pulseaudio-libs-devel libsmbclient-devel

3)Make sql symbolic link
– For i386

ln -s /usr/lib/mysql/ /usr/lib/

For 64 bit

ln -s /usr/lib64/mysql/ /usr/lib64/


cd linuxport/XBMC



During this some errors may occur:

../xbmc/utils/CharsetConverter.h:31:39: error: fribidi/fribidi_char_sets.h: No such file or directory


cd xbmc
ln -s lib/libfribidi/ fribidi
cd ..


/usr/include/jpeglib.h:1096:55: error: jpegint.h: No such file or directory


cp xbmc/lib/cximage-6.0/jpeg/jpegint.h /usr/include/

C) For any other errors refer to or

6) Install

make install

7) Configuring

Open xbmc by typing   xbmc in terminal or ALT+F2

-Settings > System >Audio Hardware
-Change Audio Output to Digital
-Change Audio Output Device and Passthrough Output Device to same device settings

(pulse -for fedora , hdmi/spdif- for ubuntu/debian systems)

You can also find out your device by using

aplay -L

8) To learn More about plugins and scripts Visit

Install fglrx from rpmfusion testing repos

Now the fglrx driver is available in testing repos it can be installed .Since its in testing repos it is not recommended.
Older Guide: Older Guide’s Install Script:

Make sure you have rpm-fusion repo installed

rpm -Uvh

Install Driver using yum

yum --enablerepo=rpmfusion-nonfree-updates-testing install akmod-fglrx xorg-x11-drv-fglrx xorg-x11-drv-fglrx-libs.

fglrx Install script fedora 10



– Remove all packages related to previous attempts to install fglrx

– It now supports x86_64 but requires more testing on the platform

– Since its new it will have many unobserved bugs even though it has been tested

-This uses the ati driver at

-For x86_64 bit OS you can either select  64 bit driver (while installing) or install 32 bit driver and remove # sign in front of a section called NOTE.

-If any bugs are encountered please comment about them (with details) at this blog.

To install put driver and script in same folder and run sh installfglrx (root mode)


AFTER INSTALL(if everything is working_:

edit /boot/grub/menu.conf

instead  of nomodset put vga=0xA

A is the VESA mode

fglrx install script for fedora 10


Yes, this is a script to install fglrx on fedora 10 due to problems faced by people.


– Remove all packages related to previous attempts to install fglrx

– For time being this supports only 32 bit Fedora 10

– Since its new it will have many unobserved bugs even though it has been tested

-This uses the ati driver at

-Any bugs encountered please comment them at this blog

To install put driver and script in same folder and run sh installfglrx (root mode)


AFTER INSTALL(if everything is working_:

edit /boot/grub/menu.conf

instead  of nomodset put vga=0xA

A is the VESA mode

Reliance ATZ USB CDMA Modem on fedora , ubuntu and other linux

1) Find Vendor and ProdID


cat /proc/bus/usb/devices

In the generated list where Manufacturer is ZTE , Incorporated

Take Vendor and ProdID

eg. Vendor=19d2 ProdID=fffd

-You can also use lsusb to get entry with ONDA Communication S.p.A in format   a:b

eg  19d2:fffd

2) Load Module
modprobe usbserial vendor=0x19d2 product=0xfffd

After this step 3 interfaces /dev/ttyUSB* where *(0-2)
should be created .(if not then rmmod usbserial ->remove device->modprobe again->insert device )

3)Configure (Run in root mode)(NOT FOR FEDORA go to 6)

4)Edit /etc/wvdial.conf
Add number eg. #777
Add your username and password in the fields.

Ideally running wvdial should be enough.
(try ping to check if you are connected)

6)However in fedora(and if above steps dont work for you) after modprobe
Go to System>Administration>Network>New>Modem>
In Modem Properties (Despite error)
change device to /dev/ttyUSB0
Modem Volume=low
Phone number #777
Username and Password -as you have
Provider Name -any
Save And activate
Try ping

Python 3.0 Basics

print(“Hello”) prints Hello , to know more about any command use help(<name>) so help(print) brings the command info.

-Unlike older versions python now classifies strings into data and text. All Text is Unicode  represented by type str and all data is encoded Unicode represented as binary data by byte. Both are immutable cannot be inter-converted as in older versions.

-A python script can be written by writing the code in a text file with extension .py Also in Linux / Unix based systems the first line can give the interpreter version
#!/usr/bin/env python        or #!/usr/bin/env python3.0
(If you have multiple versions of python its HIGHLY recommended to stick to 3.x versions)
-Python is strictly indentation based, so give same indentation at each level.

i=0                     1
while i<5:              2
print (i)               3
i+=1                    4

So inside the file line 1 & 2 have same indentation while those inside while loop (line 3 &4) have
same indentation but different from outside level.
(To Be Continued ..)
For FAQS and More Info Visit or

Installing Python 3.0

1)For Windows
Go to    and download software depending on your OS’s architecture
a) First Search in your Package Manager for python 3.0 (it probably is installed) if not try to install from the repos else:
Go to and download the bz package and extract it.
b) Open a terminal in root / superuser mode
cd <dir>
where <dir> is the path .
c) ./configure
d) make
e) make altinstall (this preserves current python version , else do make install)
If you get any dependency errors ,don’t be scared just try to find them using your package   manager or use google to find them.
For Old Python Users:
– Basic syntax had changed but you would get used to it.
– There’s a tool to convert old syntax scripts to new 2to3 .(unstable)

Windows users can add python to their environment variables
My Computer>Properties>(Advanced System Settings in vista)>Advanced
Go to Environment Variables >Scroll bottom scroll bar, select PATH and click edit
Add to the end ;<path where its installed>;
Now a script can be written anywhere and executed by

python <file-name> in dos
-Open DOS or terminal and enter python or python3.0 .Upon pressing enter an interactive shell
shall open with current python version and install date and time and OS type you are using.

Lost in Cyberspace