Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
89b7b94
Added the American choise answer
dorondollev Mar 16, 2022
49b7805
provided hand shake script over TLS
dorondollev Mar 22, 2022
5051c3b
Merge remote-tracking branch 'origin/main'
dorondollev Mar 27, 2022
8059b3a
Just checking everything is alright
ArielKaras Mar 29, 2022
eeabafa
Merge remote-tracking branch 'origin/main'
dorondollev Mar 30, 2022
9fd8e36
Merge remote-tracking branch 'origin/main'
dorondollev Apr 3, 2022
d671108
python katas
alonitac Mar 29, 2022
33072b9
python katas
alonitac Mar 29, 2022
8fcebcb
python katas
alonitac Mar 29, 2022
236e574
python katas
alonitac Mar 29, 2022
806fcd6
python katas
alonitac Mar 29, 2022
427cffe
python katas
alonitac Mar 29, 2022
a6eaba1
python katas
alonitac Mar 29, 2022
3414d3a
python katas
alonitac Mar 29, 2022
8c54ee4
python katas
alonitac Mar 29, 2022
93dfd0c
update req
alonitac Mar 30, 2022
4d5ad24
python katas
alonitac Mar 30, 2022
caba58b
python katas
alonitac Apr 1, 2022
18c9dc3
added sum for elements
dorondollev Apr 5, 2022
9f67be3
added verbing
dorondollev Apr 5, 2022
5fa00df
added words_concatenation
dorondollev Apr 5, 2022
3e92edf
added reverse_words_concatenation
dorondollev Apr 5, 2022
8a869c3
fixed verbing
dorondollev Apr 5, 2022
fc88019
Merge remote-tracking branch 'origin/main'
dorondollev Apr 6, 2022
df0c5e2
Merge branch 'main' into katas1_tests
dorondollev Apr 6, 2022
2cbd23c
created prime_number
dorondollev Apr 7, 2022
cfa098b
finished my tests: 3, 10
dorondollev Apr 7, 2022
868b908
finished my tests: 4, 11
dorondollev Apr 8, 2022
d81fd55
Merge branch 'katas1_tests' of https://github.com/alonitac/DevOpsJan2…
DustyMadDude Apr 10, 2022
9db5b54
Merge branch 'katas1_tests' of https://github.com/alonitac/DevOpsJan2…
DustyMadDude Apr 10, 2022
cd9368f
Merge branch 'python_katas_YuvalFidler' into katas1_Yftest
DustyMadDude Apr 10, 2022
b819000
Merge remote-tracking branch 'origin/python_katas1_tests' into katas1…
Apr 10, 2022
6ca2962
Merge branch 'katas1_Yftest' into katas1_tests
DustyMadDude Apr 10, 2022
ffac302
Update test.py
dorondollev Apr 10, 2022
315b745
finished my tests: 4, 11
dorondollev Apr 11, 2022
91066c5
Merge remote-tracking branch 'origin/katas1_tests' into katas1_tests
dorondollev Apr 11, 2022
43d15d2
finished test: 4
dorondollev Apr 11, 2022
8fb48d3
finished test: 11
dorondollev Apr 11, 2022
ae1f115
Merge branch 'main' of https://github.com/alonitac/DevOpsJan22
ArielKaras Apr 13, 2022
e0ddddb
Merge remote-tracking branch 'origin/katas1_tests' into ariel_katas1_…
ArielKaras Apr 13, 2022
24c7e6d
Please check
ArielKaras Apr 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion 06_linux_ex2/README
Original file line number Diff line number Diff line change
@@ -1,2 +1,58 @@
name@example.com
doron.dollev@gmail.com

### Processes handling

**(Q1)** A user started a process and logged out from the terminal. Which command he used if the process still running in the background:

* nohup


**(Q2)** The `kill` command always terminates a process.

* False


**(Q3)** Which command could be used to know how many processes are running in the background terminal session?

* jobs


**(Q4)** Given a terminal session with long process running in it, how will you ask this process to terminate?

* CTRL+c


**(Q5)** Given a terminal session with long process running in it, how will you ask this process the stop?

* CTRL+z


**(Q6)** How would you run the `sleep 10` command as a foreground process?

* sleep 10


**(Q7)** Which of the following command would deliver a SIGTERM to the `xscreensaver` process?

* None of the above


**(Q8)** Which of the following would deliver a SIGKILL to the `xscreensaver` command?

* kill -9 4846


**(Q9)** Which of the following would send a SIGCHLD (signal number 17) to the `ssh-agent` process?

* kill -CHLD 4828


**(Q10)** Which key pressed within the `top` command allows the user to send a signal to a process?

* k


**(Q11 - easy 5 points bonus)** Open a new terminal session and type the command `python`. Then send a SIGINT signal using your keyboard. What best describes
how the python process responds to the SIGINT signal?

* The program has implemented a custom signal handler for the SIGINT signal.
46 changes: 46 additions & 0 deletions 06_linux_ex2/tlsHandshake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
echo "Initializing random number generator..."
openssl rand -out masterKey.txt -base64 32
if [ $? -gt 0 ]
then
echo "couldn't generate key 32 based"
exit 1
fi
curl -X POST -H "Content-Type: application/json" -d '{"clientVersion":"3.2","message":"Client Hello"}' http://devops-jan22-1273001359.eu-north-1.elb.amazonaws.com:8080/clienthello | jq -r '.serverCert,.sessionID' >tmp.txt
STATUS=$?
if [ $STATUS -gt 0 ]
then
echo "run \"man curl|jq\" end check for details for error status number $STATUS"
# for example: "error 20 at 0 depth lookup: unable to get local issuer certificate"
# This is Eve that is the reason error 20 is unlisted in curl
exit 1
fi
# Instead could be used /clienthello -o (>) tmp.txt and use twice jq -r on cert.pem and sessionID
head --lines=-1 tmp.txt>cert.pem
export SESSION_ID=$( tail -1 tmp.txt )
rm -f tmp.txt
export VERIFICATION_RESULT=$( openssl verify -CAfile cert-ca-aws.pem cert.pem )

if [ "$VERIFICATION_RESULT" != "cert.pem: OK" ]
then
echo "Server Certificate is invalid."
exit 1
fi

MASTER_KEY=$( openssl smime -encrypt -aes-256-cbc -in masterKey.txt -outform DER cert.pem | base64 -w 0 )
curl -X POST -H 'Content-Type: application/json' -d '{"sessionID": "'$SESSION_ID'","masterKey": "'$MASTER_KEY'","sampleMessage": "Hi server, please encrypt me and send to client!"}' http://devops-jan22-1273001359.eu-north-1.elb.amazonaws.com:8080/keyexchange | jq -r '.encryptedSampleMessage' > encSampleMsg.txt
STATUS=$?
if [ $STATUS -gt 0 ]
then
echo "run \"man curl|jq\" end check for details for error status number $STATUS"
exit 1
fi
cat encSampleMsg.txt | base64 -d > encSampleMsgReady.txt
openssl enc -d -aes-256-cbc -pbkdf2 -kfile masterKey.txt -in encSampleMsgReady.txt -out decrypted_secret.txt
export DECRYPTED_SAMPLE_MESSAGE=`cat decrypted_secret.txt`
if [ "$DECRYPTED_SAMPLE_MESSAGE" != "Hi server, please encrypt me and send to client!" ]; then
echo "Server symmetric encryption using the exchanged master-key has failed."
exit 1
else
echo "Client-Server TLS handshake has been completed successfully"
fi
70 changes: 70 additions & 0 deletions docs/git_ex1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Git ex-1
Due date: 31/04/2022 23:59


## Preliminaries

1. Open [our shared git repo](https://github.com/alonitac/DevOpsJan22) in PyCharm and pull the repository in branch **main** to get an up-to-date version
2. Checkout branch `origin/git_ex1`
3. Under `07_git_exercises` create a directory called `<alias>_ex1` while `<alias>` should be replaced by your name
4. In `<alias>_ex1` create a file called `README`.

## Questions

All your answers, including commands and free text should be written in `README`.
This file will be checked manually (won't be executed) so no worries about combining code and text.

### Git Basics (commit, diff, branches)

1. Create GitHub repo in your account, clone it locally via PyCharm (Git -> Clone...)
2. Run `basics.sh`
3. In branch `main`, create a file called `abc.txt` containing the text `abc` in it.
4. Add the file to the index and commit the changes (it's recommended to use `git status` in between steps)
5. Print the content of `abc.txt` to stdout
6. Append the line `2` to the end of `abc.txt` to change the state of this file in the working tree
7. (README) What is the command to show changes between the working tree to branch `main`?
8. Why does `git diff --staged` print nothing?
9. Why does `git diff master` print error?
10. Add `abc.txt` to the index
11. What does `git diff` print? why?
12. What is the command to show changes between the index and branch `main`
13. Append the line `3` to the end of `abc.txt` to change the state of this file in the working tree
14. Would `git diff --staged` and `git diff main` commands print the same output? why?
15. Why does `abc.txt` appear twice in the output of `git status`?
16. Unstage the changes in your index and working tree (don't commit the changes)
17. Which branches exists in this repo? print them
18. Create a new branch called `mybranch` and switch to this branch
19. Merge branch `feature/version1` in `mybranch`, observe the merged changes
20. Using PyCharm UI (!!) - merge branch `feature/version2` in `mybranch`, resolve the conflict the same way we did in class
21. Are there any added commits for `mybranch`? what are those commits?
22. Create a new file called `take.txt`, don't add or commit it
23. Checkout to `main`
24. What happened to `take.txt` you've just created in `mybranch`? why?

### Reset

25. Run `reset.sh`
26. Run the following commands line by line, after each command, observe what happened to your working tree and explain why
1. `git reset --soft HEAD~1`
2. `git reset --mixed HEAD~1`
3. `git reset --hard HEAD~1`
4. `git revert HEAD~1`
27. Explain the notation `HEAD~1` in git reset command


### Cherry picking

`git cherry-pick` is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD

28. Run `cherry.sh`
29. In Pycharm Git tab (bottom left), navigate to tab Log
30. (TBD from main exercise)


### Protected branches in GitHub

TBD from main exercise

# Good Luck

Don't hesitate to ask any questions
23 changes: 23 additions & 0 deletions docs/git_ex2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Git ex-1
Due date: 31/05/2022 23:59


## Preliminaries

1. Open [our shared git repo](https://github.com/alonitac/DevOpsJan22) in PyCharm and pull the repository in branch **main** to get an up-to-date version
2. Checkout branch `git_ex2_<alias>`
3. Under `07_git_exercises` create a directory called `<alias>_ex2` while `<alias>` should be replaced by your name
4. In `<alias>_ex1` create a file called `README`.

## Questions

### Amend Commits

### Reorder the history

### Rebase squash


# Good Luck

Don't hesitate to ask any questions
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ nav:
- Home: 'index.md'
- Linux Ex1: 'linux_ex1.md'
- Linux Ex2: 'linux_ex2.md'
- Git Ex1: 'git_ex1.md'
theme:
name: readthedocs
Loading