Pages

Monday, February 13, 2012

PYTHON APPLICATIONS....PART 1

 

A software for controlling the keyboard and mouse of Ur laptop with a Bluetooth enabled Symbian phone.actually this was ma mini project and we did this in two platforms QT and .NET ,later during an interview the interviewer asked me why did we u two different platforms instead of doing it in one ..........this question was stuck in ma mind for long time which forced me to do this in a single platform . later i chose python for doing this..and here it goess

we do this in two parts
1.client ie ur phone
2.server ie ur laptop

let start with client

requirements

a Symbian phone with Bluetooth and python installed .you can get the python for ur mobile from following links

http://dl.dropbox.com/u/30579529/mobile%20applications/sis/pips.sis
http://dl.dropbox.com/u/30579529/mobile%20applications/sis/pips_nokia_1_3_SS.sis
http://dl.dropbox.com/u/30579529/mobile%20applications/sis/Python_2.0.0.sis
http://dl.dropbox.com/u/30579529/mobile%20applications/sis/pythonapps_zxcyexuy.sis
http://dl.dropbox.com/u/30579529/mobile%20applications/sis/PythonScriptShell_2.0.0_3_0.sis
http://dl.dropbox.com/u/30579529/mobile%20applications/sis/PythonScriptShell_2.0.0_devcert_signed.sis

make sure that u have installed all the files in ur phone

now u can find the python shell in ur phone application menu
the best way to do this to make a .py file and run it in python>>run script option in ur phone

the following  code actually

1.switch on the phone bluetooth if its off and search for a server and connects it tothe server .

2.search for each key press  make and send to the server with send function(it actually sends the mobile ascii value)

code:

 

import appuifw
import socket
import graphics
import e32
import btsocket as socket
 
keyboard_state={}
last_keycode=0
 
def bt_connect():
    global sock
    sock=socket.socket(socket.AF_BT,socket.SOCK_STREAM)
    target=''
    if not target:
        address,services=socket.bt_discover()
        print "Discovered: %s, %s"%(address,services)
        if len(services)>1:
            choices=services.keys()
            choices.sort()
            choice=appuifw.popup_menu([unicode(services[x])+": "+x
                                        for x in choices],u'Choose port:')
            target=(address,services[choices[choice]])
        else:
            target=(address,services.values()[0])
    print "Connecting to "+str(target)
    sock.connect(target)
    print "OK."
     
     
def callback(event):
    if event['type'] == appuifw.EEventKeyDown:
        keyboard_state[event['scancode']]=1
    elif event['type'] == appuifw.EEventKeyUp:
        keyboard_state[event['scancode']]=0
    elif event['type'] == appuifw.EEventKey:
        last_keycode=event['keycode']
         
    canvas.text((0,60),u'%s'%(last_keycode))
    sock.sendall(u'%s'%(last_keycode))
     
 
bt_connect()
     
canvas=appuifw.Canvas(event_callback=callback)
appuifw.app.body=canvas
 
 
lock=e32.Ao_lock()
appuifw.app.exit_key_handler=lock.signal
lock.wait()

 

BYPASS FEDORA PASSWORD

1. Reboot the system
2. When you see the Grub menu, highlight your Fedora installation with the arrow keys and press ‘e’ to edit.
3. Again use the arrow keys to highlight the line saying ‘kernel’ at the beginning and press ‘e’ again, which will let you edit that line.
4. Append a space at the end of the line and type ’single’ without the quotes there. Press the Enter key.
5. Now press ‘b’ which will take you to the Linux single user mode where you’ll have privileged access without typing a password.
6. Now you do a passwd, and change your root password. Then reboot. You are done.

Now enter into TTY mode and login as root and use passwd "username" to change the password of needed password

enjoyyyyyyyy............

Saturday, January 14, 2012

CONFIGURE WORDPRESS IN FEDORA

First for using wordpress fedora we need to install apache(httpd)server,mysqld,php

yum install httpd
yum install mysql mysql-server
yum install php phpmyadmin


check the status of httpd and mysql

service httpd status
service mysql status


add both to startup

chkconfig httpd on
chkconfig mysql on


if needed restart stop and start the both services
service httpd restart
service mysql restart


any problem with httpd use -t to get the reason

httpd -t

type in the browser localhost to get fedora defaul page

go to /etc/httpd/conf.d/welcome.conf and comment all the lines



now downlaod the wordpress form there site

cd /tmp
wget http://wordpress.org/latest.tar.gz


now decompress the fileto /var/www/html/

tar -xvzf latest.tar.gz -C /var/www/html

change the privilage of the folder by

chmod -R 777 /var/www/html/

now we need to create database

mysql
create user user_name identified by password
create database database_name;
grand all on database_name to user_name;
flush privilages;
exit;


now go to borwser and type localhost/wordpress to get the configuration file of the wordpress

database: database_name
username:user_name
password:password
host:localhost:


and click next

to finish installing giving mail id username and password

if the config file is not made open the file /var/www/html/wordpress/wp-config-sample.php and make the need changed u will get the code to replace for the config not created page and save the page as wp-config.php

Friday, January 13, 2012

INSTALLING GOOGLE CHROME IN FEDORA

First make the google repo file(google.repo) and copy it in /etc/yum.repo.d/

and later run

yum install google-chrome-stable


content of google.repo file should be a below

[google64]
name=Google - x86_64
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Wednesday, January 11, 2012

AUTO PLUS for fedora

Autoplus

This is a simple program to make life easier and quicker for installing (also can unistall) those much needed extra's in fedora,
To install just copy below in a terminal (When asked for a password it is the root password required)

install / uninstall Adobe Flash, codecs, Google Earth, Skype, Sun Java, VirtualBox, WinFF, Imagination, Cinelerra, Hugin Panorama Creator, Lightscribe, Dropbox, extra backgrounds and sudo with or without password for current user. And of course, it also adds all the repositories required to install these applications.

su -c 'yum -y --nogpgcheck install http://dnmouse.org/autoplus-1.3-3.noarch.rpm'

If required here is the signing key(not necessary)


su -c 'rpm --import http://dnmouse.org/RPM-GPG-KEY-dnmouse'


taken from
http://www.dnmouse.org/autoten/autoplus.html

Installing malayalam font in Fedora


  1. yum remove lohit-malayalam

  2. yum install scim-lang-malayalam

  3. su -c 'yum --enablerepo=updates-testing update im-chooser'

  4. yum install ibus yum install smc-fonts*


download swanalekha-ml-1-1.fc8.i386.rpm from 
             http://wiki.smc.org.in/Swanalekha


  1. rpm -i swanalekha-ml-1-1.fc8.i386.rpm 

  2. yum update pango libic

  3. yum install aspell-ml swanalekha-ml

  4. yum install smc-fonts-malayalam xkeyboard-config dhvan NOW go to applications and select "select input method" and select ibus and its done

Monday, January 2, 2012

how to install firefox in fedora

first add the following repos to the yum by following the steps

first become root with su command and put the following 2 commands to download new rpm fusion in terminal

  1. rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm

  2. rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm


now try

yum list firefox

if rpm fusion is installed correctly it wiil display current version of firefox installed and available updates

then to update

yum update firefox

 

its doneee