25 Oct 2020

Windows Network Diagnostic Commands

The following are essential Microsoft Windows network commands, which are useful for diagnosing, configuring, and managing network connections:

  1. ipconfig:
    • Use this command to display network settings for all network adapters on your machine.
    • Verify network connections and settings.
    • Additional commands:
      • ipconfig /all: Displays detailed information about all network adapters.
      • ipconfig /release: Releases the current IP address.
      • ipconfig /renew: Renews the IP address.
  2. ping:
    • Helps identify IP addresses and troubleshoot network issues.
    • Test connectivity to remote hosts.
    • Additional commands:
      • ping -t <host>: Continuously ping a host until stopped with Ctrl+C.
      • ping -n <count> <host>: Send a specified number of echo requests.
  3. getmac:
    • Displays local and remote MAC addresses.
    • Useful for identifying network adapters.
    • Additional commands:
      • getmac /v: Displays connection names and adapter names.
      • getmac /s <computer>: Retrieves MAC addresses for a remote computer.
  4. nslookup:
    • Diagnose DNS infrastructure issues.
    • Retrieve information about domain names.
    • Verify DNS configuration.
    • Additional commands:
      • nslookup <hostname>: Look up information for a specific hostname.
  5. netstat:
    • Display active TCP connections, listening ports, and network statistics.
    • Useful for monitoring network activity.
    • Additional commands:
      • netstat -a: List all listening and non-listening ports.
  6. tracert:
    • Visualize the path of a network packet to its destination.
    • Identify routing issues and latency.
    • Additional commands:
      • tracert <host>: Trace the route to a specific host.
  7. arp:
    • Display, add, or remove ARP (Address Resolution Protocol) information.
    • Useful for managing ARP caches.
    • Additional commands:
      • arp -a: List the ARP cache.
  8. telnet:
    • Remotely access devices or computers.
    • Manage network devices, transfer files, or configure devices.
    • Additional commands:
      • telnet <host>: Connect to a remote host using Telnet.
  9. netsh:
    • Reset network settings (Administrator privileges required).
    • Useful for resolving network issues.
    • Commands for resetting network settings:
      • netsh winsock reset
      • netsh int ip reset
      • ipconfig /release
      • ipconfig /renew
      • ipconfig /flushdns
  10. route:
    • Manually configure routes in the routing table.
    • Control how data is forwarded in the network.
    • Additional commands:
      • route print: Display the current routing table.

 

Basic Network Troubleshooting for Windows 10, Windows 11, and macOS:

Windows 10 and Windows 11:

  1. Check Physical Connections:
    • Ensure that all cables (Ethernet, USB, etc.) are securely connected.
    • For Wi-Fi, confirm that the wireless adapter is enabled and connected to the correct network.
  2. Restart Networking Devices:
    • Power cycle your modem and router by unplugging them for 30 seconds and plugging them back in.
    • Restart your computer.
  3. Check Network Icon:
    • Look at the network icon in the taskbar. If it has a warning symbol, click on it to troubleshoot network problems.
  4. Use Windows Troubleshooter:
    • Right-click on the network icon in the taskbar and select "Troubleshoot problems."
    • Follow the on-screen instructions to diagnose and fix issues.
  5. Check IP Configuration:
    • Open Command Prompt and run ipconfig.
    • Ensure you have a valid IP address (IPv4) and Default Gateway.
  6. Flush DNS Cache:
    • In Command Prompt, run ipconfig /flushdns to clear the DNS cache.
  7. Check Firewall Settings:
    • Ensure that your firewall is not blocking network traffic.
    • Adjust firewall rules if necessary.
  8. Update Network Drivers:
    • Outdated network drivers can cause problems. Update them via Device Manager.
  9. Disable/Re-enable Network Adapter:
    • In Device Manager, right-click on your network adapter and select "Disable," then "Enable."
  10. Check for Software Conflicts:
    • Temporarily disable third-party security software to check if it's causing network issues.

macOS:

  1. Check Physical Connections:
    • Ensure all cables are properly connected, and for Wi-Fi, ensure your Wi-Fi adapter is enabled.
  2. Restart Modem and Router:
    • Power cycle your networking equipment.
    • Restart your Mac.
  3. Use Network Diagnostics:
    • Click the Apple logo, go to "System Preferences," and select "Network."
    • Click "Assist me" and choose "Diagnostics."
    • Follow the prompts to diagnose and resolve network problems.
  4. Check Network Settings:
    • In "Network" preferences, make sure the correct network service is at the top of the list.
    • Ensure your IP settings are configured automatically (DHCP).
  5. Flush DNS Cache:
    • Open Terminal and run sudo dscacheutil -flushcache to clear the DNS cache.
  6. Check Firewall Settings:
    • Go to "System Preferences," then "Security & Privacy," and click the "Firewall" tab.
    • Ensure your firewall settings allow the necessary connections.
  7. Update macOS:
    • Make sure your macOS is up to date, as updates often include network-related fixes.
  8. Check for Software Conflicts:
    • Disable third-party firewall or security software temporarily to check for conflicts.
  9. Reset Network Configuration:
    • In Terminal, run sudo networksetup -setv4off Wi-Fi (to disable IPv4), and then run sudo networksetup -setv4automatic Wi-Fi (to re-enable it).
  10. Restart Wi-Fi Router:
    • Unplug your Wi-Fi router for 30 seconds and plug it back in.

 

Windows 10, Windows 11, and macOS Network Troubleshooting Guide

When it comes to resolving network issues on Windows 10, Windows 11, or macOS, a comprehensive network troubleshooting guide can be your go-to resource. To ensure your network troubleshooting process is seamless and effective.

For Windows 10 and Windows 11:

  1. Check Physical Connections for Network Stability:
    • Ensure all network cables are securely connected.
    • For wireless connections, verify that your Wi-Fi adapter is enabled and connected to the correct network.
  2. Restart Networking Devices for Optimal Performance:
    • Power cycle your modem and router by unplugging them for at least 30 seconds before plugging them back in.
    • Restart your Windows 10 or Windows 11 computer.
  3. Utilize the Network Icon for Quick Insights:
    • Monitor the network icon in your taskbar. If a warning symbol appears, click on it for instant network issue diagnostics.
  4. Leverage Windows Troubleshooter:
    • Right-click on the network icon in your taskbar and select "Troubleshoot problems."
    • Follow the guided prompts to diagnose and resolve network problems efficiently.
  5. Inspect IP Configuration for Network Settings:
    • Access Command Prompt and execute ipconfig.
    • Verify the presence of a valid IPv4 address and Default Gateway.
  6. Clear DNS Cache for Better Connectivity:
    • In Command Prompt, perform ipconfig /flushdns to purge the DNS cache effectively.
  7. Review Firewall Settings for Security:
    • Ensure your firewall isn't obstructing network traffic.
    • Modify firewall rules, if necessary.
  8. Update Network Drivers for Peak Performance:
    • Outdated network drivers can be a common cause of network troubles. Keep them current through Device Manager.
  9. Toggle Network Adapter for a Quick Fix:
    • Navigate to Device Manager, right-click on your network adapter, and select "Disable" followed by "Enable."
  10. Evaluate Software Interactions for Network Stability:
    • Temporarily disable third-party security software to investigate any conflicts affecting network performance.

For macOS:

  1. Inspect Physical Connections for Network Integrity:
    • Ensure all network cables are properly connected, or, for wireless connections, confirm the Wi-Fi adapter is enabled.
  2. Reboot Network Devices for Optimal Functionality:
    • Cycle power to your networking equipment.
    • Restart your macOS computer.
  3. Engage Network Diagnostics for Precision:
    • Click the Apple logo, proceed to "System Preferences," and access "Network."
    • Choose "Assist me" and select "Diagnostics" to systematically diagnose and resolve network issues.
  4. Verify Network Settings for Connectivity:
    • In "Network" preferences, ensure the correct network service occupies the top position.
    • Confirm your IP settings are configured automatically (using DHCP).
  5. Clear DNS Cache for Improved Network Performance:
    • Open Terminal and execute sudo dscacheutil -flushcache to eliminate DNS cache bottlenecks.
  6. Examine Firewall Configurations for Network Access:
    • Visit "System Preferences," navigate to "Security & Privacy," and access the "Firewall" tab.
    • Ensure your firewall settings permit essential network connections.
  7. Stay Up-to-Date with macOS Updates:
    • Regularly check for macOS updates, as they frequently contain fixes for network-related issues.
  8. Assess Software Interactions for Network Health:
    • Temporarily disable third-party firewall or security software to pinpoint any compatibility issues affecting your network.
  9. Reset Network Configuration for Enhanced Functionality:
    • In Terminal, execute sudo networksetup -setv4off Wi-Fi to disable IPv4 and then sudo networksetup -setv4automatic Wi-Fi to re-enable it.
  10. Reboot Your Wi-Fi Router for Stability:
    • Unplug your Wi-Fi router for a minimum of 30 seconds and then reconnect it to address intermittent connectivity problems.

 

23 Feb 2020

Windows Server Group Policy

Group Policy: 

Group Policy is used to define policies for Users, Security and Networks applicable on User/Machine
The idea is to implement an organizational policy and rules on company users or company device.

Group Policy Object (GPO):
Group Policy Components:
Group Policy Settings:
Group Policy Preferences
Starter GPO
Delegation of Management GPOs
GPO Links
Applying GPO
Group Policy Processing Order
Multiple Local GPO
Default GPO
GPO Security Filtering 


22 Feb 2020

WMIC

Windows Management Interface Command!

WMIC or Windows Management Interface Command is a command line tool that is generally used to query all of the system related information like Computer Name, BIOS Serial Number, Mac Address etc.
To run the wmic command, you must have administrative rights
> wmic diskdrive get model,name,size
> wmic os list brief
> wmic bios get serialnumber


16 Feb 2020

Syntax:


#include:-Its type of preprocessor directive that is used of include header file in a program.
there is no space between # and include.
It is written as first statement in source code.
Syn:-
#include<header file>
eg:-#include<math.h>
#include<stdio.h>
#include"stdio.h"
#include"math.h"

*Header file:-It is special type of file that contains predefined extension of header file is ".h"
There are some header file in C language.
No.NameDescription
1"stdio.h"Input/Output Functions
2"conio.h"console input/output
3"assert.h"Diagnostics Functions
4"ctype.h"Character Handling Functions
5"cocale.h"Localization Functions
6"math.h"Mathematics Functions
7"setjmp.h"Nonlocal Jump Functions
8"signal.h"Signal Handling Functions
9"stdarg.h"Variable Argument List Functions
10"stdlib.h"General Utility Functions
11"string.h"String Functions
12"time.h"Date and Time Functions
main():-It is an entry point in which we write source code according to requirement the execution
of program is started with from main function. It is a user defined function.
i) main()
{
block statement;
}
ii) void main()
{
block statement;
}
iii) int main()
{
block statement;
return(0);
}
Note:-Void is a keywords that is used to specify non return type function.
ii)main function:-It is return default integer value.

clrscr():- It stands for clear screen. It is use to clear the previous output on the consol.
It is avilable  in "conio.h" header file.
syn:- clrscr();

getch():-This function is used to input single character at a time.
It is avilable  in "conio.h" header file.
syn:- getch()'

#How to write C program?
We open any compiler of c for writing c program there are many compilers like Turbo C, Borland DevC, Microsoft visual C.

#How to save c program?
It must be saved with ".c" extension.

#Working Process of c program.





C Language

Syllabus  

Overview of C
Token
Structure of C program
Input output operation 
Control statement
Compilation and execution of C
Structure
String handling
Function
Array
Pointer
Library function
Header file
File handling
Preprocessor directive 
 Union

    #Overview of C:-
    •  History of C
    •  Advantage of C
    •  Disadvantage of 
    • Application use of C
    History of C

    •  C is the high level language and general purpose programming language. 
    • It was developed by Dennis Ritchie at AT & T Bell laboratory in 1972.
    •  AT&T stands for American Telegraph and telecommunication this lab is located in USA .
    • C language is derived from B and BCPL(Basic combined programming language).
    •  Its main objective is to developed system software such as operating system ,compiler ,interpreter linker, loader etc .
    • Unix operating system is written within C language .
    • C is a case sensitive language its mean lowercase is not equivalent to uppercase ABC not abc.
    •  it is compiled based language.
    Advantage of C

    •  C support procedural programming language and structure modular conventional programming function oriented programming.
    •  It is the traditional method that is used to reduce the complexity of program in this case a program is divided into multiple parts that part is called function module.
    •  In this case we can write source code of any particular method according to requirement.
    •  C supports both high level and low level programming language so it is also known as mid or middle level language.
    •  It support system programming in this case we can design compiler interpreter operating system etc
    •  It also supports application programming such as school management system , automation system Supermarket etc.
    •  C support rich set of library functions such as mathematical function conversion function date and time function.
    •  It supports graphic programming in this case we can design human face car umbrella
    •  It support game programming due to graphics
    •  Its execution is past due to compiler based language
    •  It is portable because it can be executed on different operating system such as Windows Linux Unix Solaris Macintosh(MAC) etc.

    Disadvantage of C
    • It does not support object oriented programming(oops).
    •  It is a platform dependent language.
    •  It is a case sensitive language.
    •  It does not support database directly.
    • It is not secure due to pointer.
     Application of C
    •  It is mainly used to develop system software such as operating system compiler linker loader etc
    • It is also used to develop application software such as school management system Supermarket.
    • It is also used to develop game programming.
    Tokens 
    Tokens are the smallest unit/elements that are used to create a program there are some tokens in C.



    Character set
    Constant 
    Variable 
    Keywords
    Identifier
    Data type
    Escape sequence
    Comment
    Operator & Deliminator
    Expression


       *Character set 
      It represent different type of set of character.
      a) Alphabet-- A to Z ,a to z.
      b) Digit --      0-9 
      c) Special character:-
      ,
      < 
      > 
      .
      _
      (
      )
      ;
      $
      :
      %
      [
      ]
      #
      ?
      '
      &
      {
      }
      "
      ^
      !
      *
      /
      |
      -
      \
      ~
      +

      * Constant 
      Constant is a fixed value that cannot be changed during execution of program.
      It is also known as literal.
      Ex:- 10,10.5  "cimage"  'p'
      #Types of constant
       There are three types of constant.
      •  Numeric Constant.
      •  String constant
      •  Character set constant
       *Numeric constant is two type.
      Integer(10,100,45) and Real/Float(10.5,20.5).
       *String constant
       String is a collection of zero ,one and more character that are enclosed within double quote string is always terminated with the null character(\0).
      It represent ending of character in string.
      Ex:-"cimage" --|c|i|m|a|g|e|\0|
                                1 2 3 4 5 6 7 index value.
       *Character constant
       It represent only single character that is enclosed within single quote.
      Ex:- 'a' 'A' '@'  'ab'.

       *Variable
       Variable is a memory location that is used to store constant value according to the specified data type It's value can be changed during execution of program.
      a=10 b=10.5 nm="cimage".
      ch|variable|   =     's'|constant|

       There are two types of variable.
      • Local variable 
      • Global variable
       Local variables:- Those variable that are declared within function called local variable.
       It's provides local accessibility it means local variable cannot be accessed outside of function.

       Global variable:- Those variable that are declared outside of function call Global variable it provides Global accessibility it means this variable can be accessed outside function and more than one function.

      *Operators
      Operator is a special symbol that performs operation on operands.
      Eg:--   |10|+|20|     10,20=operands , |+|=Operator
      #There are some operator:-
      Arithmetic operator||Relational operator||Logical operator||Assignment operator 
      Compound assignment operator||Increment operator||Decrement operator||Comma operator 
      Size of operator||Bitwise operator||Unary operator ||Binary operator||Ternary operator                                                   
        Arithmetic operator:-
        This operator is used to perform arithmetic operations such as addition,subtraction multiplication etc.
        +Adds two operands.A + B = 30
        Subtracts second operand from the first.A − B = -10
        *Multiplies both operands.A * B = 200
        /Divides numerator by de-numerator.B / A = 2
        %Modulus Operator and remainder of after an integer division.B % A = 0
        ++Increment operator increases the integer value by one.A++ = 11
        --Decrement operator decreases the integer value by one.A-- = 9
        Note:-
        10.2%2.3=? X (error) Does not Support.
        • Real time operand cannot be used with modulo division.
        • The sign of remainder depends on only the sign of first operand
        • If the value of first operand is less than the value of second operand then modulo division returns the value of first operand.
        Relational operator:-
        This operator is  used to establish a relationship between two operands.
         In other words it is used to compare between two value so it is also known as comparison operator. its main objective is to  create condition in this case it returns Boolean value such as true or false if condition is true then it return 1 otherwise return 0.
        ==Checks if the values of two operands are equal or not. If yes, then the condition becomes true.(A == B) is not true.
        !=Checks if the values of two operands are equal or not. If the values are not equal, then the condition becomes true.(A != B) is true.
        >Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true.(A > B) is not true.
        <Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true.(A < B) is true.
        >=Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true.(A >= B) is not true.
        <=Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true.(A <= B) is true.
        Eg:-
        20  > =20 = 1
        4 ! = 4 = 0
        30 > 40 = 0
        4 == 5 = 0
        30 > 20 = 1

        Logical operator:-
        This operator is used to combined more than one condition.it also returns Boolean values such as 0 and 1.
        &&Called Logical AND operator. If both the operands are non-zero, then the condition becomes true.(A && B) is false.
        ||Called Logical OR Operator. If any of the two operands is non-zero, then the condition becomes true.(A || B) is true.
        !Called Logical NOT Operator. It is used to reverse the logical state of its operand. If a condition is true, then Logical NOT operator will make it false.!(A && B) is true.
        Eg:-
        10 > 20 && 4! = 5 &&3 > 2  ------ 0
        20 >= 20 && 4 > 3    ---1
        30 > 20 || 40 ! = 40   ----1
        ! (40 > 50 )  -----1
        ! (30 > 20 &&  4! =5 ) ----0

        Assignment operator:-
        This operator is used to assign value in a variable.
        Eg:-
        a=10
        b=52.2=14=c45;

        Compound Assignment operator:-
         When arithmetic operator is used with assignment operator called compound assignment operator. it is also known as shortcut assignment operator.
        =Simple assignment operator. Assigns values from right side operands to left side operandC = A + B will assign the value of A + B to C
        +=Add AND assignment operator. It adds the right operand to the left operand and assign the result to the left operand.C += A is equivalent to C = C + A
        -=Subtract AND assignment operator. It subtracts the right operand from the left operand and assigns the result to the left operand.C -= A is equivalent to C = C - A
        *=Multiply AND assignment operator. It multiplies the right operand with the left operand and assigns the result to the left operand.C *= A is equivalent to C = C * A
        /=Divide AND assignment operator. It divides the left operand with the right operand and assigns the result to the left operand.C /= A is equivalent to C = C / A
        %=Modulus AND assignment operator. It takes modulus using two operands and assigns the result to the left operand.C %= A is equivalent to C = C % A
        <<=Left shift AND assignment operator.C <<= 2 is same as C = C << 2
        >>=Right shift AND assignment operator.C >>= 2 is same as C = C >> 2
        &=Bitwise AND assignment operator.C &= 2 is same as C = C & 2
        ^=Bitwise exclusive OR and assignment operator.C ^= 2 is same as C = C ^ 2
        |=Bitwise inclusive OR and assignment operator.C |= 2 is same as C = C | 2
        Sizeof() operator:-
        This operator returns the size of datatype in byte.
        sizeof(datatype).
        sizeof(int)  =2
        sizeof(float)  4.

        Bitwise Operator:-
        This operator is used to perform bit operation in 0 and 1 format.
         It is used in low level programming .
         #There are two types of bitwise operator
        •  Logical bitwise operator
        •  Shift bitwise operator
        Logical Bitwise Operator:-
        Bitwise operator works on bits and perform bit-by-bit operation. The truth tables for &, |, and ^ is as follows −
        pqp & qp | qp ^ q
        00000
        01011
        11110
        10011
        Assume A = 60 and B = 13 in binary format, they will be as follows −
        A = 0011 1100
        B = 0000 1101
        -----------------
        A&B = 0000 1100
        A|B = 0011 1101
        A^B = 0011 0001
        ~A = 1100 0011
        #Shift Bitwise operator:-

        &Binary AND Operator copies a bit to the result if it exists in both operands.(A & B) = 12, i.e., 0000 1100
        |Binary OR Operator copies a bit if it exists in either operand.(A | B) = 61, i.e., 0011 1101
        ^Binary XOR Operator copies the bit if it is set in one operand but not both.(A ^ B) = 49, i.e., 0011 0001
        ~Binary Ones Complement Operator is unary and has the effect of 'flipping' bits.(~A ) = -61, i.e,. 1100 0011 in 2's complement form.
        <<Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand.A << 2 = 240 i.e., 1111 0000
        >>Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand.A >> 2 = 15 i.e., 0000 1111
        Unary operator:-
        Those operator that are used with only single operand called unary operator.
        Eg:-   a++,b--.

        Binary operator:-
        Those operator that are used with two operands called Binary operator.

        Ternary Operator:-This Operator is used to check small condition.In this case condition is checked if condition is true then true part will execute otherwise false part will execute. so it is also known as conditional operator. It is said to be ternary because it is used with three operands such as true part, false part and condition.
        (?:) It represent
        (Condition ? True part : False part)
        Ex:-(n%2==0 ? "Even" : "Odd")
        (n>0 ? "Positive" : "Negative")

        Keywords:-
        Data type:-
        Escape Sequence:-
        Identifier:-
        Comment:-
        Delimeter:-
        Format Specifier:-
        Structure of C program:-
        Input/Output function:-
        Control Statement:-
        Array:-
        String Handling:-
        Function:-
        Pointer:-
        Structure:-
        Recursive Function:-