Write a shell script

  

Write a shell script, change-lines, which will substitute a string for a replacement string for each occurrence of the string in files specified.
The original file will be saved, with the same filename with the .keep extension unless the -n option is present.
 

You may use a temporary file for this script.
 

Remember the search string and or the replacement string can have special characters in them, so you must use proper quoting techniques.
 

The script will use following options:
 

the option -s “string” for the search strings
the option -r “string” for the replacement string
the -n option to prevent a backup file from being created
the -h option to print a usage statement and exit
The script will exit with an error status and print an error message:
if the -s option is not present.
if the -r option is not present.
if the string is not specified with the -s option
if the string is not specified with the -r option
if there are any other options specified
if there are no input files specified
if the input file cannot be read by the current process
if the input file cannot be written by the current process
if you cannot create the backup file.
Here is the usage statement for the script:
change-lines [-n] -s search string -r replace string files …
-n do not backup the original file
-s search string the search for this string
-r replace string replace the search string with this string
-h print this message
Examples:
 

prompt> change-lines -s foobar -r FooBar *.c
This script will edit all the files *.c, and each occurrence of foobar it will be replaced by FooBar it will be replaced by FooBar.
Each file will be backed up.
 

prompt> change-lines -s “SHELL IS NOT FUN” -r “SHELL PROGRAMING IS A LOT OF FUN” /tmp/file1.txt
 

This script will edit all the file /tmp/file1.txt , and each occurrence of SHELL IS NOT FUN will replaced by the text,
SHELL PROGRAMMING IS A LOT OF FUN. A backup file /tmp/file1.txt.keep will be created.

Graduate Research & Critical Analysis jan 12

Assignment Content

  1. Your homework (HW) is to watch a movie and take some notes! 

    Movie Title: Invictus 
    Rated: PG-13, so you may be able to make it a family experience

    Options for viewing: 

    1) Rental Streaming Platforms ($3): Amazon Prime Video, Google Play, Redbox 
    2) Join a free viewing of the movie on Thursday, 1/12, at 1 pm EST.  Use the following link to join: https://us.bbcollab.com/guest/99d7453adaf74d5f8f0bedbdb051d5ac

    As you watch, take notes on points in the movie that show: 

    1. What important problem did Mandela face, and who was impacted by it?
    2. What might have been the causes of that problem?
    3. What did he try in order to solve it or mitigate it (make it better)
    4. What was the ultimate solution he came to?
    5. How did he implement it?
    6. What are the ways you know it worked?
    7. DO NOT write AFTER the movie! You can pause to take notes
      (If English is not your first language, you can take all or part of your notes in your first language!)
      3.    Submit these notes without editing. If you took notes by hand, take a photo or scan them in. 
      4.    Be prepared to discuss this in class!

Computer Science

QUESTION: How would one define business intelligence (BI)? Identify and briefly discuss a real-world application of BI?

One post with 250 words and response with 125 words.

Discussion 5- Strategy Applied in PM

Assigned Readings:

Chapter. 9 Reducing Project Duration

Chapter. 10 Being an Effective Project Manager

Initial Postings: Read and reflect on the assigned readings for the week. Then post what you thought was the most important concept(s), method(s), term(s), and/or any other thing that you felt was worthy of your understanding in each assigned textbook chapter.Your initial post should be based upon the assigned reading for the week, so the textbook should be a source listed in your reference section and cited within the body of the text. Other sources are not required but feel free to use them if they aid in your discussion.

Also, provide a graduate-level response to each of the following questions:

  1. Which of the eight traits/skills associated with being an effective project manager is the most important? The least important? Why?
  2. It is possible to shorten the critical path and save money. Explain how.

Text

Title: Project Management: The Managerial Process 

ISBN: 9781260238860 

Authors: Clifford F. Gray, Erik W. Larson 

Publisher: McGraw-Hill Education 

Publication Date: 2020-01-09

Discussion with 500 words

 

Write an essay of at least 500 words discussing the Safe Harbor provisions under HIPAA.  

Do not copy without providing proper attribution. This paper will be evaluated through SafeAssign. 

Write in essay format not in outline, bulleted, numbered or other list format.  

Use the five paragraph format. Each paragraph must have at least five sentences. Include 3 quotes with quotation marks and cited in-line and in a list of references. Include an interesting meaninful title.

Include at least one quote from each of 3 different articles. Use the Research Databases available from the Danforth Library, not Google.  Place the words you copied (do not alter or paraphrase the words) in quotation marks and cite in-line (as all work copied from another should be handled). The quotes should be full sentences (no more, less) and should be incorporated in your discussion (they do not replace your discussion) to illustrate or emphasize your ideas.

Cite your sources in a clickable reference list at the end. Do not copy without providing proper attribution (quotation marks and in-line citations).

It is important that you use your own words, that you cite your sources, that you comply with the instructions regarding length of your submission Do not use spinbot or other word replacement software. Proof read your work or have it edited. Find something interesting and/or relevant to your work to write about.  

Please do not submit attachments unless requested.

Discussion

 

Week 13 discussion

Explain your thoughts on the future of IoT and the security implications. Why do you believe it is important to secure these devices as they become more common in our lives and our businesses?

Your post should be at least 30 words.

 

Week 13 Discussion

What are some of the industry standard certifications that exists.  Which ones are the most sought after in the IT security field and why? What are the requirements for the certifications, test, number of questions, duration, domain, years of experience required?

Your post should be at least 350 words.

Python – Write code to open a txt file and get outputs for Parts A, B, C

   

Instructions

Several data files are also present: Patients.txt, Diagnoses.txt, Labs.txt, and Admissions.txt.

Please note that each data file has a columns descriptor line as the first line of the file.  When processing, we must IGNORE that line as it is obviously not valid data. The following code preceding the actual loop that reads the file does just that. Each time you read a file containing that header line you must include this code.

fhand = open('Diagnoses.txt')    # open the file, establish the file handle

fhand.readline()                 # read the first line and ignore it
# declare and set any initialization variables here, such as counters, lists, dictionaries

for line in fhand:         # loop through the file line by line 

Part A

What patient (by ID) has the most admissions? 

1. Open Hwk12a_STARTER.py, rename it, and run it. It should display the ID field from all the lines in the file Admissions.txt. Comments included therein guide your code development.

2. Run and study the code in Ch 9 code sample 13. It provides most of what you need for this task. (PLEASE ATTACHED FILE PART A.JPG FOR CODE SAMPLE)

Part B 

What are the 10 patients (by ID) having the most labs? 

1. To tackle this task, repeat the code you wrote in 12a to create a dictionary containing IDs and the count of those IDs, this time on the Labs.txt file.

2. Then employ the strategies used in Ch 10 code sample 10 (ten most common words) to create a list of tuples, sort the list, and then print the first ten.

  

Part C 

Of the top 10 patients with the most labs, how many are male? Print their IDs and print the number of males in the top 10.

1. Repeat the code you wrote in 12b to create a dictionary containing IDs and the count of those IDs, create the list, and sort the list in reverse.

2. Now you have to find out which of the top 10 in the list of most Labs are male. To do that, you have to loop through the Patients.txt file, checking to see if the ID is present in the same line as the word ‘Male’.

3. Follow the comments in the code to add the statements necessary to achieve the tasks. Don’t be afraid to add print statements to help you write the code; remove them when you’re finished. The output is shown below.

Business Continuity Plan for a Financial Institution

  

PROJECT TITLE

Business Continuity Plan for Financial Institutions

ABSTRACT

Due to increase in customers’ demand, competition, 24hrs continuous service, frequent changes in regulatory policy requirements and changes in various threats landscape have put some pressures on financial institution to bring up a robust and comprehensive contingency plans that assured the continuity of their services.

This paper outlines the relevance of business continuity plan to financial institutions. This project will highlight the stakeholder’s involvement in the development of the plan, the understanding of the plan and how often the plan will be tested.

INTRODUCTION

Financial organizations could confront the disruption of major services due to attacks such as natural disasters like floods, earthquake, or fire. Disruption of services could come because of hacktivist attacks, servers, and networks problems. Because all these reasons, financial institutions need to develop a comprehensive business continuity plans that guarantees quick recovery of business after a disaster.

A single occurrence of a disaster can results in greater financial losses, erode investors and customers confidence and damaging of corporate image. Such an act can also lead to serious legal issues and litigations.

A well designed, implemented and tested contingency plan is the best assurance to protect against financial losses to any organization (Moore, 1995). There is a need for financial organizations to have an effective Business Continuity Plan (BCP) that ensure quick business resumption and limit losses in the event of services disruptions.

STATEMENT OF THE PROBLEMS

Financial institutions are susceptible to different types of services disruptions stated in the introduction above, which could adversely impact the organization. In today’s world, Business Continuity Management (BCM) is becoming increasingly important. This research work will highlight the relevance of Business Continuity Planning to financial institutions and analyses the disaster preparedness of financial institutions to major disasters and disruptions by examining the Business Continuity Management policies, standards, and practices. It will go further to test the awareness and readiness of the stakeholders.

Objective of the study

This research work will highlight the importance of Business Continuity Planning to Financial Institutions.

Scope of the study

This study will be limited to BCP development for financial institutions only. It will cover the following key areas

· Business Continuity Plan Process

o Identification of key business areas.

o Identification of critical functions.

o Identify dependencies between various business areas and functions.

o Determine acceptable downtime for each critical function.

o Create a plan to maintain operations.

· Components of Business Continuity Plan:

o Business Impact Analysis

o Disaster Recovery Plan

o Disaster Recovery Plan and Tabletop test.

· Challenges with implementing Business Continuity Plan

· Summary

C assignment help

C program. NOT C++
specialcountmulthreads.c is not completed. Need some modification

31 text files named input_00.txt to input_30.txt.

Requirements:

Multiple threads are expected to run in parallel to share the workload, i.e. suppose 3 threads to process 30 files totally, then each thread should process 10 files;

When a thread is created, a message should be print out showing which files this thread will process, for example:

Thread id = 274237184 starts processing files with index from 0 to 10!

When a file is being processed, a message should be print out showing which thread (thread_id = xxx) is processing this file, for example:

Thread id = 265844480 is processing file input_11.txt

When a thread is done with its workload, a message should be print out showing which files this thread has done with work, for example:

Thread id = 274237184 is done !

The array long specialfreq[ ] should always be up-to-date, i.e. it always has the result of all the threads counted so far. [You may need to use mutexes to protect this critical region.]

======specialcountmulthreads.c=====================

#include

#include

#include

#include

#include

#include

#define MAX_FILES 30

#define MAX_LEN 1000

int num_threads;

char *filename[MAX_FILES];

int num_files;

long specialfreq[MAX_FILES];

int *index_array[MAX_FILES];

void *thread_function(void *arg) {

int *index = (int *) arg;

int i;

int my_index = *index;

int starting_index = my_index * (num_files / num_threads);

int ending_index = starting_index + (num_files / num_threads);

FILE *fp;

char ch;

int count = 0;

char line[MAX_LEN];

printf(“Thread ID: %lu starts working on files %d to %d.n”, pthread_self(), starting_index, ending_index);

for (i = starting_index; i < ending_index; i++) {

fp = fopen(filename[i], “r”);

if (fp == NULL) {

perror(“Error opening file”);

} else {

printf(“Thread ID: %lu is working on file %sn”, pthread_self(), filename[i]);

while (fgets(line, sizeof (line), fp) != NULL) {

ch = fgetc(fp);

if (ch == ‘!’) {

count++;

}

}

specialfreq[i] = count;

fclose(fp);

}

}

printf(“Thread ID: %lu is done!n”, pthread_self());

pthread_exit(NULL);

}

void specialcountmulthreads(char *path, char *filetowrite, long specialfreq[], int num_threads) {

pthread_t tid;

int i;

int err;

int total_count = 0;

if (argc < 3) {

printf(“Usage: ./a.out num_threads input_file1 input_file2 … input_file30”);

exit(0);

}

num_threads = atoi(argv[1]);

num_files = argc – 2;

//printf(“Num thread: %dn”, num_threads);

//printf(“Num files: %dn”, num_files);

for (i = 2; i < argc; i++) {

filename[i – 2] = argv[i];

//printf(“Argv: %sn”, argv[i]);

//printf(“Filename: %sn”, filename[i – 2]);

}

for (i = 0; i < num_files; i++) {

index_array[i] = malloc(sizeof (int));

*index_array[i] = i;

//printf(“Index array: %dn”, *index_array[i]);

//printf(“Index array: %dn”, index_array[i]);

}

for (i = 0; i < num_threads; i++) {

err = pthread_create(&tid, NULL, thread_function, index_array[i]);

if (err != 0) {

printf(“ncan’t create thread :[%s]”, strerror(err));

}

}

for (i = 0; i < num_files; i++) {

total_count += specialfreq[i];

}

printf(“Total count: %dn”, total_count);

return 0;

}

======================testmulthreads.c=====================================================

#include

#include

#include

#include

#include

#include

#include

#include “count.h”

/*

* Print the frequencies of special words stored in array: specialfreq[] to output screen in the format as:

* letter -> frequency (one letter a line)

* Input: specialfreq – array having the frequency of each special word

size – the total number of special words

* example:

* he -> 250932

* she -> 181764

*/

void displayalphabetfreq(long specialfreq[], int size)

{

for(int i = 0; i < size; i++)

{

switch (i)

{

case 0:

printf(“%s -> %dn”, “he”, specialfreq[i]);

break;

case 1:

printf(“%s -> %dn”, “she”, specialfreq[i]);

break;

case 2:

printf(“%s -> %dn”, “they”, specialfreq[i]);

break;

case 3:

printf(“%s -> %dn”, “him”, specialfreq[i]);

break;

case 4:

printf(“%s -> %dn”, “me”, specialfreq[i]);

break;

defalut:

printf(“%s”, “Wrong number of special words … “);

}

}

}

int main(int argc, char *argv[])

{

printf(“Please enter 2 arguments only eg.”./testmulthreads #_of__threads!!””n””);

server virtualization and cloud computing

 This week, you have read about server virtualization and cloud computing in chapter 6 of your textbook. For your written assignment this week, complete a case study of the organization you work for (use a hypothetical or “other” organization if more applicable) that will address the following prompts:

  • Describe the organization’s environment, and evaluate its preparedness for virtualization.
  • Explain Microsoft (or another product) licensing for virtualized environments.
  • Recommend a configuration for shared storage; make sure to discuss the need for high availability and redundancy for virtualization for the organization.
  • Explain Windows Azure capabilities for virtual machines and managing a hybrid cloud, including Windows Azure’s Internet as a Service (IaaS) and storage capabilities

Make a recommendation for cloud computer use in the organization, including a justification for your recommendations.Submit your midterm research paper as a single document. Your paper should meet the following requirements:

  • Be approximately four to six pages in length (1200-1800 words), not including the required cover page and reference page.
  • Follow APA7 guidelines. Your paper should include an introduction, a body with fully developed content, and a conclusion.
  • Support your answers with the readings from the course and at least two scholarly journal articles to support your positions, claims, and observations, in addition to your textbook. The UC Library is a great place to find resources.
  • Be clearly and well-written, concise, and logical, using excellent grammar and style techniques. You are being graded in part on the quality of your writing.