mirror of
https://git.digitalstudium.com/digitalstudium/digitalstudium.com
synced 2023-12-29 08:06:35 +00:00
Add summary
This commit is contained in:
@@ -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.
|
||||
<!--more-->
|
||||
### 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
|
||||
```
|
||||
<!--more-->
|
||||
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
|
||||
|
@@ -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.
|
||||
<!--more-->
|
||||
### 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
|
||||
```
|
||||
|
||||
<!--more-->
|
||||
|
||||
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
|
||||
|
@@ -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.
|
||||
<!--more-->
|
||||
### 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
|
||||
```
|
||||
<!--more-->
|
||||
### 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
|
||||
|
@@ -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.
|
||||
<!--more-->
|
||||
## 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:
|
||||
<!--more-->
|
||||
```python
|
||||
#!/usr/bin/env python3
|
||||
import fire
|
||||
|
@@ -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.
|
||||
<!--more-->
|
||||
## Step 1. Installation of aiohttp
|
||||
First you need to install an aiohttp package. To install aiohttp run the command:
|
||||
```bash
|
||||
pip install aiohttp[speedups]
|
||||
```<!--more-->
|
||||
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
|
||||
|
@@ -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.
|
||||
<!--more-->
|
||||
```
|
||||
### 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
|
||||
```<!--more-->
|
||||
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, <i>officially supported</i> by Ubuntu OS, will be installed. The disadvantage of this method is that the <i>officially supported</i> 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:
|
||||
|
Reference in New Issue
Block a user