Due Date:  December 11 23:59 hoursYou need to write 2 separate programs, a client & server. The client makes a connection to the server and transmits a series of numbers. The server listens for client communication and when it has received the series of numbers, it adds them together and closes.Sample code: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html(Two server programs are provided: make sure you start with server2.c, not server.c)Program requirements:The client needs to know the server IP address and port number.  Determine these from the server and make sure if you run the server, followed by the client that they can communicate.  If you run both on the same server, any port above 1024 is valid. If you run the server on C322.WIRSZ.COM and use a port number between 7000-8000, you can use the client on a different UNIX/Linux server or desktop. (no code changes)Fix the sample code so it runs on the server without errors or warnings.Client code: prompt the user for how many numbers to add together, then prompt them for each number. Conversion from string to integer must be done on the client.Server code: Display each integer immediately after it is entered on the client. When the client is finished sending numbers, the server code should add the numbers together, display the total, and then shutdown. (Hint: If you establish a new connection on the server for every number transmitted, the server may need a pipe to communicate numbers from the child processes to the parent process. If you transmit all of the numbers in a single connection, you probably will not need to do this.)Close all sockets on the server and client when finished. Make sure all child processes are closed.1% Extra Credit: instead of Canvas, submit your assignment via https://education.github.com/ (MUST be private, invite swirsz) I will use Github’s last modified date as the submission date. Put your full name in the header of your file.
Due Date:  Sunday night, beginning of week of lab finals 23:59 hoursSleeping Barber Problem (barbers: 1, customers: 10, seats: 3)· Each arriving customer wakes up the sleeping barber· If there are no chairs in the waiting room for the customer, the customer leaves· When the barber finishes, he checks the waiting room and gets the next customer· If no customers are waiting, he goes to sleepThe outline of a program has been provided implementing a number of elements of this program. Your task is to implement customer_run() and barber_run(). This program will be far easier if you write the pseudocode for a solution before working on any code. (Hint: Google!)Program requirements:The program should use pipes in several different ways:seats as a mutex in order to modify the value of freeseatsbarber as a lock to signal that the barber ready to cut? 0=no 1=yescustomer as the semaphore to count how many customers are waiting on seatsfreeseats as a pipe holding the integer value of the number of seats in the waiting roomThe customer_run() will need code for 2 possible cases: when there are chairs in the waiting room and when there are no chairs in the waiting room. (the customer leaves)To use a pipe to store a variable (freeseats), you must initialize it by writing a value to the pipe. To modify it, first read from the pipe which removes the value, change the value, and then write it back to the pipe. Doing all the steps requires exclusive access. (mutex)2% Extra Credit: The barber_run code executes 10 times because at most 10 customers may have their hair cut. In practice, you cannot predict how many of the 10 customers will turn away. Is it possible to know how many exact times the barber will need to run before it will never find another customer? Is it possible to clean up all child processes perfectly and print a Done! statement? Many possible solutions. Test with ps.2% Extra Credit: modify one of the 2 semaphores (barber or customer) to use pthreads instead of the pipe constructs P() & V() that were provided.  Requires shared memory using mmap.1% Extra Credit: instead of Canvas, submit your assignment via https://education.github.com/ (MUST be private, invite swirsz) I will use Github’s last modified date as the submission date. Make sure to put your full name in the header of your file.     (example below)                                                                                                        Last Revised: April 18, 2017bash-4.1$./p4- New customer trying to find a seat- Customer is decreasing the number of free seats to 2- Customer is now waiting for the barber- New customer trying to find a seat- Customer is decreasing the number of free seats to 1- Customer is now waiting for the barber- New customer trying to find a seat- Customer is decreasing the number of free seats to 0- Customer is now waiting for the barber- New customer trying to find a seat* Customer giving up: No free chairs in waiting roomBarber 1 is trying to get a customerBarber 1 is waiting for the seat to become freeBarber 1 is increasing the number of free seats to 1Barber is now cutting hair 1- Customer is now getting a hair cut- New customer trying to find a seat- Customer is decreasing the number of free seats to 0- Customer is now waiting for the barber- New customer trying to find a seat* Customer giving up: No free chairs in waiting room- New customer trying to find a seat* Customer giving up: No free chairs in waiting roomBarber 2 is trying to get a customerBarber 2 is waiting for the seat to become freeBarber 2 is increasing the number of free seats to 1Barber is now cutting hair 2- Customer is now getting a hair cut- New customer trying to find a seat- Customer is decreasing the number of free seats to 0- Customer is now waiting for the barber- New customer trying to find a seat* Customer giving up: No free chairs in waiting room- New customer trying to find a seat* Customer giving up: No free chairs in waiting roomBarber 3 is trying to get a customerBarber 3 is waiting for the seat to become freeBarber 3 is increasing the number of free seats to 1Barber is now cutting hair 3- Customer is now getting a hair cutBarber 4 is trying to get a customerBarber 4 is waiting for the seat to become freeBarber 4 is increasing the number of free seats to 2Barber is now cutting hair 4- Customer is now getting a hair cutBarber 5 is trying to get a customerBarber 5 is waiting for the seat to become freeBarber 5 is increasing the number of free seats to 3Barber is now cutting hair 5- Customer is now getting a hair cutBarber 6 is trying to get a customer
Due Date:  Sunday night, beginning of week of lab finals 23:59 hoursThe project developed in Lab #2 will be extended by this one. Using stat you will need to open each file within a child process and determine the following: the user ID and the group ID and then compare these to the current user. The 3 cases are: if the user is the owner, the user is in the same group as the owner, or if the owner is outside of the user group. After that information is printed, then print the combination of file permissions that apply to this file: read, write, execute.  Sample code: man stat, man 2 stat, man getpwuid, man readdir, man 3 scandir, and fileaccess.c Program requirements:The program should take either filenames or wildcards (*.c for example) as input.Create as many child processes as there are files on the command line.The parent process should wait for all the children to finish and then print “ps -H”For each child process:Print if you have owner, group, or general permissions. Hint: getuid(); & getgid();For the appropriate type, print what type of permissions you have: read, write, executeIf no filename is specified on the command prompt, use dirent to retrieve all files in the current folder.1% Extra Credit: instead of Canvas, submit your assignment via https://education.github.com/ (MUST be private, invite swirsz) I will use Github’s last modified date as the submission date. Make sure to put your full name in the header of your file.  Alternatively create a bitbucket.org account.2% Extra Credit: Use the output from stat to determine the owner of the file, and then use the passwd structure on the owner of the file to determine the home directory of the user that owns that file.3% Extra Credit: See P-and-V.c  Your print output may occasionally be garbled. How would you fix this? (Hint: Semaphores implemented as pipes – see below) Separate program operations and print statements as best as possible. Consider the printf statements as a critical section. Do not use delays or wait inside your main loop, or make child processes wait in any way.  5% Extra Credit (instead of 3%): Use pthreads instead of P-and-V.c(example below)                                                                                                  Last Revised: September 27, 2017$ gcc Lab3.c -o Lab3 && ./Lab3 .. Lab3.c File: ..Directory: /rootYou have general permissions: read execute File: Lab3.cDirectory: /home/users15/sew25545You have owner permissions: read write execute
Due Date:  Sunday night, beginning of week of lab finals 23:59 hours Every UNIX process is guaranteed to have a unique numeric identifier called the process ID. The process ID or PID is always a nonnegative integer. The only way under UNIX (with a few exceptions) to create a new process is when an existing process calls the fork function. You can find details about fork and wait in the manual pages (man fork).The ideal solution is composed of a single parent process which simultaneously opens up multiple child processes which performs their function once and then quits. Code to close up the child processes should be at the end of the program.Also introduced in this lab are command-line options for UNIX programs. By convention, your program should start with the following two variables:int main(int argc, char *argv[])//argc is an integer of the number of arguments//argv “argument vector” is a character array of the argumentsWrite a simple program that uses the fork function. Sample code: man wait & man getpidProgram requirements:The program should take either filenames or wildcards (* for example) as input.Create as many child processes as there are files on the command line. Child processes should run simultaneously, not wait on each other. There are MANY ways that your code may be limited to sequential processing. To test for parallel code, make your child process wait for 1 second. If you have n files and your program is delayed 1 second, your code is parallel. If it is delayed n seconds, it is not parallel. If your code does not run in parallel, you cannot pass this assignmentFor each child process, print the file name and the process ID of the child processThe parent process should wait for all the children to finish then show the output from: system("ps -H");  This statement placed in other locations of your program may be a helpful command to debug your code.1% Extra Credit: instead of Canvas, submit your assignment via https://education.github.com/ (MUST be private, invite swirsz) I will use Github’s last modified date as the submission date. Make sure to put your full name in the header of your file if you submit it by Github.                                                                                            Last Revised: July 17, 2017
Terminal Access:(PC) Download Secure Shell or Putty & connect to c322.wirsz.com | ssh.csun.edu | k200.ecs.csun.edushortcut: "C:\Program Files (x86)\PuTTY\putty.exe name@c322.wirsz.com -pw pass"(MAC) use Terminal $ ssh [canvas id]@c322.wirsz.comDue Date:  September 6, 2017 23:59 hoursI.  Create a shell script (script.sh) to run the following commands:Print the folder name of the current working directoryMake a subdirectoryChange the current working directory to that subdirectoryRedirect text on the command line to a file called data.txt and save itDisplay contents of file ‘data.txt’Make a copy of file 'data.txt' into file 'try.txt'In one single command (no use of & or ;), Show the contents of all files ending in .txtMake a new subdirectoryIn one single command (no use of & or ;), a) move a file to that new subdirectory and b) rename itIn one single command (no use of & or ;) show names of all files, a) list details of the files (not contents),  b) show all hidden files, c) travel through all subdirectories and d) send the output to a file called "hold.txt"Display the contents of the file "hold.txt"II. In the header of the shell script, create a comment line describing in just a sentence or two which unix editor you use and why. (possible editors include: pico/nano, vi, emacs/jed, FTP software with a GUI editor)III. You must make your shell script executable in order to run it from the commandline. Run your script, and redirect output to a file. (output.txt) Note: depending on how you implement step #4, the script may pause  during execution and wait for you to type something in to the command-line to write to data.txt. Do not use Ctrl-C or steps 5-11 will not execute.You must submit two files: script.sh and output.txtFurther help: http://linuxcommand.org                                                                                                                Last Revised: August 25, 2017
Topic Selection Due: (you may revise your topic after this date, but you must choose a topic by this date)    November 17, 2017  2355 hoursPaper Due Date:    December 8, 2017  2355 hoursPresentation PowerPoint/Notes Due Date:    December 1, 2017  2355 hoursIn-Class Presentation Date:    December 1, 2017Requirements:5 minute presentation with submitted PowerPoint or speech notes5 page paper (typed, 1” margins, standard 10-12pt font, double spaced)topic must be something not covered in class and not extensively covered in our textbookEmail me the topic to reserve it, so no one covers the same subject. Duplicate topics receive no credit.Papers: must have a decent introduction, conclusion, bibliography page. References for all non-original statements should be from academic sources:  IEEE, ACMPortal, textbooks, Google scholar. Less than 50% of your materials should come from sources such as Wired, Slashdot, Ars, etc.  Any detected plagiarism earns you an F in the entire course.Presentation: must present it to the class on the date listed above or make arrangements to give your topic on a prior weekSample topics:TOR - how secure web browsing worksQuantum CryptologyBotnetsAn in-depth analysis of a major security event (ie: heartbleed)Evolution of CaptchaSpam MailHistorical uses of CryptologySnowden LeaksAny other topic approved via email                                                                                                         Last Revised: August 25, 2017