TRACK 04 / OSWORK

Operation

Take a computer routine to supervised service.

0% 0 of 0
01 / OSWORKTelegram as work interface02 / OSWORKVPS from scratch and 24/7operation03 / OSWORKPRACTICE04 / OSWORKCHECK
Read, apply to a small task and check the result before moving on.
2 modules
12 topics
110 min with practice
Guided step by step

Track map

4.1 ~50 min

🧭 Telegram as work interface

Run a restricted query bot and understand where AI comes in.

4.2 ~60 min

🧭 VPS from scratch and 24/7 operation

Prepare a deployment plan, monitoring, backup and service verification.

Detailed content

MODULE 4.1

Telegram as work interface

Run a restricted query bot and understand where AI comes in.

0% 0 of 0

What it is

A bot receives messages via the Telegram API and returns responses. Intelligence can come from rules, a program, or a model call. The mobile app does not execute its tasks on the server by itself: there is an intermediate program with defined permissions.

Why learn

Separating interface and execution avoids calling any automatic response an intelligent agent. First build a reliable path to receive and reply; then connect the needed capability.

Key concepts

Message; Bot API; program; agent; result.

What it is

In Telegram, find the official BotFather and use /newbot. Choose a name and identifier as shown in the instructions. The generated token authenticates your program with Telegram. Store it as TELEGRAM_BOT_TOKEN in a private file; the kit only contains example values.

Why learn

Anyone who controls the token can operate the bot. Screenshots of the process and URLs containing the token can leak access. If exposed, revoke the token in BotFather before continuing.

Key concepts

BotFather; token; environment variable; rotation.

What it is

The kit bot only accepts private chats and configured IDs. It also accepts only known commands. Verifying the ID is different from checking the visible name: names can change. A message from an unknown user should not trigger file reads or system commands.

Why learn

A bot found on the internet may receive unexpected messages. Program authentication with a token does not mean authorization for anyone who talks to it. These are separate controls.

Key concepts

Numeric ID; access list; private chat; fixed commands.

What it is

Long polling is the program asking Telegram for messages and waiting a bit when there are no new ones. It is simple to learn and does not require opening a public inbound port. Webhook is another strategy, where Telegram calls your HTTPS address; it is not needed in this lab.

Why learn

Choosing a single mode reduces configuration problems. Keep only one instance fetching messages for a bot: duplicate processes can compete for updates.

Key concepts

getUpdates; offset; timeout; single instance; outbound access.

What it is

The kit deliberately separates transport and work functions. It starts deterministic: status and report of fake data. To attach AI, define a function with limited input, timeout, output ceiling, and review. Do not expose codex exec directly to public messages nor disable protections to make it work.

Why learn

A predictable program allows testing the base without spending API. Then you assess whether AI improves interpretation, summarization, or classification and measure the result against a known reference.

Key concepts

Domain function; limits; timeout; review; minimal data.

What it is

Test allowed sender, blocked, group, unknown command, and missing data. Logs should report the type of failure and timestamp, without the token or full private messages. In the lab, stopping the process should halt responses: this proves the local program is on the path.

Why learn

A correct response does not prove the bot is restricted nor that it retrieves the network. A small set of scenarios demonstrates the important properties before migrating to a VPS.

Key concepts

Self‑test; network failure; logs without secrets; interruption; diagnosis.

View full →

MODULE 4.2

VPS from scratch and 24/7 operation

Prepare a deployment plan, monitoring, backup and service verification.

0% 0 of 0

What it is

A VPS is a rented virtual server: a remote computer with memory, disk, and network. You manage users, updates, and processes. Start with a small machine compatible with the application; do not rent a GPU just to call a model via API. The remote model runs on the provider’s infrastructure.

Why learn

A powered‑on machine does not mean a healthy service. VPS, storage, and API costs are separate. Before hiring, define what needs to run continuously and who will monitor incidents.

Key concepts

Remote server; resources; recurring cost; operational responsibility.

What it is

SSH creates a protected connection to manage the machine. Use the registered public key as per the provider and verify the server's identity. Create a work user with administrative permissions when needed. Keep the original session open while testing a second connection.

Why learn

Changing the firewall or authentication without testing a recovery route can lock you out. The provider's console is the fallback when the normal connection fails; verify that it works before restricting the network.

Key concepts

Public key; fingerprint; user; sudo; recovery.

What it is

The lab examples use Ubuntu with apt. Update the package list and review the proposed upgrade. The base bot requires Python 3; Git helps transfer the project. Node, Docker, and Codex are optional depending on the application, not a mandatory list for any VPS.

Why learn

Each dependency adds maintenance. A simple service with few components is easier to explain, update, and recover. Installing tools out of habit creates work without increasing the needed capacity.

Key concepts

apt update; apt upgrade; dependency; virtual environment when needed.

What it is

The firewall filters network connections. For long polling, the bot needs to go out to HTTPS; it does not need to expose a bot port to the internet. Before enabling UFW, open the actually used SSH port and check local and provider rules. Restrict the .env with chmod 600 and keep it out of Git.

Why learn

Opening all ports to “make it work” increases risk without diagnosing the cause. If the process does not respond, outbound network, token, and execution each deserve separate checks.

Key concepts

Input and output; SSH port; firewall rule; file permissions.

What it is

systemd is the service manager for many Linux distributions. A unit describes which program to start, with which user and in which directory. Restart=on-failure restarts after a failure, but does not fix a persistent error. The kit provides a parametrized unit for the oswork user.

Why learn

Running the bot in an SSH session may terminate the job when the connection closes. Supervision allows it to restart with the machine and centralize logs. It does not replace alerts, limits, or root‑cause analysis.

Key concepts

Unit; service user; directory; restart; journal.

What it is

Continuous operation combines supervision, updating, monitoring, backups, and tested restoration. Make copies of data outside the machine, protect credentials, and set retention. A backup is only validated when you restore a copy and verify its contents.

Why learn

Without monitoring, a service can stay down for days. Without restoration testing, the copy may be incomplete. The real promise is a recoverable routine, not an infallible machine.

Key concepts

External check; logs; backup off the VPS; restoration; spending limit.

View full →
Full module