SShortSingh.
Back to feed

How to Run a Telegram Bot 24/7 on a VPS with systemd Auto-Restart

0
·6 views

A guide explains how to keep a Telegram bot running continuously on a virtual private server instead of a laptop that may sleep. The setup uses Ubuntu 22.04 or 24.04 with a dedicated non-root user, a Python virtual environment, and a token stored in a restricted environment file. A systemd service configured with Restart=always and a five-second delay ensures the bot restarts after crashes or server reboots. The article also covers monitoring logs with journalctl, deploying updates, and choosing between long polling and webhooks. It warns against common mistakes such as running as root, hard-coding tokens, and running duplicate bot instances.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

macOS Git Trusts Compromised eMudhra Certificates, Here's How to Remove Them

Apple's bundled git on macOS can still trust compromised eMudhra certificates, which may let automated builds accept revoked identities. The guide explains that macOS git reads certificates from the system keychain rather than OpenSSL defaults, so revoked certificates remain valid if they stay in the keychain. It provides commands to detect eMudhra certificates, delete them by SHA-256 fingerprint, and confirm the trust chain is clean. It also recommends adding a CI check that fails builds if the certificates reappear, and notes checking user keychains, Homebrew git configuration, and cached TLS sessions.

0
ProgrammingDEV Community ·

Building a Node.js Voice Assistant with ElevenLabs Text-to-Speech

A DEV Community tutorial walks developers through creating a command-line voice assistant using Node.js and the ElevenLabs API. The assistant accepts typed queries, forwards them to an LLM such as OpenAI's ChatGPT for a reply, converts that reply into speech, and plays the audio back. The guide explains the prerequisites, including Node.js 18 or later, API keys, and optionally ffmpeg for audio playback. It also covers project setup, storing credentials in a .env file, and a lightweight text-to-speech wrapper that saves the output as an MP3. The article notes that ElevenLabs also supports voice cloning using a short audio sample.

0
ProgrammingDEV Community ·

Build an n8n Watchdog That Alerts When a Workflow Never Runs

n8n's Error Trigger only catches failed runs, so a workflow that never starts, due to a dead cron, changed webhook URL, or deactivation after an edit, goes unnoticed. The article proposes a dead-man's switch: a separate watchdog workflow that runs hourly and checks the monitored workflow's execution history via the n8n Public API. It classifies the workflow as overdue if no runs exist or the latest run is older than a configurable threshold, and sends a Gmail alert only in that case. Setup requires an n8n API key, the target workflow ID, a threshold set to roughly twice its expected interval, and Gmail OAuth2 credentials. The author reports testing the detection logic on a local n8n instance but says email delivery still needs to be confirmed by running a test alert.

0
ProgrammingHacker News ·

Developer says Claude Code uncovered 145,000 deleted iPhone photos stored in a hidden cache

A user reported on social media that Claude Code, Anthropic's AI coding tool, located roughly 145,000 photos they had deleted from their iPhone. According to the post, the images were still sitting in a hidden cache on the device rather than being fully removed. The report was shared on Hacker News, where it received 4 points and no comments at the time of listing. The source material is a brief link post, so the exact cause of the retained files and the details of the discovery process are not described in the available text.