Questions
Compare the details of the passwd and shadow files under /etc/ –Who is the owner and...

  1. Compare the details of the passwd and shadow files under /etc/

–Who is the owner and group for each of the files?

–What permissions are assigned for these files?

–Are the permissions consistent with the results of activity you did before.

–Discuss the permissions in light of principle of least privilege.

2. Check the details of the log directory under /var/

–Who is the owner and group of the directory?

–What permissions are assigned for this directory?

–Discuss the permissions in light of principle of least privilege.

3. What happens to a file when the primary group of its user owner changes?

USE LINUX to answer

In: Computer Science

Write a C code program to implement the comparisons of three integer numbers, using only conditional...

Write a C code program to implement the comparisons of three integer numbers, using only conditional operators (no if statements). Please ask the user to input random three integers. Then display the minimum, middle, and maximum number in one line. Also, please calculate and display the sum and the average value (save two digits after decimal point) of these three integers. Please write the comments line by line.

In: Computer Science

What is the reason/s behind unit and system testing? Discuss in 120–150 words.

What is the reason/s behind unit and system testing? Discuss in 120–150 words.

In: Computer Science

In your book there is a Class method called Square that draws a square either using...

In your book there is a Class method called Square that draws a square either using a border or a solid. Using that class, create a Square2 class that also prompts the user for the character to be printed (i.e. such as #, $, whatever) and if the user enters a blank character it defaults to *.

You’ll need to modify the called private methods in Square to accept a character passed.

Note that for the purposes of this Lab it is okay to prompt the user from the class methods.

Sample session:

M:\Java253>java Square2Driver

Enter width of desired square: 9

Area = 81

What character should be used for printing? (i.e. *) #

Print with (b)order or (s)olid? s

#########

#########

#########

#########

#########

#########

#########

#########

#########

/***********************************************************

* SquareDriver.java

* Dean & Dean

*

* This is the driver for the Square class. ***********************************************************/

import java.util.Scanner;

public class SquareDriver

{

public static void main(String[] args)

{   

Scanner stdIn = new Scanner(System.in);

   Square square;

   System.out.print("Enter width of desired square: ");

square = new Square(stdIn.nextInt());

   System.out.println("Area = " + square.getArea());   

square.draw();

} // end main

} // end class SquareDriver

/************************************************************
* Square.java
* Dean & Dean
*
* This class manages squares.
************************************************************/

import java.util.Scanner;

public class Square
{
private int width;

//*********************************************************

public Square(int width)
{
this.width = width;
}

//*********************************************************

public int getArea()
{
return this.width * this.width;
}

//*********************************************************

public void draw()
{
Scanner stdIn = new Scanner(System.in);

System.out.print("Print with (b)order or (s)olid? ");
if (stdIn.nextLine().charAt(0) == 'b')
{
drawBorderSquare();
}
else
{
drawSolidSquare();
}
} // end draw

//*****************************************************

private void drawBorderSquare()
{
drawHorizontalLine();
drawSides();
drawHorizontalLine();
} // end drawBorderSquare

//*****************************************************

private void drawSolidSquare()
{
for (int i=0; i<this.width; i++)
{
drawHorizontalLine();
}
} // end drawSolidSquare

//*****************************************************

private void drawHorizontalLine()
{
for (int i=0; i<this.width; i++)
{
System.out.print("*");
}
System.out.println();
} // end drawHorizontalLine

//*****************************************************

private void drawSides()
{
for (int i=1; i<(this.width-1); i++)
{
System.out.print("*");
for (int j=1; j<(this.width-1); j++)
{
System.out.print(" ");
}
System.out.println("*");
}
} // end drawSides
} // end class Square

In: Computer Science

- Students must develop the code required to create a square two-dimensional array just large enough...

- Students must develop the code required to create a square two-dimensional array just large enough to store a given string in encrypted form using the given encryption algorithm. The character used after the end of the encrypted string is the ASCII delete key, set as final UNPRINTABLE_CHAR_VALUE. After this value is stored, the encryption process fills the remaining elements with random values

- Students must develop the code to decrypt a given square two-dimensional array and using the given encryption algorithm

- Students must develop other supporting methods as specified (below) to manage the encryption operations*

- Students will also document all classes and methods using the Javadoc commenting process; comments are not required to be exactly the same as found in the supporting document (below) but they should be semantically equivalent

- Students will upload the EncryptionClass.java file to this assignment; any other uploaded files will result in a reduction of the project grade, and in some cases, may cause a complete loss of credit

- Assignment Specification (Javadoc output for the project):

p1_package

Class EncryptionClass

  • java.lang.Object
    • p1_package.EncryptionClass

FileIoToolsForEncryptionClass.java

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class EncryptionClass
   {/**
     * Constant for maximum input char limit
     */
    private final int MAX_INPUT_CHARS = 256;
  
    /**
     * Constant for unprintable char value used as message end char
     */
    private final int UNPRINTABLE_CHAR_VALUE = 127; // ASCII for delete key

    /**
     * Constant for minus sign used in getAnInt
     */
    private final char MINUS_SIGN = '-';
  
    /**
     * Class Global FileReader variable so methods can be used
     */
    private FileReader fileIn;
  
    /**
     * Downloads encrypted data to file
     * <p>
     * Note: No action taken if array is empty
     * @param fileName String object holding file name to use
     */
    void downloadData( String fileName )
       {FileWriter toFile;     
        int rowIndex, colIndex;     
        if( arrSide > 0 )
           {
            try
               {
                toFile = new FileWriter( fileName );
                toFile.write( "" + arrSide + "\r\n" );
                for( rowIndex = 0; rowIndex < arrSide; rowIndex++ )
                   {
                    for( colIndex = 0; colIndex < arrSide; colIndex++ )
                       {
                        if( encryptedArr[ rowIndex ][ colIndex ] < 100 )
                           {
                            toFile.write( "0" );
                           }              
                        toFile.write(" "+ encryptedArr[ rowIndex ][ colIndex ] + " " );
                       }
                    toFile.write( "\r\n" );
                   }
         
                toFile.flush();
                toFile.close();
               }
            catch( IOException ioe )
               {
                ioe.printStackTrace();
               }
           }
       }

    /**
     * gets an integer from the input stream
     *
     * @param maxLength maximum length of characters
     * input to capture the integer
     *
     * @return integer captured from file
     */
    private int getAnInt( int maxLength )
       {
        int inCharInt;
        int index = 0;
        String strBuffer = "";
        int intValue;
        boolean negativeFlag = false;

        try
           {
            inCharInt = fileIn.read();

            // clear space up to number
            while( index < maxLength && !charInString( (char)inCharInt,
                                                           "0123456789+-" ) )
               {
                inCharInt = fileIn.read();              
                index++;
               }    
            if( inCharInt == MINUS_SIGN )
               {
                negativeFlag = true;
                inCharInt = fileIn.read();
               }

            while( charInString( (char)inCharInt, "0123456789" ) )
               {
                strBuffer += (char)( inCharInt );

                index++;
             
                inCharInt = fileIn.read();
               }          
           }
     
        catch( IOException ioe )
           {
            System.out.println( "INPUT ERROR: Failure to capture character" );
            strBuffer = "";
           }
        
        intValue = Integer.parseInt( strBuffer );
     
        if( negativeFlag )
           {
            intValue *= -1;
           }
     
        return intValue;
       }

    /**
     * Uploads data from file holding a square array
     *
     * @param fileName String object holding file name
     */
    void uploadData( String fileName )
       {
        int rowIndex, colIndex;
    
        try
           {
            // Open FileReader
            fileIn = new FileReader( fileName );
      
            // get side length
            arrSide = getAnInt( MAX_INPUT_CHARS );         
    
            encryptedArr = new int[ arrSide ][ arrSide ];
          
            for( rowIndex = 0; rowIndex < arrSide; rowIndex++ )
               {
                for( colIndex = 0; colIndex < arrSide; colIndex++ )
                   {
                    encryptedArr[ rowIndex ][ colIndex ]
                                                  = getAnInt( MAX_INPUT_CHARS );
                   }
               }
          
            fileIn.close();
           }
    
        // for opening file
        catch( FileNotFoundException fnfe )
           {
            fnfe.printStackTrace();
           }
      
        // for closing file
        catch (IOException ioe)
           {
            ioe.printStackTrace();
           }
       }   
   }  

In: Computer Science

Linux 1. Give a command line (one command) for displaying the files lab1, lab2, lab3, and...

Linux

1. Give a command line (one command) for displaying the files lab1, lab2, lab3, and lab4. Can you give another command lines that do the same thing by making use of the file name similarities? What is the command line for displaying the files lab1.c, lab2.c, lab3.c, and lab4.c? (Hint: use shell metacharacters.)

2. How to determine the number of users who are logged on to Linux server system at this time? What command did you use to discover this?

3. Determine the name of the operating system that the Linux server runs. What command did you use to discover this

4. What are special files in UNIX? What are character special files and block special files? Run the ls /dev | wc -w command to find the number of special files that the linux server system has.

5. What is the inode number of the root directory on the linux server? Give the commands that you used to find the inode number.

In: Computer Science

ITT-270 IPv6 Stateful Autoconfig, Static and Default Routing, OSPF Guide Directions:This assignment will configure IPv6. To...

ITT-270 IPv6 Stateful Autoconfig, Static and Default Routing, OSPF Guide

Directions:This assignment will configure IPv6. To complete this assignment, follow the guidelines provided below. At the end of this document you will find the related assignment questions; submit only the completed questions portion to your instructor. Note: At various points you will be required to obtain a screen capture; add this directly into the document following the related question.

Objectives

  • Manual and stateful autoconfiguration
  • Static and default routing
  • OSPF v3

Guidelines

For this assignment, the network will look like this.  The routers are Cisco 2911 models and the switches are Cisco 2960 models.

(Todd, 2016)

There will be no need to create any connections or devices for this assignment.

  1. Login to the C router and configure the Outside address as 2001:db8:3c4d:1::/64by typing the following commands:  
    1. Ipv6 unicast-routing
    2. Int gi0/0
    3. Ipv6 address 2001:db8:3c4d:1::1/64
  2. Now, the inside address needs to be 2001:db8:3c4d:2::/64. Complete this by typing the following commands:  
    1. Int gi0/1
    2. Ipv6 address 2001:db8:3c4d:2::1/64
    3. CTRL+Z
  3. Verify by typing the following command:
    1. Show ipv6 route

Capture the screen (screenshot 1) and place it with the related question below.  

  1. Continue by typing the following command:
    1. show ipv6 int brief

Capture the screen (screenshot 2) and place it with the related question below.  

  1. Login to router A and set it to autoconfig ipv6 by typing the following commandsin Global Configuration mode:  
    1. ipv6 unicast-routing
    2. int gi0/0
    3. ipv6 address autoconfig
    4. No shut
    5. CTRL+Z
  2. Confirm by typing the following command:  
    1. sh ipv6 int brief

Capture the screen (screenshot 3) and place it with the related question below.  

Before continuing, answer question 1 below.  

  1. Complete this for router B, D, and E.  

Capture the screen (screenshot 4, 5 and 6) for each router and place them with the related questions below.  

  1. Setup static and default routing.  On router A configure a static route to the 2001:db8:3c4d:2::/64 by typing the following commands:
    1. config t
    2. ipv6 route 2001:db8:3c4d:2::/64 gi0/0
    3. do show running-config

Capture the screen (screenshot 7) and place it with the related question below.

  1. Continue by typing the following command:  
    1. show ipv6 route

Capture the screen (screenshot 8) and place it with the related question below.  

Before continuing, answer question 2 below.

  1. On router B, configure a default route by typing the following commands:   
    1. conf t
    2. ipv6 route ::/0 gi0/0
      1. (there is a space after route)
    3. do show running-config

Capture the screen (screenshot 9) and place it with the related question below.  

  1. Continue by typing the following command on Router B:  
    1. show ipv6 route

Capture the screen (screenshot 10) and place it with the related question below.  

Before continuing, answer questions 3 and 4 below.  

  1. On router D, create a static route the other way by typing the following commands in Global Configuration mode:  
    1. ipv6 route 2001:db8:3c4d:1::/64 gi0/0
    2. do show running-config

Capture the screen (screenshot 11) and place it with the related question below.  

  1. Continue by typing the following command:  
    1. show ipv6 route

Capture the screen (screenshot 12) and place it with the related question below.  

  1. On router E, do the same.

Before continuing, answer question 5 below.  

  1. On Router E, run the following command:
    1. show running-config

Capture the screen (screenshot 13) and place it with the related question below.  

  1. Continue by typing the following command:  
    1. show ipv6 route

Capture the screen (screenshot 14) and place it with the related question below.  

  1. Ping from router D to router A. First, we need to find out what autoconfig address exists on router A (should being with 2001). Type the following command:
    1. sh ipv6 int brief
  2. On router D
    1. Ping <IP ADDRESS>

Capture the screen (screenshot 15) and place it with the related question below.  

Before continuing, answer question 6 below.  

Note: Now, it’s time to practice with OSPFv3. Unfortunately, because OSPF has automagic routing, the routing that was set before needs to be removed. Of course, one could just close the app and re-open it, but practice instead.  

  1. On router A type the following command:
    1. no ipv6 route 2001:db8:3c4d:2::/64 gi0/0
  2. On router B type the following command:
    1. no ipv6 route ::/0 gi0/0
  3. On router D type the following command:
    1. no ipv6 route 2001:db8:3c4d:1::/64 gi0/0
  4. On router E type the following command:
    1. no ipv6 route 2001:db8:3c4d:1::/64 gi0/0
  5. We aren’t doing this for router C.

Before continuing, answer question 7 below.  

  1. IRL, if IPv4 is not configured, RIDs need to be created for each router. On router A, define ospf 1 with RID 1.1.1.1 by typing the following commands:  
    1. ipv6 router ospf 1
    2. router-id 1.1.1.1
  2. Now, assign ospf 1 to the outside interface by typing the following commands:
    1. int gi0/0
    2. ipv6 ospf 1 area 0
    3. CTRL+Z
  3. Verify by typing the following commands:  
    1. sh ipv6 route
    2. sh ipv6 route ospf
    3. sh ipv6 int gi0/0
    4. sh ipv6 neighbor
  4. On router B, define ospf1 with RID 2.2.2.2, then assign OSPF 1 to f0/0 by typing the following commands:  
    1. ipv6 router ospf 1
    2. router-id 2.2.2.2
    3. int gi0/0
    4. ipv6 ospf 1 area 0
    5. CTRL+Z
  5. Verify by typing the following commands:  
    1. sh ipv6 route
    2. sh ipv6 route ospf
    3. sh ipv6 int gi0/0
    4. sh ipv6 neighbor
  6. Complete the same with routers C, D, & E, changing the “Router-id #.#.#.#” to be 3.3.3.3, 4.4.4.4, & 5.5.5.5, respectively.  On Router C, make sure that you issue the ipv6 ospf 1 area 0on both interfaces (gi0/0 & gi0/1).

Before continuing, answer question 8 below.  

  1. In order to confirm the ping, determine the ipv6 addresses for each router. These should all begin with 2001.  Do not use the FE80addresses as they are link-local addresses.  

Finish this assignment by completing question 9 below.

ITT-270 Stateful Autoconfig, Static and Default Routing, OSPF – Questions

Complete the following questions as required by the prompts within the guidelines above.  

  1. What does no shut do?

  1. Why are we creating a static route here? Why not a dynamic route?

  1. In this context, what is the difference between static and default routes?

  1. Will both routers ping gi0/1 on router C?

  1. What’s the command here?
  1. Can everybody ping everybody else? Fill out the chart.

A

B

C

D

E

A

---

B

---

C

---

D

---

E

---

  1. Why?

  1. What commands will you use for each router?  
  1. Fill out the table.

A

B

C

D

E

In: Computer Science

C++ Write a program that reads a line of text, changes each uppercase letter to lowercase,...

C++

Write a program that reads a line of text, changes each uppercase letter to lowercase, and places each letter both in a queue and onto a stack. The program should then verify whether the line of text is a palindrome (a set of letters or numbers that is the same whether read forward or backward). Please use a Queue Class and Stack class.

In: Computer Science

1. Copying and pasting from the Internet can be done without citing the Internet page, because...

1. Copying and pasting from the Internet can be done without citing the Internet page, because everything on the Internet is common knowledge and can be used without citation. True False

2. You don’t have to use quotation marks when you quote an author as long as you cite the author’s name at the end of the paragraph. True False

3. When you summarize a block of text from another work, citing the source at the end of your paper is sufficient. True False

4. If you quote your roommate in an interview, you don’t have to cite him/her or use quotation marks. True False

5. You don't have to cite famous proverbs because they’re common knowledge. True False

6. If you borrow someone's idea and use it in a paper, you don’t have to cite it. True False

7. Using a few phrases from an article and mixing them in with your own words is not plagiarism. True False

8. Song lyrics don't have to be cited. True False

9. If you come across the phrase "to be or not to be" and use it in your paper, you have to cite it. True False

10. The date for George Washington’s birthday is common knowledge which means you don't have to cite the source in which you found it. True False

In: Computer Science

Part 2: You will create five tables in your ColonialAdventureTours database. Please do not write your...

Part 2: You will create five tables in your ColonialAdventureTours database. Please do not write your own SQL Commands for this task, use data found in the following Colonial_create.txt file and copy and paste the commands into MySQL workbench. Then add Primary key, Foreign key, and not null constraints appropriately. Then run your codes. Note: Remember that since you enforced referential integrity (foreign key constraints) that you must create the "primary" tables before you can create the "related" tables in the relationship. [Create tables in right orders].

In: Computer Science

Flag Create a database for PAINTER and PAINTING entities/tables; Decide on your own what will be...

Flag Create a database for PAINTER and PAINTING entities/tables; Decide on your own what will be the attributes of PAINTER and PAINTING tables; Insert at least 5 records on each table Deliverables: Screenshot of PAINTER and PAINTING table structures using the describe command Screenshot of PAINTER and PAINTING table records/entries using select command.

In: Computer Science

C++ Programming ----------------------MENU------------------ Water bottles Samll (s)….……………..…..1.10 Large (L)……………………..2.10 Juice 8 OZ…………………….……..1.75 10 OZ………………………….2.20 Soda………….…………………….1.00 How...

C++ Programming
----------------------MENU------------------
Water bottles Samll (s)….……………..…..1.10
Large (L)……………………..2.10
Juice
8 OZ…………………….……..1.75
10 OZ………………………….2.20
Soda………….…………………….1.00
How many water bottles? 2
What size(S/L)? L
How many juices? 3
What size(8/10 OZ)? 10
How many sodas? 2
Total bill = xx.xx

In: Computer Science

This class models people moving in together in real life using pointers in C++. What test(s)...

This class models people moving in together in real life using pointers in C++.

What test(s) could be added with the code below? At the end of this task, add them! (Answer this.)

class Person {  
public:       
    Person(const string& name) : name(name) {}
    void movesInWith(Person& newRoomate) {
        roomie = &newRoomate;        // now I have a new roomie            
        newRoomate.roomie = this;    // and now they do too       
    }       
    const string& getName() const { return name; }
    // Don't need to use getName() below, just there for you to use in debugging.
    const string& getRoomiesName() const { return roomie->getName(); }  
private:
    Person* roomie;       
    string name;  
};           

// write code to model two people in this world       
Person joeBob("Joe Bob"), billyJane("Billy Jane");         

// now model these two becoming roommates       
joeBob.movesInWith(billyJane);         

// did this work out? (Answer this and explain why.)      
cout << joeBob.getName() << " lives with " << joeBob.getRoomiesName() << endl;
cout << billyJane.getName() << " lives with " << billyJane.getRoomiesName() << endl;

What changes can be made to the Person class above to keep the methods "safe"? For example, the movesInWith method.

I dont understand what this above question means, please help!

In: Computer Science

****C language**** char lName[][15] = {"Brum","Carroll","Carter","Dodson","Garbus", "Greenwood", "Hilliard", "Lee", "Mann", "Notz", "Pastrana", "Rhon", "Rodriguez", "Wilson", "Zimmerman"};...

****C language****

char lName[][15] = {"Brum","Carroll","Carter","Dodson","Garbus", "Greenwood", "Hilliard", "Lee", "Mann", "Notz", "Pastrana", "Rhon", "Rodriguez", "Wilson", "Zimmerman"};

char fName [][15] = {"Natalie","Cody","Sophia","Dominic","Chandler","Caleb","Sydnee","Peyton","Brianna","Zachery","Kevin","Luke","Juan","Kelci","Adam"};

char middleInitial[15]={'N','L','X','L','O','L','M','B','S','T','J','C','P','D','Z'};

char dob[][11]={"05/27/1935","11/27/1971","10/17/2003","12/08/1990","11/25/1991","10/30/1992","09/22/1993","08/04/1994","07/11/1995","06/18/1996","05/28/1997","04/07/1998","03/12/1999","02/23/2000","01/15/2001"};

How would we make a list ordered by their age, oldest first, Print the patient's full name and then their age.  Left justify the name and right justify the age.

Example:
Johnson, Fred N 80

**Half of the code is provided**

int patientAge[15] = {0};

for(int p = 0; p <15; p++)
{
int year = ((dob[p][6] - '0') * 1000) + ((dob[p][7] - '0') *100) + ((dob[p][8] - '0') * 10) + ((dob[p][9] - '0') * 1);

patientAge[p] = 2019 - year;
printf("%s, %s %c Age: %d\n",lName[p], fName[p], middleInitial[p], patientAge[p]);
}

In: Computer Science

We want to compute Cyclic Redundancy Check (CRC) for the given the data bits D=110001, generator...

We want to compute Cyclic Redundancy Check (CRC) for the given the data bits D=110001, generator G=1001, and 3 CRC bits (i.e., r=3),.

Explain the algorithm and implement the CRC computation in a programming language (e.g., C, C++, and Python) with the above setting.

In: Computer Science