diff --git a/content/en/linux-lifehacks/how-to-create-lvm-logical-volume.md b/content/en/linux-lifehacks/how-to-create-lvm-logical-volume.md index aecf9f2..3776117 100644 --- a/content/en/linux-lifehacks/how-to-create-lvm-logical-volume.md +++ b/content/en/linux-lifehacks/how-to-create-lvm-logical-volume.md @@ -4,13 +4,14 @@ category: linux-lifehacks filename: how-to-create-lvm-logical-volume date: 2022-05-15 --- +This article describes how to create an LVM group and volume for a physical disk in the Linux operating system. + ### First step: creating a physical volume After you have attached the disk to a physical server or virtual machine, you need to type this command: ```bash sudo fdisk -l ``` - to make sure the drive is recognized by the operating system, and to identify the drive name. Output of command will be something like this: ```plaintext diff --git a/content/en/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md b/content/en/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md index e3809a9..af3668a 100644 --- a/content/en/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md +++ b/content/en/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md @@ -4,8 +4,9 @@ category: linux-lifehacks filename: how-to-extend-lvm-volume-on-linux date: 2022-05-15 --- +This article describes how to expand an LVM group and volume on a Linux operating system. + ### Situation 1: new disk - #### First step: creating a physical volume After you have attached the disk to a physical server or virtual machine, you need to type command: @@ -14,8 +15,6 @@ After you have attached the disk to a physical server or virtual machine, you ne sudo fdisk -l ``` - - This is to make sure the drive is recognized by the operating system, and to identify the drive name. Output of the command will be something like this: ```plaintext diff --git a/content/en/linux-lifehacks/linux-monitoring-with-telegram-alerts.md b/content/en/linux-lifehacks/linux-monitoring-with-telegram-alerts.md index e955186..f04d432 100644 --- a/content/en/linux-lifehacks/linux-monitoring-with-telegram-alerts.md +++ b/content/en/linux-lifehacks/linux-monitoring-with-telegram-alerts.md @@ -5,6 +5,7 @@ filename: linux-monitoring-with-telegram-alerts date: 2023-03-04 --- This article describes how to set up monitoring with alerts to Telegram using Grafana, Prometheus, Alertmanager, Node-exporter and Cadvisor. + ### First step: Cloning the repository Log in to the server or go to local terminal and run the following commands: ```bash @@ -12,7 +13,6 @@ git clone https://github.com/digitalstudium/grafana-docker-stack.git cd grafana-docker-stack git checkout alertmanager ``` - ### Second step: setting the external address of the server Open the `docker-compose.yml` file and on lines 22 and 38 change the address `127.0.0.1` to the address of the server where you want to install Prometheus. ### Third step: creating a bot in Telegram diff --git a/content/en/python-lifehacks/how-to-easily-write-linux-cli-tool.md b/content/en/python-lifehacks/how-to-easily-write-linux-cli-tool.md index 4ea5a49..10a0fd0 100644 --- a/content/en/python-lifehacks/how-to-easily-write-linux-cli-tool.md +++ b/content/en/python-lifehacks/how-to-easily-write-linux-cli-tool.md @@ -6,13 +6,13 @@ date: 2023-04-09 --- I want to share the easiest way I know to write a CLI tool for Linux administration using python and Fire. + ## Step 1: Install Fire ```bash pip install fire ``` ## Step 2. Create a simple CLI tool Here is an example of a CLI tool that prints the Linux version to the terminal: - ```python #!/usr/bin/env python3 import fire diff --git a/content/en/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md b/content/en/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md index 4889f05..f097422 100644 --- a/content/en/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md +++ b/content/en/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md @@ -4,11 +4,16 @@ category: python-lifehacks filename: how-to-load-multiple-web-pages-in-parallel-using-python date: 2022-05-15 --- +This article describes how to load the content of multiple web pages from multiple urls in parallel with python. + +## Step 1. Installation of aiohttp First you need to install an aiohttp package. To install aiohttp run the command: ```bash pip install aiohttp[speedups] -``` -The `[speedups]` suffix is needed to install aiohttp accelerating packages - aiodns and cchardet. Then create a main.py file with this code: +``` +The `[speedups]` suffix is needed to install aiohttp accelerating packages - aiodns and cchardet. +## Step 2. Creation of a script +Then create a main.py file with this code: ```python import aiohttp import asyncio diff --git a/content/en/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md b/content/en/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md index 9ce7455..9c078a9 100644 --- a/content/en/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md +++ b/content/en/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md @@ -4,11 +4,13 @@ category: ubuntu-lifehacks filename: ubuntu-how-to-upgrade-kernel date: 2022-05-14 --- +This article describes how to upgrade Linux kernel on Ubuntu operating system via command line interface. + +``` ### First method The first method is very simple. We need to enter only one command in the terminal: ```bash sudo apt update && sudo apt -y upgrade -``` The `sudo apt update` command will update the repository cache, and the `sudo apt -y upgrade` command will install new versions of all installed programs, including the linux kernel. The advantage of this method is that the latest version of the linux kernel, officially supported by Ubuntu OS, will be installed. The disadvantage of this method is that the officially supported kernel is usually not the newest. Sometimes it happens that it is necessary to install the latest version of the linux kernel. Real world example: your new laptop may have a CPU which is only supported in linux kernel version 5.12, while the officially supported version is older. And here the second method comes to the rescue. ### Second method The first step is to go to https://kernel.ubuntu.com/~kernel-ppa/mainline/. On this site, you need to select the folder with the latest version of the linux kernel (at the very bottom of the page). Note that it is recommended to select the version without the "rc" suffix. The "rc" suffix means "release candidate", which in turn means that the given kernel version is not stable. On the page that opens, select the folder with the architecture of your processor. The architecture can be found using the `uname -p` command. If the output of this command is "x86_64", then select the amd64 folder. On the opened page there will be links to .deb files. We need to download 4 of them: diff --git a/content/ru/linux-lifehacks/how-to-create-lvm-logical-volume.md b/content/ru/linux-lifehacks/how-to-create-lvm-logical-volume.md index 51f59ad..f9f09f5 100644 --- a/content/ru/linux-lifehacks/how-to-create-lvm-logical-volume.md +++ b/content/ru/linux-lifehacks/how-to-create-lvm-logical-volume.md @@ -4,13 +4,14 @@ category: linux-lifehacks filename: how-to-create-lvm-logical-volume date: 2022-05-15 --- +В этой статье описывается, как создать группу LVM и том для физического диска в операционной системе Linux. + ### Первый шаг: создание физического тома После того, как вы присоединили диск к физическому серверу или к виртуальной машине, вам нужно набрать команду: ```bash sudo fdisk -l ``` - чтобы убедиться, что диск распознан операционной системой, а также чтобы идентифицировать имя диска. Вывод команды будет примерно такой: ```plaintext diff --git a/content/ru/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md b/content/ru/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md index e5f786f..e95dc37 100644 --- a/content/ru/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md +++ b/content/ru/linux-lifehacks/how-to-extend-lvm-volume-on-linux.md @@ -4,8 +4,9 @@ category: linux-lifehacks filename: how-to-extend-lvm-volume-on-linux date: 2022-05-15 --- +В этой статье описывается, как расширить группу LVM и том в операционной системе Linux. + ### Ситуация 1: новый диск - #### Первый шаг: создание физического тома После того, как вы присоединили диск к физическому серверу или к виртуальной машине, вам нужно набрать команду: @@ -14,8 +15,6 @@ date: 2022-05-15 sudo fdisk -l ``` - - Это нужно, чтобы убедиться, что диск распознан операционной системой, а также чтобы идентифицировать имя диска. Вывод команды будет примерно такой: ```plaintext diff --git a/content/ru/linux-lifehacks/linux-monitoring-with-telegram-alerts.md b/content/ru/linux-lifehacks/linux-monitoring-with-telegram-alerts.md index 478cc8c..a5eea64 100644 --- a/content/ru/linux-lifehacks/linux-monitoring-with-telegram-alerts.md +++ b/content/ru/linux-lifehacks/linux-monitoring-with-telegram-alerts.md @@ -5,6 +5,7 @@ filename: linux-monitoring-with-telegram-alerts date: 2023-03-04 --- В статье описывается, как настроить мониторинг с уведомлениями в Telergram с помощью Grafana, Prometheus, Alertmanager, Node-exporter и Cadvisor. + ### Первый шаг: Клонирование репозитория Зайдите на сервер или в локальный терминал и выполните следующие команды: ```bash @@ -12,7 +13,6 @@ git clone https://github.com/digitalstudium/grafana-docker-stack.git cd grafana-docker-stack git checkout alertmanager ``` - ### Второй шаг: установка внешнего адреса сервера Откройте файл `docker-compose.yml` и в строках 22 и 38 измените адрес `127.0.0.1` на адрес того сервера, на котором вы хотите установить Prometheus. ### Третий шаг: создание бота в Telegram diff --git a/content/ru/python-lifehacks/how-to-easily-write-linux-cli-tool.md b/content/ru/python-lifehacks/how-to-easily-write-linux-cli-tool.md index 42d0940..6e01db9 100644 --- a/content/ru/python-lifehacks/how-to-easily-write-linux-cli-tool.md +++ b/content/ru/python-lifehacks/how-to-easily-write-linux-cli-tool.md @@ -4,15 +4,14 @@ category: python-lifehacks filename: how-to-easily-write-linux-cli-tool date: 2023-04-09 --- -Хочу поделиться самым простым из известных мне способов написать CLI инструмент для администрирования Linux -на Python. +Хочу поделиться самым простым из известных мне способов написать CLI инструмент для администрирования Linux на Python. + ## Шаг 1. Установка Fire ```bash pip install fire ``` ## Шаг 2. Создаём простейший CLI инструмент Вот пример CLI инструмента, который выводит в терминал версию Linux: - ```python #!/usr/bin/env python3 import fire diff --git a/content/ru/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md b/content/ru/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md index 7915487..a428ead 100644 --- a/content/ru/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md +++ b/content/ru/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md @@ -4,13 +4,16 @@ category: python-lifehacks filename: how-to-load-multiple-web-pages-in-parallel-using-python date: 2022-05-15 --- - +В этой статье описывается, как загружать содержимое нескольких веб-страниц с нескольких URL-адресов параллельно с помощью Python. + +## Шаг 1. Установка aiohttp Сначала нужно установить пакет `aiohttp`. Для установки aiohttp выполните команду: ```bash pip install aiohttp[speedups] ``` -Суффикс `[speedups]` нужен для установки ускоряющих aiohttp пакетов - `aiodns`, `cchardet`. Затем создайте файл -main.py с таким кодом: +Суффикс `[speedups]` нужен для установки ускоряющих aiohttp пакетов - `aiodns`, `cchardet`. +## Шаг 1. Создание скрипта +Затем создайте файл main.py с таким кодом: ```python import aiohttp import asyncio diff --git a/content/ru/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md b/content/ru/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md index b6ed34f..f8065bf 100644 --- a/content/ru/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md +++ b/content/ru/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md @@ -4,11 +4,13 @@ category: ubuntu-lifehacks filename: ubuntu-how-to-upgrade-kernel date: 2022-05-14 --- +В этой статье описывается, как обновить ядро Linux в операционной системе Ubuntu через интерфейс командной строки. + ### Первый способ Первый способ очень прост. Нам нужно ввести в терминале всего одну команду: ```bash sudo apt update && sudo apt -y upgrade -``` +``` Команда `sudo apt update` обновит кэш репозиториев, а команда `sudo apt -y upgrade` установит новые версии всех установленных программ, включая ядро linux. Плюс данного способа в том, что будет установлена последняя версия linux ядра, официально поддерживаемого ОС Ubuntu. Минус этого способа в том, что официально поддерживаемое ядро обычно не самое новое. Иногда бывает так, что необходимо установить именно самую новую версию ядра linux. Реальный пример: на вашем новом ноутбуке может быть установлен процессор, поддержка которого обеспечивается только в версии ядра linux 5.12, тогда как официально поддерживаемая версия более старая. И тут на помощь приходит второй способ. ### Второй способ Первым делом нужно зайти на сайт https://kernel.ubuntu.com/~kernel-ppa/mainline/. На этом сайте нужно выбрать папку с последней версией ядра linux (в самом низу страницы). Обратите внимание, что рекомендуется выбирать версию без суффикса "rc". Суффикс "rc" означает "release candidate", что в свою очередь значит, что данная версия ядра не является стабильной. На открывшейся странице выбираем папку с архитектурой вашего процессора. Архитектуру можно узнать с помощью команды `uname -p`. Если вывод этой команды "x86_64", то выбираем папку amd64. На открывшейся странице будут ссылки на .deb файлы. Нам нужно скачать 4 из них: diff --git a/themes/ds b/themes/ds index 13b7803..233f146 160000 --- a/themes/ds +++ b/themes/ds @@ -1 +1 @@ -Subproject commit 13b7803377262ba892cfd57c83e9373d28faf3b5 +Subproject commit 233f146418d326ad1835ddd63dd9bb980def56a6