Wednesday, November 21, 2012

How to create a custom mediafire search page

Search Mediafire
Search Mediafire






You might have already familiar with google query language which enable to define various kind of searches over google search. In this article i will explain how to use such an option to search inside "mediafire.com", a popular file hosting service.

Use following query. ( for anything you want to search inside any site )


<File name><space>site:<site name>


For an example if we want search for "avatar" inside "mediafire.com" we write following query in google search bar.


avatar site:mediafire.com


Also below i post a simple "html" file that has a javascript function and a html form to accomplish this task. You have to do is save this as html file in your computer and bookmark it from your browser. So you can use this search page to search inside mediafire.com anything you want.

HTML FORM

<form action="http://www.google.com/search" method="get" onsubmit="google_sitesearch(this)">
<div style="text-align: center;">
<input name="q" style="font-size: 18px; height: 35; width: 550px;" type="text" />
<br />
<br />
<input style="height: 40px; width: 150px;" type="submit" value="Search" />
</div>
</form>


JAVASCRIPT

<script type="text/javascript">
     function google_sitesearch(thisForm){
             thisForm.q.value = thisForm.q.value+" site:mediafire.com";
     }
</script>




Friday, November 2, 2012

Android HSPA settings & MMS settings for Dialog


Go to ,
Settings --> Wireless and Network --> Mobile Networks -- > Access Point Names

HSPA settings

Tap menu and select New APN.

Enter the following settings. ( for none and not set fields leave them empty )

Name: DialogBB
APN : dialogbb
proxy : none
port : none
User Name : not set
Password : not set
Server : not set
MMSC : not set
MMS proxy : not set
MMS port : not set
MCC : 413
MNC : 02
Authentication type : none
APN tpe : internet

Tap menu , tap save and tap back.


MMS settings

Tap menu and select New APN.

Enter the following settings. ( for none and not set fields leave them empty )

Name: DialogMMS
APN : www.dialogsl.com
proxy : none
port : none
User Name : not set
Password : not set
Server : not set
MMSC : http://mms.dialog.lk;3130/mmsc
MMS proxy : 192.168.122.2
MMS port : 8080
MCC : 413
MNC : 02
Authentication type : none
APN tpe : mms


Tap menu , tap save and tap back.

Wednesday, October 31, 2012

MySQLdb does not commit ???? then read this.

If you are newby for python and want to use mysql database with the language. You might have come across this weird behavior at least once in your python time.

Once you check your db after finish running sql query that insert data to your mysql db you might have surprise to see there is no data inserted at all. Actually i had seen something more weird which is first i install MySQLdb package it was ok, it inserted data as it used to be. But after i install mysql c++ headers it start to act weird (for my case, but usually this is how it should happen... you may find in a while )

The problem to not insert the data is that you have not specified it in your connection. In more simpler manner, MySQLdb is not like other database libraries in other language, you have to specifically tell at the beginning to commit your changes automatically or you have to do it manually each time u run an insert sql. Of course yes if you only use your code only to read the data you dont have to do anything at all.

So there are two ways in MySQLdb to commit the data.

First one is to tell the library to commit it after you execute insert sql statements.



con = MySQLdb.Connect(host=host,user=uname,passwd=pwd,db=db)
#your insert sql statements goes here
con.commit()


Next way is to enable auto commit mode at the beginning.



con = MySQLdb.Connect(host=host,user=uname,passwd=pwd,db=db)
con.autocommit(True)
#your insert sql statements goes here


Happy Coding !!!


Saturday, September 29, 2012

Android HSPA settings & MMS settings for Mobitel


Go to ,
Settings --> Wireless and Network --> Mobile Networks -- > Access Point Names

HSPA settings

Tap menu and select New APN.

Enter the following settings. ( for none and not set fields leave them empty )

Name: Mobitel
APN : mobitel3g
proxy : 192.168.050.163
port : 8080
User Name : not set
Password : not set
Server : not set
MMSC : not set
MMS proxy : not set
MMS port : not set
MCC : 413
MNC : 01
Authentication type : none
APN tpe : internet

Tap menu , tap save and tap back.


MMS settings


Tap menu and select New APN.

Enter the following settings. ( for none and not set fields leave them empty )

Name: MobitelMMS
APN : wapmms
proxy : none
port : none
User Name : not set
Password : not set
Server : not set
MMSC :  http://192.168.050.165
MMS proxy :  192.168.050.163
MMS port : 8080
MCC : 413
MNC : 01
Authentication type : none
APN tpe : mms


Tap menu , tap save and tap back.

Tuesday, September 18, 2012

How to activate hutch midnight packages



Hutch Srilanka has introduced a prepaid data plan that gives u a bundle of data plus talk time in two flavors.

One way to activate this package is mentioned in their web site. Where you have to reload the specific amount and the system will activate the package for you.


Other way is as follows, where you can use existing balance of your account to activate the data plans without reloading it.

  1   Type *131# on your phone                                                           
  2   Select 5 from the menu and reply                                                 
  3  Select the appropriate number for you package and reply again  
  4  You will receive a conformation message in a while                    



Or the short code type *131*5*1# for 2GB package or *131*5*2# for 4GB package and dial.



Thursday, September 13, 2012

Toward more categorized web ...

Identify to which category a URL belongs will be a crucial matter when it comes to web semantics. Also for other ongoing research areas such as unsupervised machine learning, networking systems it is a must to have a catalog of web.

But the problem is that it is hard to find affordable such catalog. Also when it comes to categorizing web, human interfere is preferred rather than using computer algorithms to do so. But to find such a man made web category which is affordable is hard. Where the www.dmoz.org comes in.

Dmoz is also called as the "Open Directory Project", named after its original domain name "direcotory.mozilla.org". This is owned by netscape which still maintained by lot of  human participation.

Dmoz has a catalog over 2 million URLs which has been categorized in to 605228 categories and growing. RDF dumps of the dmoz has been available  under open directory license and from 2011 it started  to use creative common license.

RDF

RDF known as "resource description framework" is one of W3C specification which has been used as a meta data model. This has been used as a method to model web resources. Also RDF is XML based language.

Dmoz RDF dumps.

RDF dumps of the dmoz is available at the this URL.

But for me it was bit harder to process RDFs since no proper library with documentation available for me in python so i use this script with some modifications to convert RDF dump to a SQL dump. (Modifications has to be done since the script us old PHP versions. So if you use new PHP interpreter please check the script for deprecated functions etc. )





Sunday, August 12, 2012

When nvidia driver update make a mess of your Ubuntu ...

I have to face this issue after i update my nvidia graphics card driver in my Dell xps L502 which set the resolution of the display to 640X480 with 4:3 ratio.

I have tried almost all the things that could find in google but nothing work for me other than removing all the nvidia drivers, which include "nvidia current" and others.

After removing all nvidia drivers it still did not fixed the issue.

So i rename the xorg.conf in "/etc/X11" directory and then it worked for me.

PS: before doing that i also followed the instructions in below post also.

http://askubuntu.com/questions/127851/change-boot-screen-resolution


  1. We will have to edit grub configuration. Open a terminal and paste this:
    sudo gedit /etc/default/grub
    Hit Enter. It will open grub preferences in Gedit.
  2. Locate the line "# GRUB_GFXMODE=800x600" (resolution may be different).
You have to change the resolution to actual resolution of your screen, for example mine is 1240x1024. Next step is to uncomment this line (remove the # and and the empty space if is, so the letter G of the word GRUB will be the first letter in this line). After u r done, save the file and close.
3 . Now paste this line in terminal:
sudo gedit /etc/grub.d/00_header .
Hit Enter. It will open a text file with a lot of stuff. Use the search option at the top of the window to locate this line:
gfxmode=${GRUB_GFXMODE} 
After u successfully find it, u will have to add this line: "set gfxpayload=keep" (of course without the " sign) just under the gfxmode=${GRUB_GFXMODE}. Make it look like this:
set gfxmode=${GRUB_GFXMODE}
set gfxpayload=keep
Now, save the file and close.
4 . In terminal paste:
sudo update-grub 
Hit enter, it will generate new grub.cfg file so the changes u made will be saved.
Reboot and enjoy your new boot screen resolution.
In case u don't know what is your screen resolution
Go to System settings - Displays