From e976b55a5c2a83f4f2ab1221ea228c9b8737db4f Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:32:09 -0500 Subject: [PATCH 01/11] delete ip logs... WARNING UNTESTED! --- 02_activities/assignments/assignment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index d81e9a77b..001291867 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -33,6 +33,7 @@ unzip rawdata.zip # 6. Repeat the above step for user logs and event logs # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs +rf -rf ./data # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed From ea20676d33161a6f4d0fcd3c4f7aa5360f0f4309 Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:55:44 -0500 Subject: [PATCH 02/11] initialize README file with company name --- 02_activities/assignments/assignment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 001291867..f2bfd22bd 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -11,6 +11,7 @@ set -x mkdir analysis output touch README.md +echo "# Project Name: DSI Consulting Inc." > README.md touch analysis/main.py # download client data From 7c80b10940ce3827c7b6ed1e3ce87152efb21aa0 Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Wed, 19 Nov 2025 04:31:22 +0100 Subject: [PATCH 03/11] Chudes Assignment --- 02_activities/assignments/assignment.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 4b2baa7ae..a98cbe472 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -28,21 +28,39 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data +mkdir data # 2. Move the ./rawdata directory to ./data/raw +mkdir data/raw +mv rawdata/* data/raw/ + + # 3. List the contents of the ./data/raw directory +ls data/raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs +mkdir -p data/processed/{server_logs,user_logs,event_logs} + # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs +cp data/raw/server*.log data/processed/server_logs/ + # 6. Repeat the above step for user logs and event logs + +cp data/raw/event*.log data/processed/event_logs/ +cp data/raw/user*.log data/processed/user_logs/ + # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs +rm -f data/raw/*ipaddr* +rm -f data/processed/user_logs/*ipaddr* + # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed +find data/processed -type f > data/inventory.txt ########################################### From 07caeed3596f827c39f859ccfb68e26f8ce979c2 Mon Sep 17 00:00:00 2001 From: Anthony chude Date: Wed, 19 Nov 2025 04:36:34 +0100 Subject: [PATCH 04/11] Add files via upload assignment --- assignment.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 assignment.sh diff --git a/assignment.sh b/assignment.sh new file mode 100644 index 000000000..bf03e5eb1 --- /dev/null +++ b/assignment.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -x + +############################################ +# DSI CONSULTING INC. Project setup script # +############################################ +# This script creates standard analysis and output directories +# for a new project. It also creates a README file with the +# project name and a brief description of the project. +# Then it unzips the raw data provided by the client. + +if [ -d newproject ]; then + echo "Recreating the newproject directory" + rm -rf newproject +fi +mkdir newproject +cd newproject + +mkdir analysis output +touch README.md +touch analysis/main.py + +# download client data +curl -Lo rawdata.zip https://github.com/UofT-DSI/shell/raw/refs/heads/main/02_activities/assignments/rawdata.zip +unzip -q rawdata.zip + +########################################### +# Complete assignment here + +# 1. Create a directory named data +mkdir data + +# 2. Move the ./rawdata directory to ./data/raw + +mkdir data/raw +mv rawdata/* data/raw/ + + +# 3. List the contents of the ./data/raw directory +ls data/raw + +# 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs + +mkdir -p data/processed/{server_logs,user_logs,event_logs} + +# 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs + +cp data/raw/server*.log data/processed/server_logs/ + +# 6. Repeat the above step for user logs and event logs + + +cp data/raw/event*.log data/processed/event_logs/ +cp data/raw/user*.log data/processed/user_logs/ + +# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs + +rm -f data/raw/*ipaddr* +rm -f data/processed/user_logs/*ipaddr* + +# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed + +find data/processed -type f > data/inventory.txt + +########################################### + +echo "Project setup is complete!" From 1cbce65923868978434695a0bc8d2a4501103d5f Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Wed, 19 Nov 2025 18:12:42 +0100 Subject: [PATCH 05/11] Chudes Assignment --- 02_activities/assignments/assignment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index a98cbe472..2d2365f89 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -64,4 +64,4 @@ find data/processed -type f > data/inventory.txt ########################################### -echo "Project setup is complete!" +echo "Project setup is complete done by Anthony Chude!" From 1689dfee4cdbe9cc4735e7b31c3ec1cbcacc9cab Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Thu, 20 Nov 2025 02:08:13 +0100 Subject: [PATCH 06/11] updated my assignment --- 02_activities/assignments/assignment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 2d2365f89..6acd25ca7 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -64,4 +64,4 @@ find data/processed -type f > data/inventory.txt ########################################### -echo "Project setup is complete done by Anthony Chude!" +echo "Project setup is complete done by Anthony Chudee!" From bc860734b6ae573267bc96034b37173204dcc873 Mon Sep 17 00:00:00 2001 From: Anthony chude Date: Thu, 20 Nov 2025 02:23:52 +0100 Subject: [PATCH 07/11] Update assignment.sh --- 02_activities/assignments/assignment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 6acd25ca7..e9fa7e941 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -32,7 +32,7 @@ mkdir data # 2. Move the ./rawdata directory to ./data/raw -mkdir data/raw +#mkdir data/raw mv rawdata/* data/raw/ From 24d3af1eb79ae88975aeeafff4bd1a37fa8fa3b2 Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Thu, 20 Nov 2025 02:29:53 +0100 Subject: [PATCH 08/11] anthony assignment --- 02_activities/assignments/assignment.sh | 96 +++++++++++++++++++------ 1 file changed, 74 insertions(+), 22 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 6acd25ca7..563d0508d 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -1,14 +1,3 @@ -#!/bin/bash -set -x - -############################################ -# DSI CONSULTING INC. Project setup script # -############################################ -# This script creates standard analysis and output directories -# for a new project. It also creates a README file with the -# project name and a brief description of the project. -# Then it unzips the raw data provided by the client. - if [ -d newproject ]; then echo "Recreating the newproject directory" rm -rf newproject @@ -32,36 +21,99 @@ mkdir data # 2. Move the ./rawdata directory to ./data/raw -mkdir data/raw -mv rawdata/* data/raw/ +cd data +mkdir raw +mv /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/rawdata/*.* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/ # 3. List the contents of the ./data/raw directory -ls data/raw +ls # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs -mkdir -p data/processed/{server_logs,user_logs,event_logs} +cd /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data +mkdir processed +cd processed +mkdir server_logs user_logs event_logs # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs -cp data/raw/server*.log data/processed/server_logs/ - +cp -r /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/server* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/server_logs/ # 6. Repeat the above step for user logs and event logs +cp -r /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/event* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/event_logs/ + +cp -r /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/user* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/user_logs/ -cp data/raw/event*.log data/processed/event_logs/ -cp data/raw/user*.log data/processed/user_logs/ # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs -rm -f data/raw/*ipaddr* -rm -f data/processed/user_logs/*ipaddr* +rm -f /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/*ipaddr* +rm -f /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/user_logs/*ipaddr* + # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed +cd /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data +touch inventory.txt +ls /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed > /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/inventory.txt + +########################################### + +echo "Project setup is complete!" + + +===================================================== + + +if [ -d newproject ]; then + echo "Recreating the newproject directory" + rm -rf newproject +fi + +mkdir newproject +cd newproject + +mkdir analysis output +touch README.md +touch analysis/main.py + +# download client data +curl -Lo rawdata.zip https://github.com/UofT-DSI/shell/raw/refs/heads/main/02_activities/assignments/rawdata.zip +unzip -q rawdata.zip + +########################################### +# Assignment starts here + +# 1. Create a directory named data +mkdir data + +# 2. Move rawdata into data/raw +##mkdir data/raw +mv rawdata/* data/raw/ + +# 3. List the contents of data/raw +ls data/raw + +# 4. Create processed subfolders +mkdir -p data/processed/{server_logs,user_logs,event_logs} + +# 5. Copy server logs (.log files with "server") +cp data/raw/server*.log data/processed/server_logs/ + +# 6. Copy event logs and user logs +cp data/raw/event*.log data/processed/event_logs/ +cp data/raw/user*.log data/processed/user_logs/ + +# 7. Remove privacy files (containing "ipaddr") +rm -f data/raw/*ipaddr* +rm -f data/processed/user_logs/*ipaddr* + +# 8. Create inventory.txt listing ALL files in processed subfolders find data/processed -type f > data/inventory.txt ########################################### -echo "Project setup is complete done by Anthony Chudee!" +echo "Project setup is complete!" + + From f1b7be7658a0644b708f1734194ba39267aca22c Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Thu, 20 Nov 2025 02:50:51 +0100 Subject: [PATCH 09/11] anthony assignment --- 02_activities/assignments/assignment.sh | 96 ++++++------------------- 1 file changed, 22 insertions(+), 74 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 563d0508d..1aabc79d1 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -1,3 +1,14 @@ +#!/bin/bash +set -x + +############################################ +# DSI CONSULTING INC. Project setup script # +############################################ +# This script creates standard analysis and output directories +# for a new project. It also creates a README file with the +# project name and a brief description of the project. +# Then it unzips the raw data provided by the client. + if [ -d newproject ]; then echo "Recreating the newproject directory" rm -rf newproject @@ -21,99 +32,36 @@ mkdir data # 2. Move the ./rawdata directory to ./data/raw -cd data -mkdir raw +#mkdir data/raw +mv rawdata/* data/raw/ -mv /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/rawdata/*.* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/ # 3. List the contents of the ./data/raw directory -ls +ls data/raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs -cd /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data -mkdir processed -cd processed -mkdir server_logs user_logs event_logs +mkdir -p data/processed/{server_logs,user_logs,event_logs} # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs -cp -r /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/server* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/server_logs/ -# 6. Repeat the above step for user logs and event logs - -cp -r /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/event* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/event_logs/ - -cp -r /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/user* /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/user_logs/ - - -# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs - -rm -f /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/raw/*ipaddr* -rm -f /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed/user_logs/*ipaddr* - - -# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed - -cd /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data -touch inventory.txt -ls /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/processed > /c/users/Admin/DSI3/shell/02_activities/assignments/newproject/data/inventory.txt - -########################################### - -echo "Project setup is complete!" - - -===================================================== - - -if [ -d newproject ]; then - echo "Recreating the newproject directory" - rm -rf newproject -fi - -mkdir newproject -cd newproject - -mkdir analysis output -touch README.md -touch analysis/main.py - -# download client data -curl -Lo rawdata.zip https://github.com/UofT-DSI/shell/raw/refs/heads/main/02_activities/assignments/rawdata.zip -unzip -q rawdata.zip - -########################################### -# Assignment starts here - -# 1. Create a directory named data -mkdir data - -# 2. Move rawdata into data/raw -##mkdir data/raw -mv rawdata/* data/raw/ - -# 3. List the contents of data/raw -ls data/raw +cp data/raw/server*.log data/processed/server_logs/ -# 4. Create processed subfolders -mkdir -p data/processed/{server_logs,user_logs,event_logs} +# 6. Repeat the above step for user logs and event logs -# 5. Copy server logs (.log files with "server") -cp data/raw/server*.log data/processed/server_logs/ -# 6. Copy event logs and user logs cp data/raw/event*.log data/processed/event_logs/ cp data/raw/user*.log data/processed/user_logs/ -# 7. Remove privacy files (containing "ipaddr") +# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs + rm -f data/raw/*ipaddr* rm -f data/processed/user_logs/*ipaddr* -# 8. Create inventory.txt listing ALL files in processed subfolders +# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed + find data/processed -type f > data/inventory.txt ########################################### -echo "Project setup is complete!" - - +echo "Project setup is complete done by Anthony Chudee!" \ No newline at end of file From dc446384ec5523b990b3d20721247b6f3b6c4130 Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Thu, 20 Nov 2025 02:54:13 +0100 Subject: [PATCH 10/11] Merge branch 'coworker-changes' of https://github.com/UofT-DSI/shell into assignment --- 02_activities/assignments/assignment.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 6178e3c94..4dcaf6ddb 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -1,4 +1,3 @@ -#!/bin/bash set -x ############################################ From a5d9f31beab3ed2969be460f7520802cc0da1e79 Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Thu, 20 Nov 2025 03:00:03 +0100 Subject: [PATCH 11/11] assignment for chude --- 02_activities/assignments/assignment.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 4dcaf6ddb..903b7109a 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -32,7 +32,7 @@ mkdir data # 2. Move the ./rawdata directory to ./data/raw -#mkdir data/raw + mv rawdata/* data/raw/ @@ -45,13 +45,13 @@ mkdir -p data/processed/{server_logs,user_logs,event_logs} # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs -cp data/raw/server*.log data/processed/server_logs/ +cp data/raw/*server*.log data/processed/server_logs/ # 6. Repeat the above step for user logs and event logs -cp data/raw/event*.log data/processed/event_logs/ -cp data/raw/user*.log data/processed/user_logs/ +cp data/raw/*event*.log data/processed/event_logs/ +cp data/raw/*user*.log data/processed/user_logs/ # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs rf -rf ./data