From e976b55a5c2a83f4f2ab1221ea228c9b8737db4f Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:32:09 -0500 Subject: [PATCH 01/13] 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/13] 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 37ff3d3d080ac06e894319d1c8164314d7d4ebc7 Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sat, 2 Aug 2025 11:29:11 -0400 Subject: [PATCH 03/13] updates --- 02_activities/assignments/assignment.sh | 42 +++++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 8af8dc092..57c2bce88 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -9,12 +9,6 @@ set -x # project name and a brief description of the project. # Then it unzips the raw data provided by the client. -if [ -d newproject ]; then - echo "Directory 'newproject' already exists. Please remove it before running this script." - exit 1 -fi -mkdir newproject -cd newproject mkdir analysis output touch README.md @@ -28,22 +22,50 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data +mkdir data # 2. Move the ./rawdata directory to ./data/raw +#Suppose we are in the current directory in which we create +#rawdata and data/raw directories then the solution is as follows + +mkdir -p data/raw +mkdir rawdata +mv rawdata data/raw + + # 3. List the contents of the ./data/raw directory +#Suppose we are in the current directory in which we create +# data/raw directories then the solution is as follows +ls data/raw + # 4. In ./data/processed, create the following directories: server_logs, user_logs, and 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 +mkdir -p data/processed +cd data/processed +mkdir server_logs user_logs event_logs -# 6. Repeat the above step for user logs and event logs +#or +mkdir -p data/processed/server_logs data/processed/ser_logs data/processed/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/*server*.log data/processed/user_logs +cp data/raw/*server*.log data/processed/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 += +rm data/raw/*ipaddr* +rm 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 data +touch inventory.txt +ls processed/*/* > inventory.txt ########################################### -echo "Project setup is complete!" +echo "Project setup is complete!" \ No newline at end of file From 37e5f1b587556d8a1d11f66a25965da32fe6d6f7 Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sat, 2 Aug 2025 11:36:59 -0400 Subject: [PATCH 04/13] updates --- 02_activities/assignments/assignment.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 57c2bce88..90f6dbe7e 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -1,6 +1,6 @@ #!/bin/bash set -x - +#vdfvfdfdfbdfb ############################################ # DSI CONSULTING INC. Project setup script # ############################################ @@ -68,4 +68,6 @@ ls processed/*/* > inventory.txt ########################################### -echo "Project setup is complete!" \ No newline at end of file +echo "Project setup is complete!" + +#vfvjdfvjdvjdf \ No newline at end of file From a820162b06505709e765e6ab1953daeebd2f51fd Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sat, 2 Aug 2025 23:52:01 -0400 Subject: [PATCH 05/13] the latest modification --- 02_activities/assignments/assignment.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 90f6dbe7e..554f016d7 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -22,7 +22,7 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data -mkdir data +mkdir -p data # 2. Move the ./rawdata directory to ./data/raw @@ -42,11 +42,8 @@ ls data/raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs -mkdir -p data/processed -cd data/processed -mkdir server_logs user_logs event_logs -#or + mkdir -p data/processed/server_logs data/processed/ser_logs data/processed/event_logs From 143ebc2317068f1d4818dbee6f0f9b56d71f9945 Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sat, 2 Aug 2025 23:58:29 -0400 Subject: [PATCH 06/13] the latest modifiction --- 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 554f016d7..52dd191f0 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -22,7 +22,7 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data -mkdir -p data +mkdir data # 2. Move the ./rawdata directory to ./data/raw From 7f0744c0af897b9ebf865586764d0a627933e388 Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sun, 3 Aug 2025 00:02:18 -0400 Subject: [PATCH 07/13] latest modification --- 02_activities/assignments/assignment.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 52dd191f0..8e1b80977 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -29,8 +29,6 @@ mkdir data #Suppose we are in the current directory in which we create #rawdata and data/raw directories then the solution is as follows -mkdir -p data/raw -mkdir rawdata mv rawdata data/raw From 9a13c064162702ea24b0f0290977f1f5ebea7c23 Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sun, 3 Aug 2025 00:05:51 -0400 Subject: [PATCH 08/13] change --- 02_activities/assignments/assignment.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 8e1b80977..7a857c796 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -29,40 +29,34 @@ mkdir data #Suppose we are in the current directory in which we create #rawdata and data/raw directories then the solution is as follows -mv rawdata data/raw + # 3. List the contents of the ./data/raw directory #Suppose we are in the current directory in which we create # data/raw directories then the solution is as follows -ls data/raw + # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs -mkdir -p data/processed/server_logs data/processed/ser_logs data/processed/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/*server*.log data/processed/user_logs -cp data/raw/*server*.log data/processed/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 -= -rm data/raw/*ipaddr* -rm 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 data -touch inventory.txt -ls processed/*/* > inventory.txt + ########################################### echo "Project setup is complete!" -#vfvjdfvjdvjdf \ No newline at end of file From 8f206aa633cd79fd7803d85a39e89d3ffa0c658d Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sun, 3 Aug 2025 00:11:52 -0400 Subject: [PATCH 09/13] change --- 02_activities/assignments/assignment.sh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 7a857c796..51eb21944 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -22,37 +22,20 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data -mkdir data +mkdir -p data # 2. Move the ./rawdata directory to ./data/raw -#Suppose we are in the current directory in which we create -#rawdata and data/raw directories then the solution is as follows - - - - # 3. List the contents of the ./data/raw directory -#Suppose we are in the current directory in which we create -# data/raw directories then the solution is as follows - - # 4. In ./data/processed, create the following directories: server_logs, user_logs, and 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 # 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 - # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed From 3636d230313547a8d0d990beb3d45900bf6ee6a7 Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sun, 3 Aug 2025 00:20:20 -0400 Subject: [PATCH 10/13] change --- 02_activities/assignments/assignment.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 51eb21944..cf0f1c9d1 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -22,22 +22,24 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data -mkdir -p data +mkdir data # 2. Move the ./rawdata directory to ./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 data/processed/user_logs data/processed/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/*user*.log data/processed/user_logs +cp data/raw/*event*.log data/processed/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 - +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 - +ls processed/*/* > inventory.txt ########################################### From f8ef5d0c9cc9335742a41315080469dcf8399903 Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sun, 3 Aug 2025 10:50:02 -0400 Subject: [PATCH 11/13] cjange --- 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 8af8f3315..0991eaba0 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -23,7 +23,7 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data -mkdir data +mkdir data # 2. Move the ./rawdata directory to ./data/raw mv rawdata data/raw From f24faa60027d39605c9f28513f9df5ce2cb9356b Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sun, 3 Aug 2025 11:15:41 -0400 Subject: [PATCH 12/13] change --- 02_activities/assignments/assignment.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 0991eaba0..469f979b0 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -1,6 +1,6 @@ #!/bin/bash set -x -#vdfvfdfdfbdfb + ############################################ # DSI CONSULTING INC. Project setup script # ############################################ @@ -9,7 +9,13 @@ set -x # project name and a brief description of the project. # Then it unzips the raw data provided by the client. +if [ -d newproject ]; then + echo "Directory 'newproject' already exists. Please remove it before running this script." + exit 1 +fi +mkdir newproject +cd newproject mkdir analysis output touch README.md echo "# Project Name: DSI Consulting Inc." > README.md From db5008c8dbc06700e112222c1fc4e1bde001d8fa Mon Sep 17 00:00:00 2001 From: rahele mosleh Date: Sun, 3 Aug 2025 11:27:55 -0400 Subject: [PATCH 13/13] change --- 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 469f979b0..85a8d23f1 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -53,7 +53,7 @@ rm data/raw/*ipaddr* rm data/processed/user_logs/*ipaddr* # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed -ls processed/*/* > inventory.txt +ls data/processed/*/* > data/inventory.txt ###########################################