diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 00000000..b00f8e94 --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v5 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/labs/image-1.png b/labs/image-1.png new file mode 100644 index 00000000..dc5fbbed Binary files /dev/null and b/labs/image-1.png differ diff --git a/labs/image-10.png b/labs/image-10.png new file mode 100644 index 00000000..a393e151 Binary files /dev/null and b/labs/image-10.png differ diff --git a/labs/image-11.png b/labs/image-11.png new file mode 100644 index 00000000..64d2d573 Binary files /dev/null and b/labs/image-11.png differ diff --git a/labs/image-12.png b/labs/image-12.png new file mode 100644 index 00000000..54188eb7 Binary files /dev/null and b/labs/image-12.png differ diff --git a/labs/image-13.png b/labs/image-13.png new file mode 100644 index 00000000..593aa2fc Binary files /dev/null and b/labs/image-13.png differ diff --git a/labs/image-14.png b/labs/image-14.png new file mode 100644 index 00000000..069971b0 Binary files /dev/null and b/labs/image-14.png differ diff --git a/labs/image-15.png b/labs/image-15.png new file mode 100644 index 00000000..edbb1613 Binary files /dev/null and b/labs/image-15.png differ diff --git a/labs/image-16.png b/labs/image-16.png new file mode 100644 index 00000000..a4bd2b9c Binary files /dev/null and b/labs/image-16.png differ diff --git a/labs/image-17.png b/labs/image-17.png new file mode 100644 index 00000000..46aa0945 Binary files /dev/null and b/labs/image-17.png differ diff --git a/labs/image-18.png b/labs/image-18.png new file mode 100644 index 00000000..e002d50d Binary files /dev/null and b/labs/image-18.png differ diff --git a/labs/image-19.png b/labs/image-19.png new file mode 100644 index 00000000..5156007e Binary files /dev/null and b/labs/image-19.png differ diff --git a/labs/image-2.png b/labs/image-2.png new file mode 100644 index 00000000..75a52afc Binary files /dev/null and b/labs/image-2.png differ diff --git a/labs/image-20.png b/labs/image-20.png new file mode 100644 index 00000000..f6f2842c Binary files /dev/null and b/labs/image-20.png differ diff --git a/labs/image-21.png b/labs/image-21.png new file mode 100644 index 00000000..bb4b1cf3 Binary files /dev/null and b/labs/image-21.png differ diff --git a/labs/image-22.png b/labs/image-22.png new file mode 100644 index 00000000..810749e3 Binary files /dev/null and b/labs/image-22.png differ diff --git a/labs/image-23.png b/labs/image-23.png new file mode 100644 index 00000000..10790d89 Binary files /dev/null and b/labs/image-23.png differ diff --git a/labs/image-24.png b/labs/image-24.png new file mode 100644 index 00000000..3229ca60 Binary files /dev/null and b/labs/image-24.png differ diff --git a/labs/image-25.png b/labs/image-25.png new file mode 100644 index 00000000..2d8bbe00 Binary files /dev/null and b/labs/image-25.png differ diff --git a/labs/image-26.png b/labs/image-26.png new file mode 100644 index 00000000..6b18ecca Binary files /dev/null and b/labs/image-26.png differ diff --git a/labs/image-27.png b/labs/image-27.png new file mode 100644 index 00000000..8600ccc2 Binary files /dev/null and b/labs/image-27.png differ diff --git a/labs/image-28.png b/labs/image-28.png new file mode 100644 index 00000000..f8a0f340 Binary files /dev/null and b/labs/image-28.png differ diff --git a/labs/image-29.png b/labs/image-29.png new file mode 100644 index 00000000..dbfb3e37 Binary files /dev/null and b/labs/image-29.png differ diff --git a/labs/image-3.png b/labs/image-3.png new file mode 100644 index 00000000..050b8b84 Binary files /dev/null and b/labs/image-3.png differ diff --git a/labs/image-30.png b/labs/image-30.png new file mode 100644 index 00000000..a8689df3 Binary files /dev/null and b/labs/image-30.png differ diff --git a/labs/image-31.png b/labs/image-31.png new file mode 100644 index 00000000..89980be4 Binary files /dev/null and b/labs/image-31.png differ diff --git a/labs/image-32.png b/labs/image-32.png new file mode 100644 index 00000000..ffcf49c4 Binary files /dev/null and b/labs/image-32.png differ diff --git a/labs/image-33.png b/labs/image-33.png new file mode 100644 index 00000000..d4864903 Binary files /dev/null and b/labs/image-33.png differ diff --git a/labs/image-34.png b/labs/image-34.png new file mode 100644 index 00000000..4690077d Binary files /dev/null and b/labs/image-34.png differ diff --git a/labs/image-35.png b/labs/image-35.png new file mode 100644 index 00000000..073b0673 Binary files /dev/null and b/labs/image-35.png differ diff --git a/labs/image-36.png b/labs/image-36.png new file mode 100644 index 00000000..ef030e1d Binary files /dev/null and b/labs/image-36.png differ diff --git a/labs/image-37.png b/labs/image-37.png new file mode 100644 index 00000000..1e100ab5 Binary files /dev/null and b/labs/image-37.png differ diff --git a/labs/image-38.png b/labs/image-38.png new file mode 100644 index 00000000..255412c4 Binary files /dev/null and b/labs/image-38.png differ diff --git a/labs/image-39.png b/labs/image-39.png new file mode 100644 index 00000000..55f080c6 Binary files /dev/null and b/labs/image-39.png differ diff --git a/labs/image-4.png b/labs/image-4.png new file mode 100644 index 00000000..bced922e Binary files /dev/null and b/labs/image-4.png differ diff --git a/labs/image-40.png b/labs/image-40.png new file mode 100644 index 00000000..dc3b40c5 Binary files /dev/null and b/labs/image-40.png differ diff --git a/labs/image-41.png b/labs/image-41.png new file mode 100644 index 00000000..df3103b4 Binary files /dev/null and b/labs/image-41.png differ diff --git a/labs/image-42.png b/labs/image-42.png new file mode 100644 index 00000000..b449333e Binary files /dev/null and b/labs/image-42.png differ diff --git a/labs/image-43.png b/labs/image-43.png new file mode 100644 index 00000000..c24f0102 Binary files /dev/null and b/labs/image-43.png differ diff --git a/labs/image-44.png b/labs/image-44.png new file mode 100644 index 00000000..0e823916 Binary files /dev/null and b/labs/image-44.png differ diff --git a/labs/image-45.png b/labs/image-45.png new file mode 100644 index 00000000..b8d42da2 Binary files /dev/null and b/labs/image-45.png differ diff --git a/labs/image-46.png b/labs/image-46.png new file mode 100644 index 00000000..e512fdfc Binary files /dev/null and b/labs/image-46.png differ diff --git a/labs/image-47.png b/labs/image-47.png new file mode 100644 index 00000000..3fbc0a6e Binary files /dev/null and b/labs/image-47.png differ diff --git a/labs/image-48.png b/labs/image-48.png new file mode 100644 index 00000000..7e3cdbe4 Binary files /dev/null and b/labs/image-48.png differ diff --git a/labs/image-49.png b/labs/image-49.png new file mode 100644 index 00000000..1576e3db Binary files /dev/null and b/labs/image-49.png differ diff --git a/labs/image-5.png b/labs/image-5.png new file mode 100644 index 00000000..cad7aa6d Binary files /dev/null and b/labs/image-5.png differ diff --git a/labs/image-50.png b/labs/image-50.png new file mode 100644 index 00000000..79fc4a69 Binary files /dev/null and b/labs/image-50.png differ diff --git a/labs/image-51.png b/labs/image-51.png new file mode 100644 index 00000000..3caf47f1 Binary files /dev/null and b/labs/image-51.png differ diff --git a/labs/image-52.png b/labs/image-52.png new file mode 100644 index 00000000..2f694881 Binary files /dev/null and b/labs/image-52.png differ diff --git a/labs/image-53.png b/labs/image-53.png new file mode 100644 index 00000000..719e9574 Binary files /dev/null and b/labs/image-53.png differ diff --git a/labs/image-54.png b/labs/image-54.png new file mode 100644 index 00000000..cfe43fc8 Binary files /dev/null and b/labs/image-54.png differ diff --git a/labs/image-55.png b/labs/image-55.png new file mode 100644 index 00000000..7b113e44 Binary files /dev/null and b/labs/image-55.png differ diff --git a/labs/image-56.png b/labs/image-56.png new file mode 100644 index 00000000..e13e4ab3 Binary files /dev/null and b/labs/image-56.png differ diff --git a/labs/image-57.png b/labs/image-57.png new file mode 100644 index 00000000..0f552ba4 Binary files /dev/null and b/labs/image-57.png differ diff --git a/labs/image-58.png b/labs/image-58.png new file mode 100644 index 00000000..9f6f6dca Binary files /dev/null and b/labs/image-58.png differ diff --git a/labs/image-59.png b/labs/image-59.png new file mode 100644 index 00000000..680de0f1 Binary files /dev/null and b/labs/image-59.png differ diff --git a/labs/image-6.png b/labs/image-6.png new file mode 100644 index 00000000..83469b1d Binary files /dev/null and b/labs/image-6.png differ diff --git a/labs/image-60.png b/labs/image-60.png new file mode 100644 index 00000000..b0aaf74d Binary files /dev/null and b/labs/image-60.png differ diff --git a/labs/image-61.png b/labs/image-61.png new file mode 100644 index 00000000..5fae820c Binary files /dev/null and b/labs/image-61.png differ diff --git a/labs/image-62.png b/labs/image-62.png new file mode 100644 index 00000000..359ceedd Binary files /dev/null and b/labs/image-62.png differ diff --git a/labs/image-63.png b/labs/image-63.png new file mode 100644 index 00000000..ec85fa12 Binary files /dev/null and b/labs/image-63.png differ diff --git a/labs/image-64.png b/labs/image-64.png new file mode 100644 index 00000000..2c683703 Binary files /dev/null and b/labs/image-64.png differ diff --git a/labs/image-65.png b/labs/image-65.png new file mode 100644 index 00000000..c0b6f895 Binary files /dev/null and b/labs/image-65.png differ diff --git a/labs/image-66.png b/labs/image-66.png new file mode 100644 index 00000000..720530b7 Binary files /dev/null and b/labs/image-66.png differ diff --git a/labs/image-67.png b/labs/image-67.png new file mode 100644 index 00000000..4e9f057b Binary files /dev/null and b/labs/image-67.png differ diff --git a/labs/image-68.png b/labs/image-68.png new file mode 100644 index 00000000..4f037b92 Binary files /dev/null and b/labs/image-68.png differ diff --git a/labs/image-69.png b/labs/image-69.png new file mode 100644 index 00000000..09f589fe Binary files /dev/null and b/labs/image-69.png differ diff --git a/labs/image-7.png b/labs/image-7.png new file mode 100644 index 00000000..876d9e57 Binary files /dev/null and b/labs/image-7.png differ diff --git a/labs/image-70.png b/labs/image-70.png new file mode 100644 index 00000000..fbe8fd91 Binary files /dev/null and b/labs/image-70.png differ diff --git a/labs/image-71.png b/labs/image-71.png new file mode 100644 index 00000000..907d7279 Binary files /dev/null and b/labs/image-71.png differ diff --git a/labs/image-72.png b/labs/image-72.png new file mode 100644 index 00000000..8c62353c Binary files /dev/null and b/labs/image-72.png differ diff --git a/labs/image-73.png b/labs/image-73.png new file mode 100644 index 00000000..3ee9aa29 Binary files /dev/null and b/labs/image-73.png differ diff --git a/labs/image-74.png b/labs/image-74.png new file mode 100644 index 00000000..9375590b Binary files /dev/null and b/labs/image-74.png differ diff --git a/labs/image-75.png b/labs/image-75.png new file mode 100644 index 00000000..e8a7784b Binary files /dev/null and b/labs/image-75.png differ diff --git a/labs/image-76.png b/labs/image-76.png new file mode 100644 index 00000000..4f8353fb Binary files /dev/null and b/labs/image-76.png differ diff --git a/labs/image-77.png b/labs/image-77.png new file mode 100644 index 00000000..8341bc7c Binary files /dev/null and b/labs/image-77.png differ diff --git a/labs/image-78.png b/labs/image-78.png new file mode 100644 index 00000000..db44feca Binary files /dev/null and b/labs/image-78.png differ diff --git a/labs/image-79.png b/labs/image-79.png new file mode 100644 index 00000000..13a98db7 Binary files /dev/null and b/labs/image-79.png differ diff --git a/labs/image-8.png b/labs/image-8.png new file mode 100644 index 00000000..a115caa3 Binary files /dev/null and b/labs/image-8.png differ diff --git a/labs/image-80.png b/labs/image-80.png new file mode 100644 index 00000000..b1259784 Binary files /dev/null and b/labs/image-80.png differ diff --git a/labs/image-81.png b/labs/image-81.png new file mode 100644 index 00000000..559dbe85 Binary files /dev/null and b/labs/image-81.png differ diff --git a/labs/image-82.png b/labs/image-82.png new file mode 100644 index 00000000..89851607 Binary files /dev/null and b/labs/image-82.png differ diff --git a/labs/image-83.png b/labs/image-83.png new file mode 100644 index 00000000..4f7c6ee4 Binary files /dev/null and b/labs/image-83.png differ diff --git a/labs/image-84.png b/labs/image-84.png new file mode 100644 index 00000000..54663059 Binary files /dev/null and b/labs/image-84.png differ diff --git a/labs/image-85.png b/labs/image-85.png new file mode 100644 index 00000000..32b81b79 Binary files /dev/null and b/labs/image-85.png differ diff --git a/labs/image-86.png b/labs/image-86.png new file mode 100644 index 00000000..2a7185ae Binary files /dev/null and b/labs/image-86.png differ diff --git a/labs/image-9.png b/labs/image-9.png new file mode 100644 index 00000000..30e6a930 Binary files /dev/null and b/labs/image-9.png differ diff --git a/labs/image.png b/labs/image.png new file mode 100644 index 00000000..6d7bfe49 Binary files /dev/null and b/labs/image.png differ diff --git a/labs/submission1.md b/labs/submission1.md new file mode 100644 index 00000000..e69de29b diff --git a/labs/submission2.md b/labs/submission2.md new file mode 100644 index 00000000..717b995c --- /dev/null +++ b/labs/submission2.md @@ -0,0 +1,96 @@ +### Task 1 + +![alt text](image-2.png) + +![alt text](image-3.png) + +![alt text](image-4.png) + +blob - 38e739694be035dc31fcbea00e9151dab938dbe6 test.txt ( any single file changed) + +tree - tree 1da10c0dfa022559f46478f9684228d99f64a341 labs ( and any folder) + +commit ojbect content - " tree c79f51b057b9701a598453e063ca55cc84e5e19b +parent 1c7fefcaae674f36b4a1bfd187eb9b82ddfcc067 +author Nikita Stepankov 1770788139 +0300 +committer Nikita Stepankov 1770788139 +0300 " + +### Task 2 +after reset --soft , back to second, third removed +log --oneline +![alt text](image-5.png) +reflog +![alt text](image-6.png) +after --hard + +log --oneline +![alt text](image-8.png) +reflog +![alt text](image-7.png) + +after back +outline +![alt text](image-12.png) + +reflog +![alt text](image-11.png) + + +| Reset Type | HEAD Moves | Index Changes | Working Tree Changes | Best For | +|------------|------------|---------------|----------------------|--------------------------------| +| --soft | ✓ Yes | ✗ Kept | ✗ Kept | Edit commit message/reorganize | +| --hard | ✓ Yes | ✓ Discarded | ✓ Discarded | Discard all changes completely | + +### Task 3 +graph snippet +![alt text](image-13.png) + +commit messaeg list +Side branch commit + +Add test file + +docs: done lab1 submissions + +Fix submission + +test + +change pull_request template + +Add pull_request_template in git + +docs: add lab1 submission stub + +docs: add commit signing summary + + +it clearly show structure of the repo with all commits + +### Task 4 + +tag +![alt text](image.png) + +hash +![alt text](image-1.png) + +Tags imporatnt for versioning, CI/CD triggers, documentation and stability. It improves realization of thise feature of repo + + +### Task 5 +commands +![alt text](image-14.png) + +git status +![alt text](image-15.png) + +gir branch +![alt text](image-16.png) + +Git status shows file that are not added to next commit, so it show whats file are can be added to save last changes of this file +Gir branch show on what branch you are and all structure of repo with all branches in + +### GitHub Community + +Starring repositories helps maintainers gauge interest and impact, while giving you a bookmark to revisit useful code, learn patterns, and track influential projects. Following developers builds professional networks, keeps you aware of best practices and emerging tools, and fosters mentorship opportunities within your team and the broader community. \ No newline at end of file diff --git a/labs/submission3.md b/labs/submission3.md new file mode 100644 index 00000000..0cfc4efd --- /dev/null +++ b/labs/submission3.md @@ -0,0 +1,38 @@ +# Task 1 +Worflow run succefully +![alt text](image-17.png) + + +Logs of worflow +![alt text](image-18.png) + +In GitHub Actions, there are several key components: + +Jobs - a collection of sequential steps executed by a runner + +Steps - individual tasks within a job + +Runners - virtual machines responsible for running workflows + +Triggers - events that initiate workflow execution (e.g., push operations) + +The workflow was initiated following a git push command, as specified in the configuration with "on: [push]". + +Upon receiving a push event, GitHub validates the workflow configuration files and provisions a virtual machine to carry out the steps defined in the YAML file. + + +# Task 2 +Add manual worflow runner +![alt text](image-19.png) + +![alt text](image-20.png) + +Gathering information wtih github workflow +![alt text](image-21.png) + +![alt text](image-22.png) + +Automatic triggers (push) occur whenever changes are submitted to the repository. +Manual triggers (workflow_dispatch) are initiated by users through the "Run workflow" button in the GitHub interface. Manual execution is particularly useful for testing purposes, as it eliminates the need to create a new commit. + +The workflow runs on a GitHub-hosted runner using the Ubuntu operating system. This runner provides a standard Linux environment equipped with pre-installed tools such as Git, Python, Node.js, and others. This setup is well-suited for automated builds, testing procedures, and script execution. \ No newline at end of file diff --git a/labs/submission4.md b/labs/submission4.md new file mode 100644 index 00000000..a2b2a6c1 --- /dev/null +++ b/labs/submission4.md @@ -0,0 +1,77 @@ +## Task 1.1 +systemd-analyze + +![alt text](image-23.png) + +systemmd-analyze blame +![alt text](image-24.png) + +Checked System Load: +![alt text](image-33.png) + +## Task 1.2 +Identify Resource-Intensive Processes: +![alt text](image-26.png) + +### Answers and observation +Top memory consuming is PID 231 1 /usr/bin/python3 /usr/share 0.2 0.0 = 0.2. +Top cpu consumption is 1 0 /sbin/init 0.1 0.6 + +Basic ones just system proccess that needs to run fot system + +## Task 1.3 +Map Service Relationships: +![alt text](image-27.png) + +![alt text](image-28.png) + +## Task 1.4 +Audit Login Activity: +![alt text](image-29.png) + +![alt text](image-30.png) + +### Obseration +I entered the system with name gfnmj + +## Task 1.5 +Inspect Memory Allocation: + +![alt text](image-32.png) + +### Obseration + +Have a lot of free memery to use, no additional files used to extend memory load + + +## Task 2.1 + +traceroute +![alt text](image-34.png) +### insights +The traceroute shows your traffic takes a path from Russia through Sweden to Germany before reaching GitHub, with multiple timeouts suggesting routers configured to not respond to ICMP requests rather than actual connectivity issues. Despite these timeouts, the connection works with reasonable latency (~60ms) to GitHub's servers, though the routing path appears somewhat indirect. +Dig +![alt text](image-35.png) +### insights +This dig output shows a successful DNS lookup for github.com resolving to IP address 140.82.121.4 in just 7 milliseconds. Your DNS server at 10.255.255.254 responded quickly with the correct GitHub address, and the short TTL (Time-To-Live) of 3 seconds indicates this record expires very quickly. + + +## Task 2.2 +No captureed traffic ![alt text](image-36.png) + +### example of dns query +Example DNS query: Out IP 172.17.222.XXX.44383 > 8.8.8.8.53: 17629+ [1au] A? gith, teub.com. +This shows my local WSL machine, with its IP address partially redacted, initiating a DNS resolution. It forwards a request to Google's public DNS server at 8.8.8.8, specifically asking for the IPv4 address (an 'A' record) associated with github.com. + +Example response: In IP 8.8.8.8.53 > 172.17.222.XXX.44383: ... A 20.205.243.166 +The public DNS server replies, providing the resolved information. The query is successful, returning the specific IP address 20.205.243.166 for the requested domain. + +## Task 2.3 +8.8.4.4 +![alt text](image-37.png) +1.1.2.2 +![alt text](image-38.png) + +Comparison of reverse lookup results: The reverse lookup for 8.8.4.4 successfully resolved to dns.google., confirming that Google has configured a valid PTR record for this IP. On the other hand, the lookup for 1.1.2.2 timed out and returned NXDOMAIN (non-existent domain), indicating that there is no reverse DNS (PTR) record associated with this IP address. + + diff --git a/labs/submission5.md b/labs/submission5.md new file mode 100644 index 00000000..280850e2 --- /dev/null +++ b/labs/submission5.md @@ -0,0 +1,82 @@ +# Task 1 +Installed succes, without any issues +Platfrom : Windows 11 Home +Version of VM box : 7.2.4 r17099 +![alt text](image-39.png) + +# Task 2 +## VM config: +![alt text](image-40.png) + +![alt text](image-41.png) + +## CPU info: +### tools: +lscpu +### used command: +lscpu +cat /proc/cpuinfo | grep -E "model name|cpu MHz|cpu cores|siblings" +### output +![alt text](image-42.png) + +## Memory infomation +### tools: +free +### used command: +free -h +### output +![alt text](image-43.png) + +## Network Configuration + +used command +ip addr show +hostname -I +![alt text](image-44.png) + +## Storage Information +### tools : +df +lsblk +fdisk +### used command: +df -h +lsblk +sudo fdisk -l +### output +![alt text](image-45.png) + +![alt text](image-46.png) +![alt text](image-47.png) +## Operating System +### tools : +lsb_release +uname +hostnamectl + +### used commands : +lsb_release -a +cat /etc/os-release +uname -a +hostnamectl +### output +![alt text](image-48.png) +![alt text](image-49.png) + +## Virtualization Detection +tools: +systemd-detect-virt +lscpu +dmesg +dmidecode +### command used: +systemd-detect-virt +lscpu | grep Hypervisor +dmesg | grep -i virtual +dmidecode -s system-manufacturer +### output +![alt text](image-50.png) + + +## Analyze +Most useful lscpu, shows a lot of useful info about cpu frequnecy nad hypervisor. And fdisk -l, showed whole segmentation of memory disk. \ No newline at end of file diff --git a/labs/submission6.md b/labs/submission6.md new file mode 100644 index 00000000..c85a987e --- /dev/null +++ b/labs/submission6.md @@ -0,0 +1,101 @@ +# Task 1 +## Task 1.1 +### Task 1.1.1 +![alt text](image-51.png) +### Task 1.1.2 +![alt text](image-52.png) + +### Task 1.1.3 +![alt text](image-53.png) + +## Task 1.2 + +### Task 1.2.1 +![alt text](image-54.png) + +### Task 1.2.2 +Error response from daemon: conflict: unable to delete ubuntu:latest (must be forced) - container 59eff4ad3539 is using its referenced image d1e2e92c075e + +### Task 1.2.3 +![alt text](image-56.png) + +**Answer:** Image removal fails when a container exists because containers are dependent instances of an image. An image serves as the read-only template or blueprint, while a container is a readable/writable layer added on top of that image. Docker enforces this dependency to prevent accidental deletion of images that are currently being used by running or stopped containers. You must remove the dependent containers first (`docker rm`) before you can remove the underlying image. + +**Answer:** The exported tar file (`ubuntu_image.tar`) created by `docker save` contains: +1. **All image layers** - Every filesystem layer that makes up the Ubuntu image +2. **Image metadata** - JSON configuration files describing the image, including environment variables, default commands, and layer relationships +3. **Manifest file** - A list of all layers and their order for proper image reconstruction +4. **The complete image tree** - All parent images and dependencies needed to fully recreate the image on another system + +# Task 2 + +## Task 2.1 + +### Task 2.1.3 + + +![alt text](image-57.png) + +![alt text](image-66.png) + +## Task 2.2 + +![alt text](image-58.png) +docker diff my_website_container +![alt text](image-59.png) + +**Answer:** The diff tool compares two files or file systems line by line. When viewing the output: +- **A (Added):** Lines that exist in the new file but not in the old one. +- **C (Changed):** Lines that exist in both files but have been altered. +- **D (Deleted):** Lines that existed in the old file but were removed in the new one. + +**Reflection**: +- **docker commit** is quick for creating a snapshot of a running container (good for debugging or saving a temporary state), but it creates "black box" images—it's non-reproducible and hard to version control. +- **Dockerfile** is declarative and automates builds. Its main advantage is **traceability** (every layer is defined) and **repeatability** (CI/CD can rebuild the exact same image). The disadvantage is the slight learning curve for syntax and best practices. + +# Task 3 +## Task 3.1 +### Task 3.1.1 +![alt text](image-60.png) + +### Task 3.2 +### Task 3.2.1 +docker exec container1 ping -c 3 container2 +![alt text](image-61.png) +### Task 3.2.2 + +docker network inspect lab_network +![alt text](image-62.png) +![alt text](image-63.png) + +### Task 3.2.3 +![alt text](image-64.png) + +**Answer:** Docker embeds a DNS server at the `127.0.0.11` IP address inside containers. When a container tries to reach another container by its name (e.g., `ping database`), the container's resolver queries this embedded DNS server. Docker then resolves that name to the correct container IP address, provided both containers are on the same user-defined network. + + +**Answer:** User-defined bridges offer: +1. **Automatic DNS resolution:** Containers can resolve each other by name (the default bridge requires `--link`, which is legacy). +2. **Better isolation:** You can group related containers (e.g., a "frontend" network vs a "backend" network) and control which containers can communicate. +3. **Dynamic attachment:** Containers can be connected/disconnected on the fly without restarting. + +**Reflection:** In short, user-defined bridges provide service discovery out of the box and a more secure, manageable network topology for multi-container applications. +# Task 4 + +## Task 4.1 + +![alt text](image-65.png) + +![alt text](image-67.png) + +![alt text](image-68.png) + +## Task 4.2 +![alt text](image-69.png) + +**Answer:** Containers are ephemeral by design—when a container is removed, all data written to its writable layer is deleted. Data persistence is important for stateful applications (like databases) to ensure that data survives container restarts, updates, or crashes. + +**Answer:** +- **Container Storage (Writable Layer):** Exists inside the container. Fast but ephemeral. **Use for:** Temporary cache files or scratch space. +- **Volumes:** Managed by Docker (`/var/lib/docker/volumes/...`). Completely isolated from the host's directory structure. **Use for:** Production databases and persistent application data (safest and most portable option). +- **Bind Mounts:** Maps a specific host file/directory into the container. **Use for:** Development (hot-reloading code) or mounting configuration files (like `nginx.conf`) from the host. \ No newline at end of file diff --git a/labs/submission7.md b/labs/submission7.md new file mode 100644 index 00000000..5345f0b0 --- /dev/null +++ b/labs/submission7.md @@ -0,0 +1,74 @@ +# task 1 + +## task 1.1 / 1.2 +starting files + +desired-state.txt +```text +version: 1.0 +app: myapp +replicas: 3 +``` + +current-state.txt +```text +version: 1.0 +app: myapp +replicas: 3 +``` +## task 1.3 +output of script +![alt text](image-70.png) + +## task 1.4 +drift detected after changing +![alt text](image-71.png) + +![alt text](image-72.png) + + +## task 1 Analysis + +The GitOps reconciliation loop continuously compares the actual state of the system against the desired state defined in Git (the desired-state file in this lab). Git serves as the single source of truth. If someone makes manual changes to the live environment, the system detects this configuration drift and automatically restores the correct configuration. This approach helps teams prevent long-term inconsistencies across their infrastructure. + +## task 1 Reflection + +Declarative configuration is better suited for production environments because: + +- **Clear intent** — it explicitly defines the desired final state +- **Auditable** — changes can be easily reviewed through Git +- **Consistent and safe** — the process is repeatable and reduces human error +- **Fast recovery** — the system can automatically reapply the correct state without manual intervention + +While imperative commands are useful for ad-hoc tasks or troubleshooting, they can introduce hidden inconsistencies between environments if not carefully managed. + + +# task 2 +## task 2.1-2.2 + +inital health.log +![alt text](image-73.png) + +after defecte +![alt text](image-74.png) + +restoring after reconicle +![alt text](image-75.png) + +output of monitor +![alt text](image-76.png) + +![alt text](image-77.png) + +log +![alt text](image-78.png) + +### Task 2 Analysis + +MD5 generates a unique hash value for each file. Even a minor modification to the file results in a completely different hash. This makes checksum comparison an efficient method for detecting configuration changes and identifying drift. + +### Comparison with ArgoCD Sync Status + +- In this lab, configuration files are compared, and the result is displayed as either OK or CRITICAL. +- In ArgoCD, Sync Status compares the current state of the live cluster against the state defined in Git. +- The underlying concept is the same: detect discrepancies, indicate the status, and then proceed to synchronize or reconcile the differences. \ No newline at end of file diff --git a/labs/submission8.md b/labs/submission8.md new file mode 100644 index 00000000..8f820acf --- /dev/null +++ b/labs/submission8.md @@ -0,0 +1,56 @@ +# Task 1 +## Task 1.1 +top 3 of i/o usage +![alt text](image-79.png) +top 3 of cpu and memory +![alt text](image-80.png) + +## Task 1.2 +largest files +![alt text](image-81.png) + +## Analysis: + CPU is mostly idle (97.57%), but disk I/O shows heavy reads on /dev/sde (130.30 reads/sec, 3.3 MB/s) with moderate I/O on other devices; memory is lightly used, and storage consumption is dominated by APT package lists under /var/lib/apt/lists. + +## Reflection: + Reduce disk I/O and reclaim space by cleaning unnecessary package lists with apt-get clean and apt-get autoclean, and consider limiting logging or moving /var to a less busy disk if I/O contention persists. + +# Task 2 +choosed url - https://eu5.paradoxwikis.com/Europa_Universalis_5_Wiki + +API check: + +URL: `https://eu5.paradoxwikis.com/Europa_Universalis_5_Wiki` +Assertion: status code `200` +Frequency: every 10 minutes + +![alt text](image-82.png) + +Browser checks: +- Start URL: `https://eu5.paradoxwikis.com/Europa_Universalis_5_Wiki` +- Validate XPath element is assable: '//*[@id="mw-content-text"]/div[1]/div[1]/div[4]/div[2]/div/div[1]/div[2]/div/ul[1]/li[1]/img` +- Click link and verify final URL: `https://eu5.paradoxwikis.com/Europa_Universalis_5_Wiki` +- Verify `Beginner's guide icon` visiable +- Timeout settings: `actionTimeout=10000ms`, test timeout `210000ms` + +![alt text](image-83.png) + +![alt text](image-84.png) + +dashboard +![alt text](image-85.png) + +Alert checks + Notification channel: Email (`gfnmjg@gmail.com`) + Triggers: `a check fails`, `an SSL certificate is due to expire in 30 days` +![alt text](image-86.png) + + +API checks quickly confirm a service is up and responding. + +Browser checks go a step further—they simulate actual user behavior, ensuring critical flows like navigation and interactions work as expected. + +Failure alerts catch issues the moment they happen, while SSL-expiry notifications help you stay ahead of potential downtime by addressing certificate renewals before they become a problem. + + + \ No newline at end of file