Tuesday, 15 October 2013

Connecting USB modem in Ubuntu 12.04 and 12.10

Hi Ubuntu Users, you might just install the newly fresh Ubuntu 12.04 or Ubuntu 12.10, but you might not get the connection to internet by using USB modem. You can’t directly connect internet connection by just plugging USB device and setting the internet connection. Ubuntu developers and Canonical Community didn’t notice the small bug of network connection manager, the problem is that modem does not get detected, so we can’t setup to the internet settings. So in this blog I will be publishing a very simple technique to connect to the Internet connection by using USB modem.
 
If you have just installed the Ubuntu the first step is to create the root account in Ubuntu because Ubuntu and Debian based operating Systems doesn’t have the root account. So we will have to create it by just entering the following command,
  
     Sudo passwd
Entering this command on terminal will ask you for password and it will create a root account with the same password.

Now you have to login as a super user, so enter the following command

   Su
Enter your root password

Now, you have to plug your USB modem
After plugging, check if your modem is mounted or not by the following command

   lsusb
 
This command will list all the drives and USB devices of your system.
Just check your USB is mounted or not. It is mounted but not detected, so for settingup internet connection enter the following command:
   modprobe –v option
modpobe is a command to add and remove modules from Linux Kernel.
-v  --verbose
Print messages about what the program is doing. Usually modprobe only prints messages if something goes wrong. This option is passed through install or remove commands to other modprobe commands in the MODPROBE_OPTIONS environment variable.
After that you just have to enter the following command
echo"1c9e 9605" > /sys/bus/usb-serial/drivers/option1/new_id
 
This command will write the entry for the modem in the new_id file
That’s all now your modem is detected and you can set up your internet connection through network manager.

Wednesday, 12 December 2012

How to Run WAMP Server Parallel with IIS 7 on Windows

WAMP Server is one of the best software packages that installs and manages Apache, MySQL and PHP very easily on Windows. But when you already have IIS running then you may not be able to run WAMP Server at Localhost. You need to shutdown IIS in order to run WAMP Server properly.
In this short tutorial, I will tell you how you can run WAMP Server on Windows without shutting down IIS 7 on Windows 7. By following this tutorial you can run WAMP Server on http://localhost:8080 and IIS 7 on http://localhost
You need to install IIS and WAMP Server first to follow this tutorial. Usually after installing WAMP Server, when you open http://localhost, you can access the WAMPServer page but if IIS 7 is installed and ran with WAMP server, IIS 7 page is opened instead.
To run WAMP Server parallel with IIS 7, we need to assign port 8080 to WAMP Server so that it runs on http://localhost:8080 and IIS 7 runs on http://localhost.com.

To do this, click on WAMP Server icon on taskbar and go to Apache > httpd.conf

httpd.conf file will be opened. Change ‘Listen 80’ to ‘Listen 8080’ . Save and restart WAMP.

Wednesday, 6 June 2012

Sunday, 6 May 2012

webservice code for authentication of doctor, patient and adding of new patient


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Data.Odbc;
using System.EnterpriseServices;
using System.Web.Services.Configuration;



/// <summary>
/// Summary description for hello
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class project : System.Web.Services.WebService {

    public project () {

        //Uncomment the following line if using designed components
        //InitializeComponent();
    }

  
    
    // [WebMethod(TransactionOption = TransactionOption.RequiresNew)]
  // [WebMethod]
   // public string HelloWorld() {
   //    return "Hello World";
  // }
   
  
    OdbcConnection cn = new OdbcConnection("Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=project_table; User=root;Password=project;Option=3;");
  
    [WebMethod(Description = "login for doctor", EnableSession = false)]
    public string dlogin(string user, string password)
    {
    string mystring ="select dname from doctor_login where duser='"+ Convert.ToString(user) +"' AND  dpassword='" + Convert.ToString(password) + "'";
    OdbcCommand cm = new OdbcCommand(mystring, cn);
    cn.Open();
    OdbcDataReader r = cm.ExecuteReader();
        while (r.Read())
            {
                string thisrow = "";
            for (int i = 0; i < r.FieldCount; i++)
                thisrow = thisrow + r.GetValue(i).ToString() + ",";
             
               return (thisrow);
           // if (thisrow.Length >= 1)
            //    return(true);
            //else
             //   return(false);
          
            }
        cn.Close();
        return null;
         }


    [WebMethod(Description = "login for Patient", EnableSession = false)]
    public string plogin(string user, string password)
    {
        string mystring = "select pid,pname from patient_login where puser='" + Convert.ToString(user) + "' AND  ppassword='" + Convert.ToString(password) + "'";
        OdbcCommand cm = new OdbcCommand(mystring, cn);
        cn.Open();
        OdbcDataReader r = cm.ExecuteReader();
        while (r.Read())
        {
            string thisrow = "";
            for (int i = 0; i < r.FieldCount; i++)
                thisrow = thisrow + r.GetValue(i).ToString() + ",";

             return (thisrow);
          //  if (thisrow.Length >= 1)
            //    return (true);
            //else
              //  return (false);

        }
        cn.Close();
        return null;
    }


    [WebMethod(Description = "register new patient", EnableSession = false)]
    public bool insertpatient(int id, string name, string user, string password, string email)
    {
        bool returnBool = false;
        string str = "INSERT INTO patient_login(pid,pname,puser,ppassword,pemail) values(" + id + ",'" + name + "','" + user + "','" + password + "','" + email + "')";
        OdbcCommand cmd = new OdbcCommand(str, cn);
        try
        {
            cn.Open();
            if (cmd.ExecuteNonQuery() != 0)
                returnBool = true;
            returnBool = true;
        }
        catch
        {
            returnBool = false;
        }
        cn.Close();
        return returnBool;
    }
  }

Tuesday, 1 May 2012

exclusion of HTTP,POP3 ports


To solve problem of localhost ie it converts to www.localhost.com

It is due to antivirus NOD32.

open up nod32 (you probably have it installed on your system if the above methods don't work) go to advanced setup, on the left menu, select protocol filtering, and select HTTP and POP3 ports... ;)

Friday, 20 April 2012

testing webservices

access my sql remotely

Solved: How to enable remote access to MySQL server on Windows XP
Hi there,

On Linux, we can easily enable remote access to MySQL server, but on Windows, I got no success so far ( a client tried to connect to MySQL on the server)

Here's the steps to do that (on the server computer):

1. Open a DOS command prompt on the server.
2. Run the following command from the mysql\bin directory:
mysql -u root --password=
3. A mysql> prompt should be displayed.
4. To create a remote user account with root privileges, run the following commands:
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD';

'USERNAME' is the username to be created.
'IP' is the public IP address of the remote connection.
'PASSWORD' is the password to be assigned for this username.
(IP can be replaced with % to allow this user to logon from any host or IP)

mysql> FLUSH PRIVILEGES;
mysql> exit;