Wednesday, November 29, 2017

Disable Auto Update in Windows 10


Some of us may face the problems that the windows is getting updated while we are doing urgent jobs. Or the windows is getting updated while we prepare to go back home at the time when the office is closed and the power is going to be shut down. To stop that kind of problem, we should disable auto update in windows.

To disable auto update in windows by command line

- Run command prompt as administrator
- Type net stop wuauserv in the command prompt and press enter
- Type net stop bits and press enter
- Type net stop dosvc and press enter

Sunday, November 26, 2017

Header in PHP

<?php

$redirect_page = 'http://www.tnw87.com';
$redirect = true;

if($redirect == true)
{
 header('location:' .$redirect_page');
}

?>

<h1>Your connection is wrong in something</h1>

Timestamp in PHP

<?php

$time = time();
$time_current = date('d M Y @ H:i:s', $time);
$time_modified = date('d M Y @ H:i:s', tostrtime(+ 1 year));
echo 'The current time is  ' .$time_current. ' and The time modified is ' .$time_modified.'!';

?>

Thursday, November 23, 2017

String Lower / Upper in PHP

We can change all characters to lower case by using strtolower. The following code is an example.

<?php

$string = 'I am ThEt NainG WiN!';
$string_low = strtolower($string);
echo $string_low;

?>

Wednesday, November 22, 2017

Securing Cisco Networking Devices


We should set passwords in Cisco networking devices so that non authorized people can't access easily. The followings are the ways to set passwords in Cisco networking devices by CLI.


Console Password

enable (en)
configure terminal (config t)
line console 0
password console123 (type secured password)

Tuesday, November 21, 2017

Checking DNS (Domain Name System)

We can use nslookup command to check dns (domain name system). How to check:

In windows,

- Press Windows + R keys together.
- Type cmd in the run box and press enter.
- Type nslookup in the command prompt and press enter.

To check dns:
- Type example.com and press enter. If your dns is working, you will see Name and IP Address.

To check website:
- Type www.example.com and press enter. If your website is working, you will see your hosting name  and IP Address.

Do While Loop in PHP


<?php

$count = 1;
$message = 'Hello!';

do {
  echo $count.'. '.$message.'</br>';
  $count ++;
}

while($count<=10)

?>

Friday, November 17, 2017

While Loop in PHP


<?php

$count = 1;
$message = 'I Love You!';

while($count<=10){
  echo $count. '.' .$message.'</br>';
  $count ++;
}

?>

Thursday, November 16, 2017

If Statement in PHP


<?php

$num1 = 30;
$num2 = 40;

if($num1 > $num2){
  echo 'Num1 is greater than Num2!';
} else if($num1 == $num2){
  echo 'Num1 and Num2 are equal!';
}else{
  echo 'Num2 is greater than Num1!';
}

?>