WEBVTT

00:00.960 --> 00:05.840
In one of the lecture we covered Python in Python basics.

00:05.840 --> 00:08.800
Okay, we covered Python variables okay.

00:09.080 --> 00:13.600
So here I'm going to show you how you can use variables okay.

00:14.200 --> 00:16.840
We need to use variables in here.

00:16.840 --> 00:25.080
As you see we have few things here that is necessary to put them into store them into variables.

00:25.080 --> 00:26.440
One of them is interface.

00:26.440 --> 00:28.560
The other one is Mac address.

00:28.600 --> 00:29.440
Okay.

00:29.440 --> 00:31.480
So let's do this.

00:31.520 --> 00:33.680
Let's create a variable name it interface.

00:33.880 --> 00:37.240
So this interface is equal to something right now.

00:37.240 --> 00:39.320
You see it is it is zero okay.

00:39.360 --> 00:40.560
Later you can change it.

00:40.680 --> 00:44.280
And also we have new Mac address.

00:44.720 --> 00:47.720
So it is equal to this thing right now.

00:48.120 --> 00:50.640
And that could be changed too.

00:50.640 --> 00:53.280
So let's add this from here okay.

00:53.320 --> 00:57.920
Use control X and use it here control V.

00:58.000 --> 01:01.360
And then use your new Mac here okay.

01:03.400 --> 01:04.520
Right here.

01:04.600 --> 01:07.680
Or maybe not there.

01:08.040 --> 01:09.680
Here, use a plus.

01:09.680 --> 01:12.080
And then your new Mac address.

01:12.120 --> 01:12.560
Okay.

01:17.200 --> 01:17.600
Okay.

01:17.880 --> 01:20.080
Now we have the new Mac address here.

01:21.760 --> 01:25.600
And it is time to use the interface variable.

01:25.640 --> 01:26.280
Okay.

01:26.320 --> 01:32.240
So the interface here we say for which it is zero if you're using LAN.

01:32.280 --> 01:33.240
So LAN zero.

01:33.640 --> 01:37.760
And here we need to use interface.

01:37.800 --> 01:38.200
Okay.

01:38.760 --> 01:43.760
Enter is and concatenate that with this one.

01:45.160 --> 01:45.640
Okay.

01:45.680 --> 01:46.480
Not really.

01:46.480 --> 01:48.600
Down

01:50.520 --> 01:53.840
here we have something.

01:53.880 --> 01:54.320
Okay.

01:56.560 --> 01:58.040
That is here.

02:01.840 --> 02:02.240
Okay.

02:04.830 --> 02:05.950
Good.

02:05.990 --> 02:08.110
Now we have interface right here.

02:08.110 --> 02:11.590
That is that we are using interface here.

02:11.590 --> 02:15.110
Be careful about these spaces here needs to be here okay.

02:15.110 --> 02:20.070
And also let's uh copy this part okay.

02:20.110 --> 02:30.310
Use Ctrl C to copy that and then just paste instead of E to zero and eth zero okay.

02:30.310 --> 02:37.310
Now we have a program that is looks a little better than that okay.

02:38.230 --> 02:39.990
Now again let me save this.

02:39.990 --> 02:44.830
This time I'm going to change it to for example six six okay.

02:44.870 --> 02:50.830
Save it and let's move to terminal I have opened the terminal right here okay.

02:50.870 --> 02:52.070
Let me use ifconfig.

02:54.150 --> 02:59.670
Now you see that the the Mac address it is five five okay.

02:59.710 --> 03:01.510
And let me use Python.

03:01.670 --> 03:04.270
We have mac changer.py hit enter.

03:04.790 --> 03:05.870
And again.

03:08.150 --> 03:12.910
Also let's add more thing like print.

03:12.910 --> 03:13.950
Use a print statement.

03:13.950 --> 03:15.110
Okay, I will do that.

03:15.470 --> 03:19.670
But before that let me see that if it is changed, of course it is changed.

03:19.670 --> 03:20.070
Okay.

03:20.830 --> 03:23.190
Here, right in here.

03:23.190 --> 03:29.830
Let's print a statement like changing a mac address for for this interface to this Mac address.

03:29.870 --> 03:30.910
Okay.

03:30.950 --> 03:31.870
Can we do that.

03:31.870 --> 03:33.430
Yes, we can do that okay.

03:33.470 --> 03:34.430
We are a programmer.

03:34.430 --> 03:37.230
So we are able to do anything we want okay.

03:38.110 --> 03:42.870
And here I'm going to changing tell changing.

03:45.070 --> 03:46.110
Mac address.

03:49.910 --> 03:51.830
To okay.

03:51.870 --> 03:53.310
Or we could use for.

03:58.470 --> 04:00.310
For what for interface.

04:00.310 --> 04:02.750
So we are using interface here.

04:02.870 --> 04:05.870
And then concatenating this with.

04:08.790 --> 04:09.500
This one.

04:09.740 --> 04:12.300
It is going to be new Mac address.

04:12.620 --> 04:15.020
Now let's see, how does it look like?

04:15.140 --> 04:15.540
Okay.

04:17.380 --> 04:18.020
Save it.

04:18.340 --> 04:23.220
Come to terminal and clear this.

04:30.500 --> 04:31.820
Okay.

04:31.820 --> 04:35.300
Or let's change this at seven seven.

04:35.300 --> 04:38.100
So okay.

04:38.140 --> 04:38.780
Save it.

04:39.020 --> 04:40.020
And here.

04:42.140 --> 04:43.380
Use ipconfig right.

04:43.380 --> 04:44.860
Then you see it is six six.

04:47.660 --> 04:53.940
And it is telling you that changing Mac address for eth0 to this one okay.

04:54.380 --> 04:57.180
And now let's see if it is changed or not.

04:59.780 --> 05:02.380
You see that it is changed to seven seven.

05:02.620 --> 05:03.340
Very good.

05:03.660 --> 05:07.260
Here you'll learn how to use variables.

05:07.300 --> 05:07.740
Okay.

05:08.300 --> 05:09.460
So good.

05:09.460 --> 05:12.100
Thanks for watching and I will see you in the next lecture.
