Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab7 8 #172

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions submission1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Task 1: SSH Commit Signature Verification
Signed commits help ensure the authenticity and integrity of commits.
They verify that a commit comes from a trusted source and has not been tampered with.
## Benefits of Signing Commits
1. **Author Verification**: Confirms the identity of the commit author.
2. **Data Integrity**: Ensures the commit has not been altered since it was signed.
3. **Trust in Collaboration**: Builds confidence in projects with multiple contributors.
4. **Security**: Prevents unauthorized commits or identity impersonation.
5. **Compliance**: Helps meet audit and regulatory requirements.
# Task 2: Merge Strategies in Git
## Standard Merge
- **Pros**: Retains full commit history and development context.
- **Cons**: Can create a cluttered history in busy repositories.
## Squash and Merge
- **Pros**: Combines all commits into a single commit, simplifying the history.
- **Cons**: Loses detailed history of individual commits.
## Rebase and Merge
- **Pros**: Creates a linear history, making it easier to follow.
- **Cons**: Rewrites commit history, which can cause conflicts in collaborative projects.
## Why Standard Merge is Preferred
- Standard Merge is often preferred because it maintains the full history, making it easier to track changes and collaborate without conflicts.
23 changes: 23 additions & 0 deletions submission2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# IPFS Gateway Setup and File Upload Documentation
## Connected Peers and Bandwidth

**Connected Peers**: 29
**Bandwidth Usage**:
- Incoming: 27 KiB/s
- Outgoing: 313 KiB/s

## Uploaded File Information

**File Name**:
**File Hash (CID)**: QmRLLMYruhaxGFXKPUR7F1LLhXTpJgcVntH925249V1vjm

## IPFS Gateway URLs

[IPFS.io Gateway](https://ipfs.io/ipfs/QmRLLMYruhaxGFXKPUR7F1LLhXTpJgcVntH925249V1vjm)
[Cloudflare Gateway](https://cloudflare-ipfs.com/ipfs/QmRLLMYruhaxGFXKPUR7F1LLhXTpJgcVntH925249V1vjm)
[Infura Gateway](https://ipfs.infura.io/ipfs/QmRLLMYruhaxGFXKPUR7F1LLhXTpJgcVntH925249V1vjm)

## Fleek Deployment

**IPFS Link**: bafybeifkg56qjgf7dfryjgzhtwtq34qy5m5bxe7kkmr3bhyzeqpae2gzky
**Fleek Domain**: https://low-table-high.on-fleek.app/
37 changes: 37 additions & 0 deletions submission7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# TASK 1

Version of the vm box: Version 7.1.0 r164728 (Qt6.5.3)
But the UTM was used because of problems with the MacOS: Version 4.5.4 (100)
![VM Running](vm_running.png)

# TASK 2

## Processor Information
- **Tool Used:** `sysctl`
- **Command:** `sysctl -n machdep.cpu.brand_string`
- **Output:** `Apple M2 Pro`


## RAM Information
- **Tool Used:** `vm_stat` and `sysctl`
- **Command 1:** `vm_stat`
- **Output:**`Mach Virtual Memory Statistics: (page size of 16384 bytes) Pages free: 212857. Pages active: 240569. Pages inactive: 323215. Pages speculative: 45272. Pages throttled: 0. Pages wired down: 112946. Pages purgeable: 31499. "Translation faults": 670069897. Pages copy-on-write: 6787287. Pages zero filled: 374632986. Pages reactivated: 14417335. Pages purged: 9158200. File-backed pages: 392631. Anonymous pages: 216425. Pages stored in compressor: 372621. Pages occupied by compressor: 73250. Decompressions: 17749927. Compressions: 26883426. Pageins: 12206601. Pageouts: 95995. Swapins: 133049. Swapouts: 257185.`

- **Command 2:** `sysctl hw.memsize`
- **Output:** `hw.memsize: 17179869184`

This corresponds to 16 GB of RAM.

## Network Information
- **Tool Used:** `ifconfig`
- **Command:** `ifconfig`
- **Output:** `lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 ... en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 6c:7e:67:d1:bb:22 inet6 fe80::84f:272:33b3:4d70%en0 prefixlen 64 secured scopeid 0xf inet 10.91.49.154 netmask 0xfffff000 broadcast 10.91.63.255 ...`

- **Command for filtering inet addresses:** `ifconfig -a | grep inet`
- **Output:** `inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet6 fe80::6c7e:67ff:fed1 %ap1 prefixlen 64 scopeid 0xe inet6 fe80::84f:272:33b3:4d70%en0 prefixlen 64 secured scopeid 0xf inet 10.91.49.154 netmask 0xfffff000 broadcast 10.91.63.255`


## Operating System Specifications
- **Tool Used:** `sw_vers`
- **Command:** `sw_vers`
- **Output:** `ProductName: macOS ProductVersion: 14.5 BuildVersion: 23F79`
134 changes: 134 additions & 0 deletions submission8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

# Containers Lab - Docker

## Task 1: Container Management

### 1. List Containers
Command:
```bash
docker ps -a
```
Output:
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cd64cf2242ad 195245f0c792 "/docker-entrypoint.…" 6 days ago Exited (0) 6 days ago nginx-server
0e03778e7ac3 ubuntu "/bin/bash" 2 weeks ago Exited (129) 2 weeks ago crazy_golick
f3e968633e3f debian "bash" 2 weeks ago Exited (255) 6 days ago debian-repo
10706b425200 ipfs/go-ipfs "/sbin/tini -- /usr/…" 3 weeks ago Exited (255) 2 weeks ago 0.0.0.0:4001->4001/tcp, 0.0.0.0:5001->5001/tcp, 4001/udp, 0.0.0.0:8080->8080/tcp, 8081/tcp ipfs_host
```

### 2. Pull Latest Ubuntu Image
Command:
```bash
docker pull ubuntu:latest
```
Output:
```
latest: Pulling from library/ubuntu
6e59cb05818e: Pull complete
Digest: sha256:dfc10878be8d8fc9c61cbff33166cb1d1fe44391539243703c72766894fa834a
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest
```

### 3. Run Container
Command:
```bash
docker run -it --name ubuntu_container ubuntu:latest
```
Details: Exited the container and returned to the host terminal to execute further commands.

### 4. Remove Image
Commands:
```bash
docker stop ubuntu_container
docker rm ubuntu_container
docker rmi ubuntu:latest
```
Outcome: Image removed successfully.

---

## Task 2: Image and Container Operations

### 1. Create Image Archive
Command:
```bash
docker save -o ubuntu_image.tar ubuntu:latest
```
Output: `ls -lh ubuntu_image.tar` shows:
```
-rw------- 1 arseny0304 staff 98M Sep 26 16:42 ubuntu_image.tar
```
The original image size was around 101MB, but the archive file might be slightly smaller due to compression.

### 2. Run Nginx Container
Command:
```bash
docker run -d -p 80:80 --name nginx_container nginx
```
Verification using `curl http://127.0.0.1` showed the default Nginx welcome page.

### 3. Create HTML File and Copy to Container
Created `index.html` with the required content, then copied it to the container:
```bash
docker cp index.html nginx_container:/usr/share/nginx/html/index.html
```
Verification using `curl http://127.0.0.1` showed the updated webpage content:
```html
<html>
<head>
<title>The best</title>
</head>
<body>
<h1>website</h1>
</body>
</html>
```

### 4. Create Custom Image
Command:
```bash
docker commit nginx_container my_website:latest
```
Output:
```
sha256:06e22ad38d229d6ac8468acbef77810cf6252b29a8b7808f6636cad32799c55d
```

### 5. Remove Original Container
Commands:
```bash
docker stop nginx_container
docker rm nginx_container
```
Outcome: Successfully removed the original container.

### 6. Create New Container Using Custom Image
Command:
```bash
docker run -d -p 80:80 --name my_website_container my_website:latest
```
Verification using `curl http://127.0.0.1` displayed the correct HTML content.

### 7. Analyze Image Changes
Command:
```bash
docker diff my_website_container
```
Output:
```
C /etc
C /etc/nginx
C /etc/nginx/conf.d
C /etc/nginx/conf.d/default.conf
C /run
C /run/nginx.pid
```
Explanation: The `C` (changed) indicates changes in the configuration files and runtime data for Nginx.

---

### Conclusion

All tasks have been completed successfully, and the custom web server is running correctly using the Docker container.
Binary file added vm_running.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.