Skip to main content

Posts

Showing posts from October, 2008

Java Source Code to Change Local IP Address

Hi guys..

Try This code to change your Local IP address.


import java.io.IOException;
import java.lang.Runtime;
public class Chang_Ip {



public static void main(String args[]) throws IOException
{

String str1="192.168.0.201";
String str2="255.255.255.0";
String[] command1 = { "netsh", "interface", "ip", "set", "address",
"name=", "Local Area Connection" ,"source=static", "addr=",str1,
"mask=", str2};
Process pp = java.lang.Runtime.getRuntime().exec(command1);

}


}

How to Add User to Samba Server

There are two steps to creating a user. First we'll run the smbpasswd utility to create a samba password for the user.

sudo smbpasswd -a username

Next, we'll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers

Add in the following line, substituting the username with the one you want to give access to. The format is = "". You can use a different samba user name to map to an ubuntu account, but that's not really necessary right now.

username = "username"

Now you can create samba shares and give access to the users that you listed here