Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
e297cb4
Shlomi Gedasi git ex1 basics.
shlomigd May 7, 2022
f1445b8
Shlomi Gedasi git ex1 basics.
shlomigd May 7, 2022
6bd6a15
Shlomi Gedasi git ex1 Cherry picking.
shlomigd May 7, 2022
4f0e950
python additional
alonitac May 8, 2022
d18a24d
static methods and singleton pattern
alonitac May 8, 2022
5cea975
adding README file in my new branch git_ex1/dima
dshtranv May 11, 2022
21eed12
rename dir
alonitac May 11, 2022
4e8df36
implement retry logic
alonitac May 11, 2022
cb12ae6
fix
alonitac May 11, 2022
8397a0d
Shlomi Gedasi git ex1 add commnds.
shlomigd May 14, 2022
bcd7d26
Shlomi Gedasi git ex1 done.
shlomigd May 14, 2022
b26cade
ignore .pem
alonitac May 15, 2022
af16b8b
python katas 3
alonitac May 17, 2022
3b8dc06
fix missing ]
alonitac May 18, 2022
a5cc2b7
katas 3 fixes
alonitac May 18, 2022
ba6ea78
fix github actions
alonitac May 18, 2022
9da2667
github actions
alonitac May 18, 2022
684e413
github action fix
alonitac May 18, 2022
0be4345
python ex1
alonitac May 20, 2022
25cfbac
typo
alonitac May 20, 2022
dc78042
adding Git Basics answers
dshtranv May 21, 2022
3c80e32
.wsgi
alonitac May 22, 2022
4a954b9
Merge branch 'main' of https://github.com/alonitac/DevOpsJan22 into g…
dshtranv May 24, 2022
40fe352
adding final solution for git exercise
dshtranv May 24, 2022
7c42170
docker compose
alonitac May 29, 2022
c5d8b6b
typo
alonitac May 30, 2022
95c9595
docker compose redis-flask demo
alonitac Jun 1, 2022
25df602
docker compose redis-flask demo - fix
alonitac Jun 1, 2022
8024a8b
- persist redis data
alonitac Jun 8, 2022
e1c64b4
aws demos
alonitac Jun 15, 2022
5a331f7
aws demos
alonitac Jun 15, 2022
3005ac3
aws demos
alonitac Jun 15, 2022
cd00e0f
aws demos
alonitac Jun 19, 2022
ded232e
aws demos
alonitac Jun 19, 2022
af621bd
aws demos
alonitac Jun 19, 2022
dd27024
fix
alonitac Jun 19, 2022
8868532
- s3 demos
alonitac Jun 22, 2022
cdf6a50
headers are now correct
alonitac Jun 22, 2022
8b806d5
headers are now correct
alonitac Jun 22, 2022
34613e6
Merge pull request #26 from alonitac/git_ex1/dima
dshtranv Jun 22, 2022
435cf41
typo
alonitac Jun 23, 2022
f1ee003
Merge remote-tracking branch 'origin/main'
alonitac Jun 23, 2022
ec58c93
fstab not tstab
alonitac Jun 26, 2022
3b20cd7
iam demos
alonitac Jun 26, 2022
b8be297
docker ex
alonitac Jun 26, 2022
64410be
fix
alonitac Jun 26, 2022
20a3946
aws IAM policies demos
alonitac Jun 29, 2022
6142225
CPV demos
alonitac Jul 3, 2022
0aee9a9
docker exercise fix
alonitac Jul 3, 2022
de8b5bb
aws vpc
alonitac Jul 6, 2022
fa0f087
aws application load balancer
alonitac Jul 10, 2022
7176d2a
fix
alonitac Jul 10, 2022
069e9e1
aws autoscale
alonitac Jul 17, 2022
d7dd1ae
fix loadbalancer demo
alonitac Jul 17, 2022
8fc85b8
change load test endpoint
alonitac Jul 17, 2022
62976b7
Merge pull request #9 from alonitac/git_ex1/shlomigd
alonitac Jul 18, 2022
04ca9e7
db demo
alonitac Jul 20, 2022
70ea88f
Merge remote-tracking branch 'origin/main'
alonitac Jul 20, 2022
b7c35aa
postgres demo fixes
alonitac Jul 20, 2022
75792ca
aws ex1
alonitac Jul 20, 2022
c4c0f09
aws ex1
alonitac Jul 20, 2022
8e5150b
aws ex1
alonitac Jul 20, 2022
0ace76a
aws ex1
alonitac Jul 20, 2022
7cf73ee
aws ex1 fixes
alonitac Jul 21, 2022
15fc294
dynamo demo
alonitac Jul 24, 2022
e3f6996
alarm rds demo
alonitac Jul 27, 2022
7896a65
alarm rds demo
alonitac Jul 27, 2022
7df901f
dynamo
alonitac Jul 31, 2022
56e02ef
dynamo
alonitac Jul 31, 2022
52216d2
dynamo
alonitac Jul 31, 2022
b87db73
lambda workers
alonitac Aug 3, 2022
0d90789
typos
alonitac Aug 3, 2022
ac1bbf4
lambda state machine
alonitac Aug 4, 2022
b6560a1
dns demo
alonitac Aug 10, 2022
05ac555
pre-commit
alonitac Aug 14, 2022
f37e431
pre-commit docs reference
alonitac Aug 14, 2022
79f7ac1
tf getting started
alonitac Aug 14, 2022
4e418f5
tf tutorial
alonitac Aug 17, 2022
a464d7f
redundant file
alonitac Aug 17, 2022
6ed0373
terraform fixes
alonitac Aug 21, 2022
56fb00c
terraform demo - wip
alonitac Aug 21, 2022
b111c74
terraform demo - wip
alonitac Aug 24, 2022
cc881ac
valid parentheses
alonitac Aug 24, 2022
4c65590
ansible tutorial
alonitac Sep 7, 2022
3e4bb8f
ansible tutorial - revised
alonitac Sep 11, 2022
d398608
fix
alonitac Sep 11, 2022
fcb6cfc
jenkins tutorial
alonitac Sep 14, 2022
cdaf8b2
fixes
alonitac Sep 14, 2022
deedb7c
ansible utils
alonitac Sep 16, 2022
3fefac4
jenkins - deploy bot tutorial
alonitac Sep 18, 2022
0e694ec
fixes
alonitac Sep 18, 2022
06320e2
jenkins agent and secops
alonitac Sep 21, 2022
e3e9ddc
fix
alonitac Sep 21, 2022
a5d69eb
jenkins testing
alonitac Sep 28, 2022
67d5d84
fixes
alonitac Sep 28, 2022
d664f2e
jenkins done
alonitac Oct 2, 2022
cf271a8
fixes
alonitac Oct 2, 2022
7ea7a6d
jenkins ex - wip
alonitac Oct 11, 2022
94af33d
fixes
alonitac Oct 12, 2022
8baf63c
fixes jenkins ex
alonitac Oct 12, 2022
47a604a
jenkins ex done
alonitac Oct 13, 2022
4a3452e
add helpers
alonitac Oct 13, 2022
0e2f3b7
tiny fixes
alonitac Oct 13, 2022
79524b5
fixes
alonitac Oct 13, 2022
d0e6220
final project
alonitac Oct 19, 2022
83be6a4
fix
alonitac Oct 19, 2022
5a3a390
add links
alonitac Oct 19, 2022
7023f3a
nexus done
alonitac Oct 23, 2022
c295b29
fix .pypirc
alonitac Oct 23, 2022
8c98312
fixes student rejects
alonitac Oct 24, 2022
ab31ea5
k8s
alonitac Oct 26, 2022
c7c4adf
joe sleep implementation
alonitac Oct 26, 2022
59a3bd6
Merge pull request #33 from alonitac/feature/joe_sleep
alonitac Oct 26, 2022
241281d
fix version number
alonitac Oct 26, 2022
0f73654
publish package pipeline
alonitac Oct 26, 2022
67b42f9
commentout
alonitac Oct 26, 2022
4e22a0d
fix
alonitac Oct 26, 2022
ef8fd02
k8s deployment
alonitac Nov 13, 2022
5cda01b
k8s deployment
alonitac Nov 13, 2022
556253a
k8s deployment
alonitac Nov 13, 2022
f717adb
k8s tutorials
alonitac Nov 16, 2022
f713b98
k8s tutorials
alonitac Nov 23, 2022
36bd424
k8s readiness probes
alonitac Nov 23, 2022
eaa4b18
k8s readiness probes demo
alonitac Nov 23, 2022
ba478f8
jenkins exercise fixes
alonitac Nov 27, 2022
0bd8ef4
jenkins exercise fixes
alonitac Nov 27, 2022
abd71fe
k8s update
alonitac Nov 30, 2022
0fca924
k8s fluentd
alonitac Dec 4, 2022
2be3587
k8s fluentd
alonitac Dec 4, 2022
e1e1ab0
fluent values
alonitac Dec 4, 2022
d82eda3
helm
alonitac Dec 7, 2022
88513d9
helm mysql
alonitac Dec 7, 2022
bc01434
accountid fix jenkins ex
alonitac Dec 11, 2022
c9cddb8
ingress
alonitac Dec 14, 2022
a40d1d4
jenkins ex fix
alonitac Dec 14, 2022
61a2bcb
jenkins ex fix
alonitac Dec 14, 2022
0b0cf4d
ingress template
alonitac Dec 14, 2022
51dc628
ingress template
alonitac Dec 14, 2022
dfd4832
prometheus
alonitac Dec 21, 2022
e32cb4d
fluent values
alonitac Dec 21, 2022
07e4e1b
fluent values
alonitac Jan 3, 2023
35ec050
elastic
alonitac Jan 4, 2023
cf979f5
fix
alonitac Jan 4, 2023
3aa6e20
kibana dashboarding
alonitac Jan 8, 2023
9aa7055
kibana dashboarding
alonitac Jan 8, 2023
4e03e22
kibana alerting
alonitac Jan 15, 2023
5a1698e
elasticsearch
alonitac Jan 18, 2023
01a5f6a
elasticsearch DSL
alonitac Jan 22, 2023
a1c585e
metricbeat
alonitac Jan 25, 2023
afd5a0f
metricbeat
alonitac Jan 25, 2023
daf3629
argo
alonitac Jan 29, 2023
ef2026b
argo
alonitac Jan 29, 2023
faeea94
fix
alonitac Sep 2, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/pre-submit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/heads/linux_ex2/') }}
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
PythonKata1Test:
PythonKataTest:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/heads/python_katas_') }}
steps:
Expand All @@ -29,6 +29,6 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Katas Tests results
- name: Kata 1 Tests results
run: |
python -m python_katas.kata_1.test
python -m python_katas.kata_1.test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ __pycache__/
*.so


# ignore .pem file
*.pem
**/*.weights

# Distribution / packaging
.Python
env/
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Further reading in https://pre-commit.com/index.html
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: detect-aws-credentials
- id: detect-private-key
Binary file added 01_encryption/asymmetric/message.encrypted
Binary file not shown.
1 change: 1 addition & 0 deletions 01_encryption/symmetric/decrypted_secret
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plaintext secret
Binary file added 01_encryption/symmetric/encrypted_secret
Binary file not shown.
Binary file added 02_linux_ex1/secretGenerator.tar.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions 02_linux_ex1/src/CONTENT_TO_HASH
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
With the sun in my hand
Gonna throw the sun
Way across the land-
Cause I’m tired,
Tired as I can be
34 changes: 34 additions & 0 deletions 02_linux_ex1/src/generateSecret.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# practice dir creation
if [ ! -d "secretDir" ]; then
echo "Failed to generate secret. The directory 'secretDir' must exist before."
exit 1
fi

# practice dir deletion and file move
if [ -d "maliciousFiles" ]; then
echo "Failed to generate secret. The directory 'maliciousFiles' contains some malicious files... it must be removed before."
exit 1
fi

# practice file creation
if [ ! -f "secretDir/.secret" ]; then
echo "Failed to generate secret. The directory 'secretDir' must contain a file '.secret' in which the secret will be stored."
exit 1
fi

# practice change permissions
OCTAL_PERMISSIONS=$(stat -c "%a" secretDir/.secret)
if [ "$OCTAL_PERMISSIONS" != "600" ]; then
echo "Failed to generate secret. The file 'secretDir/.secret' must have read and write permission only."
exit 1
fi

# practice file linking understanding
if [ -L 'important.link' ] && [ ! -e 'important.link' ]; then
echo "Failed to generate secret. Secret can not be generated when broken file link exists. Please do something..."
exit 1
fi

cat ./CONTENT_TO_HASH | xargs | md5sum > secretDir/.secret && echo "Done! Your secret was stored in secretDir/.secret"
Empty file added 02_linux_ex1/src/important.link
Empty file.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions 02_linux_ex1/src/yourSolution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Binary file added 02_linux_ex1/whatIdo
Binary file not shown.
31 changes: 31 additions & 0 deletions 02_linux_ex1/whatIdo.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

struct stat st = {0};



int main() {
if (stat("./welcomeToDevOpsJan22", &st) == -1) {
mkdir("./welcomeToDevOpsJan22", 0700);
}

int num;
FILE *fptr;

// use appropriate location if you are using MacOS or Linux
fptr = fopen("welcomeToDevOpsJan22/goodLuck","w");

if(fptr == NULL)
{
printf("Error!");
exit(1);
}

fprintf(fptr,"%s","There you go... tell me what I do...");
fclose(fptr);
return 0;
}
19 changes: 19 additions & 0 deletions 05_simple_webserver/app.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import os
from flask import Flask, send_file, request

app = Flask(__name__)

hostname = os.environ.get('HOSTNAME', None)


# Try by: curl localhost:8080
@app.route('/', methods=['GET'])
def index():
print(request.headers)
return 'Hello world\n'


Expand All @@ -23,5 +27,20 @@ def profile_picture():
return send_file('images/profile-1.jpg', mimetype='image/gif')


@app.route('/status')
def status():
return 'OK'


@app.route('/load-test')
def load_test_endpoint():
x = 6
for i in range(1, 10):
x *= i
x /= i

return f'Done {hostname}'


if __name__ == '__main__':
app.run(debug=True, port=8080, host='0.0.0.0')
4 changes: 4 additions & 0 deletions 05_simple_webserver/simple_webserver.wsgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import sys
sys.path.insert(0, '/var/www/simple_webserver')

from app import app as application
143 changes: 143 additions & 0 deletions 07_git_exercises/dima_ex1/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#my git_ex1 exercise answers :

#Git Basics :

1. echo "1" > abc.txt
2. "red color" because the file not in index

3. "green color" after adding file to index (git add abc.txt && git commit -m "adding abc.txt file")

4. echo "2" >> abc.txt
5. "blue color"

6. git diff or git diff main

7. because i dont have staged files for the next commit

8. its a invalid argument because i dont have stage2 HEAD(or any hash or branch) in my repository

9. git add abc.txt
10. prints nothing because all my files is staged in index ( git diff only shows unstaged changes (--staged/--cached option showing staged changes))

11. git diff ---cached or --staged in more recent versions of git

12. echo "3" >> abc.txt
13. No, the output is different because git diff main shows unstaged changes also and git diff --staged shows only the staged changes !

14. Because the same reason as above, the green color for "changes to be committed" and red color for "changes not stage for commit"

15. git reset -- abc.txt for remove the staged files in index and git restore -- abc.txt for unstaged files in working tree

#Resolve conflicts:

1. git branch:
output:
bugfix/fix_readme_typo
bugfix/open_kibana_port
dev
feature/data_retention_policy
feature/elasticsearch_helm_chart
feature/upgrade_angular_version
feature/version1
feature/version2
* main
reset_question

2. git checkout -b feature/lambda_migration (the git checkout command accepts a -b argument that acts as a convenience method which will create new branch and switch to it immediately)
output:
Switched to a new branch 'feature/lambda_migration'

3. git merge feature/version1
output:
Merge made by the 'recursive' strategy.
.env | 0
app.py | 4 ++--
config.json | 0
3 files changed, 2 insertions(+), 2 deletions(-)
create mode 100644 .env
create mode 100644 config.json

4. git log:
output:
commit 84c58db9790c249a2b12cda2a0f2a1726e272e8d (HEAD -> feature/lambda_migration)
Merge: d89dca1 8019018
Author: dmitriyshub <d.shtranvasser@gmail.com>
Date: Tue May 24 12:37:21 2022 +0300

Merge branch 'feature/version2' into feature/lambda_migration

# Conflicts:
# app.py

commit d89dca1c732a45479f956147da71cd096bb5fc73

# Conflicts:
# app.py

commit d89dca1c732a45479f956147da71cd096bb5fc73
Merge: d14ba66 e0f83f5
Author: dmitriyshub <d.shtranvasser@gmail.com>
Date: Tue May 24 12:26:26 2022 +0300

Merge branch 'feature/version1' into feature/lambda_migration

Answer: Yes we have one commit for each merge

#Cherry Picking:

1. git checkout main && git checkout -b feature/lambda_migration2

4. config.json and .env files

5. yes because the commits must be related with each other by order

#Changes in working tree and switch branches:

1. git branch
2. nano take.txt, save file after changes. git add take.txt
3. git checkout dev
output:
error: Your local changes to the following files would be overwritten by checkout:
take.txt
Please commit your changes or stash them before you switch branches.
Aborting
answer: suggested approaches from git - commit or stash
git stash saves the local modification away and reverts the working directory to match the HEAD commit
4. No , the text overwritten to a b c on separate lines
5. No, my local uncommited changes will be overwritten and i will lose them

# Reset:

1. git checkout reset_question
2.
1: git reset --soft HEAD~1
output1:
On branch reset_question
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: 10.txt
answer1:
the command will remove the last commit from the current branch,but the file changes will stay in working tree

2: git reset --mixed HEAD~1
output2:
On branch reset_question
Untracked files:
(use "git add <file>..." to include in what will be committed)
10.txt
9.txt

nothing added to commit but untracked files present (use "git add" to track)

answer2:
the coomand will still kepp the changes in your working tree but not in the index

3: git reset --hard HEAD~1
output3:
HEAD is now at 17a0b5d 7
ansswer3:
lose all uncommited changes and all untracked files in addition to the changes introduced in the last commit

4. revert the last git commit, it will record a new commit with the changes introduced by reverting the last commit

#end
68 changes: 68 additions & 0 deletions 07_git_exercises/shlomigd_ex1/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Git Basics:

1. cat > abc.txt
1
ctrl d

2.Red.
3.Green.
git status
git add abc.txt
git status
git commit abc.txt -m "file created"
4. echo "2" >> abc.txt
5.Blue.
6.git diff main.
7.Because we didn't add the file abc.txt to the index area.
8.Because stage2 is not an option of the command git diff.
9. git add abc.txt
10.git diff prints nothing because there is no differences between the index and the working copy.
11. git diff --staged.
12. echo "3" >> abc.txt
13.No,because the git diff --staged command will compare the index with the master and the command git diff main will also compare the changes in the working copy.
14.Because one change in the file is ready to be committed and another change is not staged for commit.
15. git reset --hard

Resolve conflicts:

1. git branch
6. Yes, the commits are:
[git_ex1_repo] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F C:\Users\shlomi\PycharmProjects\git_ex1_repo\.git\MERGE_MSG --
[feature/lambda_migration 798ff58] Merge branch 'feature/version2' into feature/lambda_migration

Cherry picking:

4. file config.json and file .env.
5.Yes,because if the first commit create a file and the second one update the file and you will choose to cherry pick only the second one it will fail
and sometimes you create a function that calls another function and if and if this function is missing it will fail.

Changes in working tree and switch branches:

1. git branch
2. cat > take.txt
shlomi shlomi
gedasi gedasi
ctrl d
git add take.txt
3. git checkout dev
error: Your local changes to the following files would be overwritten by checkout:
take.txt
Please commit your changes or stash them before you switch branches.
Aborting

One approach suggested by git is to commit the changes before switching to another branch and the second one is to stash the changes.

5. No.
6. No, the file take.txt doesn't exist.
The Force Checkout removes all uncommitted changes.

Reset:

1. git checkout reset_question
2.1 The command removed the last commit, now file 10.txt ready to be committed.
2.2 The command removed the last commit,removes files from the index and keep the changes in the working copy,
The file 10.txt removed from the index and now the file is in the working copy with other files.
2.3 The command removed the last commit and all the untracked and uncommitted changes.
2.4 The command removes the last commit by adding a new commit to cancel the changes.
3. The notation HEAD~1 in the git reset command means to reset the last commit.

4 changes: 4 additions & 0 deletions 08_python_class/bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class Account:

currency = '$'

@staticmethod
def usd_to_ils_convert():
return 3.77

def __init__(self, name, balance):
self.owner = name
self.balance = balance
Expand Down
Loading