From 4b3d0b9974cc6b5357cb2b5bfa3635d3240e3951 Mon Sep 17 00:00:00 2001 From: Long1TaiL Date: Fri, 5 Jun 2026 21:35:31 +0300 Subject: [PATCH 1/7] docs: add PR template Signed-off-by: Long1TaiL --- .github/pull_request_template.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..1a68db5e5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +## Goal + + +## Changes +- + +## Testing + + +## Checklist +- [ ] Title is a clear sentence (≤ 70 chars) +- [ ] Commits are signed (`git log --show-signature`) +- [ ] `submissions/labN.md` updated From 492d4ec442b232f29367af65ce208fbb3db135bd Mon Sep 17 00:00:00 2001 From: Long1TaiL Date: Sun, 7 Jun 2026 15:01:43 +0300 Subject: [PATCH 2/7] docs: add PR template Signed-off-by: Long1TaiL --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1a68db5e5..91a458a06 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,6 +8,6 @@ ## Checklist -- [ ] Title is a clear sentence (≤ 70 chars) -- [ ] Commits are signed (`git log --show-signature`) -- [ ] `submissions/labN.md` updated +- [x] Title is a clear sentence (≤ 70 chars) +- [x] Commits are signed (`git log --show-signature`) +- [x] `submissions/labN.md` updated From 82d4bf64055a3e2ac63e457118b56048e2d5b841 Mon Sep 17 00:00:00 2001 From: Long1TaiL Date: Sun, 7 Jun 2026 18:00:16 +0300 Subject: [PATCH 3/7] test: unsigned commit (should fail) Signed-off-by: Long1TaiL From e74f9ee679e546b734846cf659a43188e28b395f Mon Sep 17 00:00:00 2001 From: Long1TaiL Date: Sun, 7 Jun 2026 20:53:44 +0300 Subject: [PATCH 4/7] docs(lab1): pull request template completed Signed-off-by: Long1TaiL --- .github/pull_request_template.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 91a458a06..8c55e7441 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,11 +1,14 @@ ## Goal - +To submit tasks from lab1 ## Changes -- +submissions/lab1.md and a pull request template were added ## Testing - + +QuickNotes runs locally +git log --show-signature demonstrates verified commits +main branch requires a verification ## Checklist - [x] Title is a clear sentence (≤ 70 chars) From 29bcd5e089cca878537b130c6889eb3c72c92a9e Mon Sep 17 00:00:00 2001 From: Long1TaiL Date: Mon, 8 Jun 2026 20:53:39 +0300 Subject: [PATCH 5/7] docs: upstream moved while you worked Signed-off-by: Long1TaiL From 73492d1de270654121b3cfe39fa4d7c0d50acffd Mon Sep 17 00:00:00 2001 From: Long1TaiL Date: Wed, 10 Jun 2026 22:43:11 +0300 Subject: [PATCH 6/7] docs(personal changes): Returned empty pull request template Signed-off-by: Long1TaiL --- .github/pull_request_template.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8c55e7441..de63a0f6c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,16 +1,13 @@ ## Goal -To submit tasks from lab1 + ## Changes -submissions/lab1.md and a pull request template were added +- ## Testing - -QuickNotes runs locally -git log --show-signature demonstrates verified commits -main branch requires a verification + ## Checklist -- [x] Title is a clear sentence (≤ 70 chars) -- [x] Commits are signed (`git log --show-signature`) -- [x] `submissions/labN.md` updated +- [ ] Title is a clear sentence (≤ 70 chars) +- [ ] Commits are signed (`git log --show-signature`) +- [ ] `submissions/labN.md` updated \ No newline at end of file From a4c8daf1ad3d7e5abe60198a406de4eab266d328 Mon Sep 17 00:00:00 2001 From: Long1TaiL Date: Tue, 16 Jun 2026 23:30:18 +0300 Subject: [PATCH 7/7] lab4: done Signed-off-by: Long1TaiL --- submissions/lab4.md | 154 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 submissions/lab4.md diff --git a/submissions/lab4.md b/submissions/lab4.md new file mode 100644 index 000000000..71ea3694f --- /dev/null +++ b/submissions/lab4.md @@ -0,0 +1,154 @@ +# Lab 4 submission + +### TCP Handshake (SYN -> SYN,ACK -> ACK): + +``` +22:33:46.570258 IP6 ::1.52782 > ::1.8080: Flags [S], seq 284201099, win 65476, options [mss 65476,sackOK,TS val 2276206117 ecr 0,nop,wscale 10], length 0 +`....(.@.................................................0......... +..&%....... + +22:33:46.570285 IP6 ::1.8080 > ::1.52782: Flags [S.], seq 2388979400, ack 284201100, win 65464, options [mss 65476,sackOK,TS val 2618398189 ecr 2276206117,nop,wscale 10], length 0 +` +.'.(.@.....................................d...........0......... +......&%... + +22:33:46.570305 IP6 ::1.52782 > ::1.8080: Flags [.], ack 1, win 64, options [nop,nop,TS val 2276206117 ecr 2618398189], length 0 +`.... .@.........................................d.....@.(..... +..&%.... +``` + +### HTTP Request + (HTTP POST -> Server ACK): + +``` +22:33:46.570448 IP6 ::1.52782 > ::1.8080: Flags [P.], seq 1:176, ack 1, win 64, options [nop,nop,TS val 2276206117 ecr 2618398189], length 175: HTTP: POST /notes HTTP/1.1 +`......@.........................................d.....@....... +..&%....POST /notes HTTP/1.1 +Host: localhost:8080 +User-Agent: curl/8.20.0 +Accept: */* +Content-Type: application/json +Content-Length: 39 + +{"title":"trace me","body":"in flight"} +22:33:46.570462 IP6 ::1.8080 > ::1.52782: Flags [.], ack 176, win 64, options [nop,nop,TS val 2618398189 ecr 2276206117], length 0 +` +.'. .@.....................................d.....;...@.(..... +......&% +22:33:46.570917 IP6 ::1.8080 > ::1.52782: Flags [P.], seq 1:207, ack 176, win 64, options [nop,nop,TS val 2618398190 ecr 2276206117], length 206: HTTP: HTTP/1.1 201 Created +` +.'...@.....................................d.....;...@....... +......&%HTTP/1.1 201 Created +Content-Type: application/json +Date: Tue, 16 Jun 2026 19:33:46 GMT +Content-Length: 93 + +{"id":7,"title":"trace me","body":"in flight","created_at":"2026-06-16T19:33:46.570565538Z"} +``` + +### Connection close (FIN->FIN,ACK->ACK) +``` +22:33:46.570930 IP6 ::1.52782 > ::1.8080: Flags [.], ack 207, win 64, options [nop,nop,TS val 2276206118 ecr 2618398190], length 0 +`.... .@.......................................;.d.....@.(..... +..&&.... +22:33:46.571020 IP6 ::1.52782 > ::1.8080: Flags [F.], seq 176, ack 207, win 64, options [nop,nop,TS val 2276206118 ecr 2618398190], length 0 +`.... .@.......................................;.d.....@.(..... +..&&.... +22:33:46.571050 IP6 ::1.8080 > ::1.52782: Flags [F.], seq 207, ack 177, win 64, options [nop,nop,TS val 2618398190 ecr 2276206118], length 0 +` +.'. .@.....................................d.....<...@.(..... +......&& +22:33:46.571067 IP6 ::1.52782 > ::1.8080: Flags [.], ack 208, win 64, options [nop,nop,TS val 2276206118 ecr 2618398190], length 0 +`.... .@.......................................<.d.....@.(..... +..&&.... +``` + +## Debug commands + +``` +$ ss -tlnp | grep :8080 +LISTEN 0 4096 *:8080 *:* users:(("quicknotes",pid=12601,fd=3)) +``` + +``` +$ ip route show +0.0.0.0/1 dev amn0 metric 1 +default via 192.168.0.1 dev eno1 proto dhcp src 192.168.0.100 metric 1002 +default via 10.91.80.1 dev wlan0 proto dhcp src 10.91.86.43 metric 3004 +10.91.80.0/20 dev wlan0 proto dhcp scope link src 10.91.86.43 metric 3004 +31.172.78.99 via 192.168.0.1 dev eno1 +128.0.0.0/1 dev amn0 metric 1 +172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown +172.18.0.0/16 dev br-bcc608ebbdf4 proto kernel scope link src 172.18.0.1 linkdown +172.19.0.0/16 dev br-2f04123ec594 proto kernel scope link src 172.19.0.1 linkdown +172.20.0.0/16 dev br-204ddeb962fd proto kernel scope link src 172.20.0.1 linkdown +172.21.0.0/16 dev br-507a46b4b473 proto kernel scope link src 172.21.0.1 linkdown +185.27.192.209 via 192.168.0.1 dev eno1 +188.130.155.215 via 192.168.0.1 dev eno1 +188.130.155.243 via 192.168.0.1 dev eno1 +188.130.155.250 via 192.168.0.1 dev eno1 +192.168.0.0/24 dev eno1 proto dhcp scope link src 192.168.0.100 metric 1002 +``` + +``` +$ mtr -rwc 5 localhost +Start: 2026-06-16T22:42:19+0300 +HOST: Long1Tail Loss% Snt Last Avg Best Wrst StDev + 1.|-- localhost 0.0% 5 0.1 0.1 0.1 0.1 0.0 +``` + +``` +$ dig +short example.com @1.1.1.1 +172.66.147.243 +104.20.23.154 +``` + +``` +$ journalctl --user -u quicknotes -n 20 || true +-- No entries -- +``` + +## What would I do if QuickNotes shows 502 error? + +Well, firstly, i'll check logs in, for example, journalctl. Next I'll run `ss -tulpn | grep `, tracepath `` and do some testing via `dig` + +## Task 2 + +``` +ps -ef | grep quicknotes +long1ta+ 13357 13314 0 23:02 pts/1 00:00:00 /home/long1tail/.cache/go-build/d2/d2669b388084fca57ad8bc2e16f3aebe315b928221e2267b472e0af203e794e6-d/quicknotes +long1ta+ 13440 12297 0 23:03 pts/1 00:00:00 grep --color=auto quicknotes +``` + +I have 2 instanses running. Let's check, wich one of them listens on port + +``` +ss -tlnp | grep 8080 +LISTEN 0 4096 *:8080 *:* users:(("quicknotes",pid=13357,fd=3)) +``` + +As we can see, PID of listenning process is the PID of first running instance. Let's check if the service is available. + +``` +curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8080/health +200 +``` + +Ok, servise looks available. let's check the bariers + +``` +sudo iptables -L -n -v 2>/dev/null || sudo nft list ruleset 2>/dev/null || true +``` +I can't provide it's output because It contains a lot of of notes about my vpn server and it may cause vurnalabilities and private data leakage + +``` +dig +short localhost +127.0.0.1 +``` + +DNS is ok + + +Summary +I run a second QuickNotes instance on port 8080 failed because the port was already in use by the primary running instance. The deployment process does not verify whether the target port is already occupied. Since the application uses a fixed port configuration, concurrent launches can cause port conflicts. + +I can prevent such problems via docker usage and running by systemd \ No newline at end of file