From 52b1446f64f3c3d8b06aec359dd30d15e641c8c1 Mon Sep 17 00:00:00 2001 From: Josh Seipel Date: Tue, 21 Feb 2017 19:48:29 -0500 Subject: [PATCH 1/2] Homework Solution --- mystery/crimescene | 6 ++ solution.md | 217 +++++++++++++++++++++++++++++++++------------ 2 files changed, 166 insertions(+), 57 deletions(-) diff --git a/mystery/crimescene b/mystery/crimescene index 32f2010..1887ca2 100644 --- a/mystery/crimescene +++ b/mystery/crimescene @@ -13562,4 +13562,10 @@ with sobs, to sing this:-- Soup of the evening, beautiful Soup! Soup of the evening, beautiful Soup! Beau--ootiful Soo--oop! +grep “CLUE” file + +grep “CLUE” crimescene +grep “ClUE” Crime Scene + +cd ../ diff --git a/solution.md b/solution.md index 59f92db..d88bdca 100644 --- a/solution.md +++ b/solution.md @@ -1,63 +1,166 @@ -```zsh -# Clone the initial repository -git clone git@github.com:eerwitt/command-line-mystery.git -cd command-line-mystery +Joshs-MacBook-Pro:desktop joshseipel1$ cd ga +Joshs-MacBook-Pro:ga joshseipel1$ ls +Homework +Joshs-MacBook-Pro:ga joshseipel1$ cd homework +Joshs-MacBook-Pro:homework joshseipel1$ ls +command-line-mystery +Joshs-MacBook-Pro:homework joshseipel1$ cd command-line-mystery/ +Joshs-MacBook-Pro:command-line-mystery joshseipel1$ ls -a +. .git hint1 hint3 hint5 hint7 instructions readme.md +.. cheatsheet.md hint2 hint4 hint6 hint8 mystery solution.md +Joshs-MacBook-Pro:command-line-mystery joshseipel1$ -# Check the status to see if anything is already marked as new (shouldn't be) -git status +cat hint1 -# Edit my solution file -subl solution.md +Try poking around what's in a file by using the 'head' command: -# Commit initial solution -git add solution.md -git commit -a + head -n 20 people -# Start reading the instructions -less instructions +This will show you the first 20 lines of the 'people' file.Joshs-MacBook-Pro:command-line-mystery joshseipel1$ + + + +Joshs-MacBook-Pro:command-line-mystery joshseipel1$ grep -r "CLUE" * +hint2: + grep "CLUE" crimescene + +instructions:Fortunately the sergeant went through and marked the real clues with the word "CLUE" in all caps. +mystery/crimescene:CLUE: Footage from an ATM security camera is blurry but shows that the perpetrator is a tall male, at least 6'. +mystery/crimescene:CLUE: Found a wallet believed to belong to the killer: no ID, just loose change, and membership cards for AAA, Delta SkyMiles, the local library, and the Museum of Bash History. The cards are totally untraceable and have no name, for some reason. +mystery/crimescene:CLUE: Questioned the barista at the local coffee shop. He said a woman left right before they heard the shots. The name on her latte was Annabel, she had blond spiky hair and a New Zealand accent. +mystery/crimescene:grep “CLUE” file +mystery/crimescene:grep “CLUE” crimescene +Joshs-MacBook-Pro:command-line-mystery joshseipel1$ + +Joshs-MacBook-Pro:mystery joshseipel1$ +grep "Annabel" people + +Annabel Sun F 26 Hart Place, line 40 +Oluwasegun Annabel M 37 Mattapan Street, line 173 +Annabel Church F 38 Buckingham Place, line 179 +Annabel Fuglsang M 40 Haley Street, line 176 +Joshs-MacBook-Pro:mystery joshseipel1$ + +Joshs-MacBook-Pro:memberships joshseipel1$ + +grep "Annabel" * + +AAA:Annabel Church +AAdvantage:Annabel Fuglsang +AAdvantage:Annabel Church +Fitness_Galaxy:Oluwasegun Annabel +Fitness_Galaxy:Annabel Church +Museum_of_Bash_History:Annabel Church +Museum_of_Bash_History:Oluwasegun Annabel +REI:Annabel Church +Rotary_Club:Annabel Sun +Rotary_Club:Annabel Fuglsang +Rotary_Club:Annabel Church + + + +Joshs-MacBook-Pro:mystery joshseipel1$ +head -n 173 streets/Mattapan_Street | tail -n 1 + +SEE INTERVIEW #9437737 + + +License Plate L337DV9 +Make: Honda +Color: Blue +Owner: Joe Germuska +Height: 6'2" +Weight: 164 lbs +-- + +License Plate L3375A9 +Make: Honda +Color: Blue +Owner: Jeremy Bowers +Height: 6'1" +Weight: 204 lbs +-- + +License Plate L337WR9 +Make: Honda +Color: Blue +Owner: Jacqui Maher +Height: 6'2" +Weight: 130 lbs + + +Joshs-MacBook-Pro:command-line-mystery joshseipel1$ +ls + +cheatsheet.md hint2 hint4 hint6 hint8 mystery solution.md + +hint1 hint3 hint5 hint7 instructions readme.md + +Joshs-MacBook-Pro:command-line-mystery joshseipel1$ -# Check for clues in the mystery cd mystery -grep CLUE ./crimescene - -# Search for person with the Latte -grep Annabel ./people - -# Knock on her door -less streets/Mattapan_Street -# Goto line in file using less: http://stackoverflow.com/questions/8586648/going-to-a-specific-line-number-using-less-in-unix -# in less type 173g -# Try different interviews -less interviews/interview-47246024 - -less interviews/interview-699607 - -# Checking for vehicle -less vehicles -# Search in less for vehicles starting with L337 and ending in 9 -# in less /L337..9 -# Check which are over 6' -# Katie Park -# Mike Bostock -# John Keefe -# Erika Owens -# Matt Waite -# Brian Boyer -# Al Shaw -# Miranda Mulligan -# Joe Germuska -# Jeremy Bowers -# Jacqui Maher - -# Check which is male/female and get their names -egrep '((Katie Park)|(Mike Bostock)|(John Keefe)|(Erika Owens)|(Matt Waite)|(Brian Boyer)|(Al Shaw)|(Miranda Mulligan)|(Joe Germuska)|(Jeremy Bowers)|(Jacqui Maher))' ./people | grep '\tM\t' | cut -f1 - -# Limit down by membership -egrep -R '((Joe Germuska)|(Brian Boyer)|(Mike Bostock)|(Jeremy Bowers)|(John Keefe)|(Al Shaw)|(Matt Waite))' ./memberships - -# (Jeremy Bowers)|(Brian Boyer)|(Mike Bostock)|(Matt Waite) -# Not MB, wrong car color -# Not MW, wrong car manufacturer -# Not BB, wrong car manufacturer -# JB, it is JB -``` + +Joshs-MacBook-Pro:mystery joshseipel1$ + +ls + +crimescene interviews memberships people streets vehicles + + + +Joshs-MacBook-Pro:mystery joshseipel1$ +grep -rl "Joe Germuska" memberships + +memberships/AAA +memberships/Terminal_City_Library + +/// Ruled out as a suspect, memberships are not conducive. + +Joshs-MacBook-Pro:mystery joshseipel1$ +grep -rl "Jeremy Bowers" memberships + +memberships/AAA +memberships/Delta_SkyMiles +memberships/Museum_of_Bash_History +memberships/Terminal_City_Library + +Joshs-MacBook-Pro:mystery joshseipel1$ +grep -rl "Jacqui Maher" memberships + +memberships/AAA +memberships/Delta_SkyMiles +memberships/Museum_of_Bash_History +memberships/Terminal_City_Library + +Joshs-MacBook-Pro:mystery joshseipel1$ +grep -r "Maher" * + +interviews/interview-904020:Maher is not considered a suspect. +Video evidence confirms that she was away at a professional soccer game +on the morning in question, even though it was a workday. + +memberships/AAA:Jacqui Maher +memberships/Delta_SkyMiles:Jacqui Maher +memberships/Museum_of_Bash_History:Maher Vos +memberships/Museum_of_Bash_History:Jacqui Maher +memberships/TCSU_Alumni_Association:Maher Vos +memberships/Terminal_City_Library:Jacqui Maher + +people:Maher Vos M 55 Waltham Street, line 340 +people:Jacqui Maher F 40 Andover Road, line 224 +vehicles:Owner: Maher Vos +vehicles:Owner: Jacqui Maher + + +Joshs-MacBook-Pro:mystery joshseipel1$ + grep -r "Bowers" * + +memberships/AAA:Jeremy Bowers +memberships/Delta_SkyMiles:Jeremy Bowers +memberships/Museum_of_Bash_History:Jeremy Bowers +memberships/Terminal_City_Library:Jeremy Bowers +people:Jeremy Bowers M 34 Dunstable Road, line 284 +vehicles:Owner: Jeremy Bowers + +/// All memberships point to Jeremy Bowers as the suspect. /// +Solution = "Jeremy Bowers" From df57c1d80535a2eeb3a05137e2c9404a2320d0b8 Mon Sep 17 00:00:00 2001 From: Josh Seipel Date: Sun, 26 Feb 2017 15:52:53 -0500 Subject: [PATCH 2/2] Uploading solution for CLI homework. --- solution.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solution.md b/solution.md index d88bdca..0d60968 100644 --- a/solution.md +++ b/solution.md @@ -164,3 +164,5 @@ vehicles:Owner: Jeremy Bowers /// All memberships point to Jeremy Bowers as the suspect. /// Solution = "Jeremy Bowers" + +