1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ella [17]
2 years ago
7

What command should be executed to view the configuration of the nic?

Computers and Technology
1 answer:
natima [27]2 years ago
5 0
*nix: ifconfig
dos: ipconfig
You might be interested in
If you were going to construct a table that only included shapes name with number prefixes, which shape would you inlcude?
Annette [7]

Answer: Triangle

Explanation: Triangle has Tri

8 0
2 years ago
Create a program which will input data into a pipe one character at a time. Count the number of characters as they are written i
LenKa [72]

Answer:

a)

#include<stdio.h>

#include<stdlib.h>

#include<fcntl.h>

#include<unistd.h>

 

#define BUFSIZE 16

int main(){

   //pipe descriptors

   char msg[BUFSIZE];

   char buf[BUFSIZE];

   int pipefd[2];

   if(pipe(pipefd) == -1){

       //pipe creation error

       perror("pipe");

       exit(EXIT_FAILURE);

   }

   //pipe creation successfull

   //write four messages

   sprintf(msg , "apple");

   write(pipefd[1], msg, BUFSIZE);

   printf("Written %s\n", msg);

   sprintf(msg , "boy");

   write(pipefd[1], msg, BUFSIZE);

   printf("Written %s\n", msg);

   sprintf(msg , "cat");

   write(pipefd[1], msg, BUFSIZE);

   printf("Written %s\n", msg);

   sprintf(msg , "dog");

   write(pipefd[1], msg, BUFSIZE);

   printf("Written %s\n", msg);

   //read

   read(pipefd[0], buf, BUFSIZE);

   printf("Read: %s\n", buf);

   read(pipefd[0], buf, BUFSIZE);

   printf("Read: %s\n", buf);

   read(pipefd[0], buf, BUFSIZE);

   printf("Read: %s\n", buf);

   read(pipefd[0], buf, BUFSIZE);

   printf("Read: %s\n", buf);

   close(pipefd[0]);

   close(pipefd[1]);

   return 0;

}

(b)

#include<stdio.h>

#include<stdlib.h>

#include<fcntl.h>

#include<unistd.h>

#include<wait.h>

#define BUFSIZE 16

int main(){

   //pipe descriptors

   char msg[BUFSIZE];

   char buf[BUFSIZE];

   int pipefd[2];

   if(pipe(pipefd) == -1){

       //pipe creation error

       perror("pipe");

       exit(EXIT_FAILURE);

   }

   //pipe creation successfull

   //write four messages

   if(fork() == 0){

       //this is child

       //close unused write end

       close(pipefd[1]);

       read(pipefd[0], buf, BUFSIZE);

       printf("This is child process reading first message. Content is %s\n", buf);

       read(pipefd[0], buf, BUFSIZE);

       printf("This is child process reading second message. Content is %s\n", buf);

       read(pipefd[0], buf, BUFSIZE);

       printf("This is child process reading third message. Content is %s\n", buf);

       read(pipefd[0], buf, BUFSIZE);

       printf("This is child process reading fourth message. Content is %s\n", buf);

       close(pipefd[0]);

       //exit from child

       exit(EXIT_SUCCESS);

   }

   //this is parent process

   //close unused read end

   close(pipefd[0]);

   sprintf(msg , "apple");

   printf("This is parent process. Writing first message into pipe\n");

   write(pipefd[1], msg, BUFSIZE);

   sprintf(msg , "boy");

   printf("This is parent process. Writing second message into pipe\n");

   write(pipefd[1], msg, BUFSIZE);

   sprintf(msg , "cat");

   printf("This is parent process. Writing third message into pipe\n");

   write(pipefd[1], msg, BUFSIZE);

   sprintf(msg , "dog");

   printf("This is parent process. Writing fourth message into pipe\n");

   write(pipefd[1], msg, BUFSIZE);

   close(pipefd[1]);

   //wait for child

   wait(NULL);

   return 0;

}

(c)

#include<stdio.h>

#include<stdlib.h>

#include<fcntl.h>

#include<unistd.h>

#include<sys/wait.h>

#include<sys/types.h>

#include<signal.h>

typedef struct sigaction Sigaction;

unsigned long long size = 0;

void alarmhandler(int sig){

   //alarm fired writing blocked

   printf("Write blocked after %llu characters\n", size);

   exit(EXIT_SUCCESS);

}

int main(){

   //pipe descriptors

   int pipefd[2];

   if(pipe(pipefd) == -1){

       //pipe creation error

       perror("pipe");

       exit(EXIT_FAILURE);

   }

   //install handler

   sigset_t mask , prev;

   sigemptyset(&mask);

   sigaddset(&mask , SIGALRM);

   sigprocmask(SIG_BLOCK , &mask , &prev);

   Sigaction new_action;

   sigemptyset(&new_action.sa_mask);

   new_action.sa_flags = SA_RESTART;

   new_action.sa_handler = alarmhandler;

   sigaction(SIGALRM , &new_action , NULL);

   sigprocmask(SIG_SETMASK , &prev, NULL);

   while(1){

     

       //print size on multiple of 4

       if(size != 0 && size % 1024 == 0){

           printf("%llu characters in pipe\n", size);

       }

       //reset previous alarm

       alarm(0);

       //set new alarm for 5 seconds

       alarm(5);

       //write to pipe one character

       write(pipefd[1], "A", sizeof(char));

       size++;

   }

   return 0;

}

Explanation:

Output for a, b, c are pasted accordingly

4 0
3 years ago
One of the ways attackers can access unencrypted data being transmitted on your network is by
nikdorinn [45]
<span>One of the ways attackers can access unencrypted data being transmitted on your network is by </span>collecting electronic emissions that come from your networking closet or Ethernet cables. 
5 0
2 years ago
Why was the television the first audio visual device that changed the way people see entertainment?
Daniel [21]
It was  not.   Movies   then  talking movies  were   before television.

7 0
3 years ago
You are provided with the following program poem.cpp. All is good, and the memory is allocated dynamically, but it crashes your
Maslowich

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

string * createAPoemDynamically()

{

string *p = new string;

*p = "Roses are red, violets are blue";

return p;

}

int main() {

while(true) {

string *p;

p = createAPoemDynamically();

if (!p)

{

cout << "Memory allocation failed\n";

}

cout<<*p<<"\n";

// assume that the poem p is not needed at this point

//delete allocated memory

delete p;

}

}

8 0
2 years ago
Other questions:
  • Points!!!!!!!! pls help
    13·2 answers
  • My ar goal is 16.3 what percent am i at if i have 3 points??
    8·1 answer
  • Computer with a domain name is called a
    7·1 answer
  • With the range E2:E30 selected, create a new conditional formatting rule that uses a formula to apply yellow fill and bold font
    10·1 answer
  • A(n) ____ string contacts the data source and establishes a connection with the database using the Data Source Configuration Wiz
    5·1 answer
  • Histogram 9AMAA 12/01/2021.
    9·1 answer
  • Write a application that can determine if a 5 digit number you input is a palindrome. If the number is a palindrome then print "
    14·1 answer
  • Write a definition in your own words for intranet. Please don't copy and paste.
    7·2 answers
  • Can anyone answer this ​
    12·1 answer
  • IPv4 and IPv6 are addresses used to identify computers on the Internet. Is this whether true or not:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!