Bash BASH monitoring server and alert in Telegram These actions are intended to set up quick server monitoring without launching any separate monitoring. Create folder: mkdir /usr/local/tamagent Create file tamagent.sh: nano /usr/local/tamagent/tamagent.sh Write the script in the file: #!/bin/bash ######################### #GLOBAL VARIABLES ID_USER="XXXXXXX" # ID USER in TELEGRAM
cPanel cPanel. Raising the virus scanner AiBolit The goal was to allow clients to scan their sites for malicious code. The scanner used was the Ai-Bolit fort scanner, which can be found at the link: https://github.com/rorry47/ai-bolit.git First of all, let's create a folder on the server: mkdir /usr/local/cpanel/
Linux Install and settings WireGuard for Debian 11 WireGuard can be used on a variety of operating systems, including Linux, macOS, Windows, and Android. This makes it a versatile solution for users who want to protect their privacy and security when using the internet. WireGuard can be used to secure communication between remote locations, to connect to a
Web Check website for viruses with Ai-Bolit To check the site for viruses, there is a console utility AI-Bolit. To check, we must go to the console and download the utility from the repository. Since the company that developed the utility has already closed, I had to save the source for myself, so we execute the following
Linux Get a free Lets Encrypt certificate via acme.sh We will use the acme.sh console utility to install the certificate. The official repository is located here: https://github.com/acmesh-official/acme.sh Installation is very simple, use the command: curl https://get.acme.sh | sh Next, to get a certificate, use the command: acme.sh --issue --server letsencrypt
MySQL Simple MySQL Queries This note may be useful for those who are just starting to use the MySQL. Everything happens for the first time. For example, you got a job, or wanted to work in a project where this system was used. Reading manuals is of course helpful. But the return on reading
Python Simple Python Script to Distort Images The script itself looks like this: import numpy as np from PIL import Image def quad_as_rect(quad): if quad[0] != quad[2]: return False if quad[1] != quad[7]: return False if quad[4] != quad[6]: return False if quad[3] != quad[5]: return False return True def
CSS Adding Noise to Elements To add noise to a page or elements, use the following javascript code: const noise = () => { let canvas, ctx; let wWidth, wHeight; let noiseData = []; let frame = 0; let loopTimeout; // Create Noise const createNoise = () => { const idata = ctx.createImageData(wWidth, wHeight); const buffer32 = new Uint32Array(idata.data.buffer); const len = buffer32.
Linux Update Root Certificate | “server certificate verification failed” error When upgrading packages on non-upgraded systems, an error can sometimes occur if old certificates are present: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt To renew certificates, do the following:. Centos: Install if not: yum install ca-certificates And update: update-ca-trust force-enable Ubuntu\Debian: Reconfiguring certificates: dpkg-reconfigure ca-certificates Uncheck
RoundCube RoundCube – Enable recapcha on login We connect to the console and go to the folder with attachments in roundcube: cd ../plugins/ Cloning the google captcha plugin repository: git clone https://github.com/dsoares/rcguard.git rcguard Don’t forget to set the correct owner and user, for example: chown -R www-data:www-data rcguard Go to
API-s Telegram chat bot without libraries in PHP First, let’s write the main code that will determine the sending and receiving of requests from the telegram servers: <?php $data = file_get_contents('php://input'); $data = json_decode($data, true); if (empty($data['message']['chat']['id'])) { exit(); } define('
WordPress – several domains for the site In order to make a site on WordPress pratsyuvav on a number of domains. write in wp-config next code: $array[0] = array( 'domain1.com', 'domain2.com', 'domain3.com', 'domain4.com', ); if (array_intersect(explode(' ', $_SERVER['HTTP_HOST']), $array[
Linux Fix mail on Ubuntu – VestaCP When installing VestaCP on Ubuntu, mail errors may occur. For example: * Unsuccessful connection to IMAP server * Invalid HELO name * AUTHENTICATE LOGIN: in /usr/share/roundcube/program/lib/Roundcube/rcube_imap.php .. * Initialization failed: namespace configuration error: inbox=yes namespace missing The first step is to repair the RoundCube. Go to
NGINX Nginx – file path encryption There was a task to set up encryption in the links of paths to media files for placing movies on the site. We use nginx for this: rewrite /([a-zA-Z0-9_\-]+)/([0-9]+)/(.+)\.mp4$ /$3.mp4?md5=$1&time=$2; location / { secure_link $arg_md5,$arg_time; secure_link_md5 SECRET_
MySQL Create MySQL Database Connect to the MySQL server from the command line as root: mysql -u root -p Create MySQL Database Use the following syntax to create a database in MySQL: CREATE DATABASE name_base; Create a new user: GRANT ALL PRIVILEGES ON name_base.* TO name_user@localhost IDENTIFIED BY 'PASSWORD&
Bash Example bash script fro status server and website Here is an example of a simple bash script that can be used to check the status of a server: #!/bin/bash # Define the server address server=http://example.com # Use the curl command to check the server's HTTP response code response=$(curl -s -o /dev/null -w