From f73e61f31afcf5b1dcec951d1386c002615955c2 Mon Sep 17 00:00:00 2001 From: Ihar Hancharenka Date: Wed, 11 Jun 2025 08:43:05 +0300 Subject: [PATCH] m --- .../clubs/streetoftruth/fiveyskaya.txt | 2 ++ os/shells/io/descriptors.txt | 23 +++++++++++++++++++ os/shells/{ => io}/pipe/dt.txt | 0 3 files changed, 25 insertions(+) create mode 100644 os/shells/io/descriptors.txt rename os/shells/{ => io}/pipe/dt.txt (100%) diff --git a/nontech/politics/clubs/streetoftruth/fiveyskaya.txt b/nontech/politics/clubs/streetoftruth/fiveyskaya.txt index cf2e7d707..453beb83d 100644 --- a/nontech/politics/clubs/streetoftruth/fiveyskaya.txt +++ b/nontech/politics/clubs/streetoftruth/fiveyskaya.txt @@ -2,6 +2,8 @@ Maria Gennadievna Dean of Historically - Political Faculty 2025 +InRPC - Fiveyskaya - Managers should always consider Mobilisation Component of 10:25 + https://www.youtube.com/watch?v=XlAQ12jHnDA InRPC - Dobrovolskaya - Fiveyskaya - We are Collective First Comonaut of 49:11 https://www.youtube.com/watch?v=ozoPN8XC6mA InRPC - Dobrovolskaya - Fiveyskaya - Here you've got People to Talk to of 38:37 diff --git a/os/shells/io/descriptors.txt b/os/shells/io/descriptors.txt new file mode 100644 index 000000000..b7e6675a5 --- /dev/null +++ b/os/shells/io/descriptors.txt @@ -0,0 +1,23 @@ +2024 +https://rednafi.com/misc/http_requests_via_dev_tcp/ + learned this neat Bash trick today where you can make a raw HTTP request using the /dev/tcp file descriptor without using tools like curl or wget. This came in handy while writing a health check script that needed to make a TCP request to a service. + +The following script opens a TCP connection and makes a simple GET request to example.com: + +#!/bin/bash + +# Open a TCP connection to example.com on port 80 and assign file descriptor 3 +# The exec command keeps /dev/fd/3 open throughout the lifetime of the script +# 3<> enables bidirectional read-write +exec 3<>/dev/tcp/example.com/80 + +# Send the HTTP GET request to the server +# >& redirects stdout to /dev/fd/3 +echo -e "GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n" >&3 + +# Read and print the server's response +# <& redirects the output of /dev/fd/3 to cat +cat <&3 + +# Close the file descriptor, terminating the TCP connection +exec 3>&- diff --git a/os/shells/pipe/dt.txt b/os/shells/io/pipe/dt.txt similarity index 100% rename from os/shells/pipe/dt.txt rename to os/shells/io/pipe/dt.txt