1
0
Fork 0

Fix code highlighting
Deploy / deploy (push) Failing after 15s Details

This commit is contained in:
Digital Studium 2023-07-23 15:55:12 +03:00
parent 7a3d0fc7bd
commit cdac09052a
19 changed files with 146 additions and 58 deletions

View File

@ -1,4 +1,4 @@
baseURL: https://digitalstudium.com base_url: https://digitalstudium.com
theme: ds theme: ds
languages: languages:
@ -21,3 +21,7 @@ languages:
schema: schema:
type: TechArticle type: TechArticle
copyright: http://creativecommons.org/licenses/by/4.0/ copyright: http://creativecommons.org/licenses/by/4.0/
includes: ['copy.js']
custom_css: custom.css

View File

@ -10,19 +10,19 @@ Sometimes there is a need to use in BASH such structures as lists (also known as
Array creation in bash can be done this way: Array creation in bash can be done this way:
```shell ```bash
sample_array=(foo bar bazz) sample_array=(foo bar bazz)
``` ```
In order to add single or multiple new elements to the end of array, you should use this syntax: In order to add single or multiple new elements to the end of array, you should use this syntax:
```shell ```bash
sample_array+=(six seven) sample_array+=(six seven)
``` ```
In order to get elements of the list in a cycle, you should use this syntax: In order to get elements of the list in a cycle, you should use this syntax:
```shell ```bash
for i in ${sample_array[@]} for i in ${sample_array[@]}
do do
echo $i echo $i
@ -31,7 +31,7 @@ done
Here is an example how to get element by its index: Here is an example how to get element by its index:
```shell ```bash
echo ${sample_array[0]} echo ${sample_array[0]}
echo ${sample_array[3]} echo ${sample_array[3]}
@ -40,7 +40,7 @@ echo ${sample_array[3]}
Array slicing: Array slicing:
```shell ```bash
sliced_array=${sample_array[@]:1} # will get all elements of a sample_array, starting with 1st sliced_array=${sample_array[@]:1} # will get all elements of a sample_array, starting with 1st
another_sliced_array=${sample_array[@]:1:5} # will get sample_array elements since 1st to 5th another_sliced_array=${sample_array[@]:1:5} # will get sample_array elements since 1st to 5th
``` ```
@ -48,19 +48,19 @@ another_sliced_array=${sample_array[@]:1:5} # will get sample_array elements sin
## 2. Hashmaps ## 2. Hashmaps
To create hashmap in bash use this syntax: To create hashmap in bash use this syntax:
```shell ```bash
declare -A sample_hashmap=([one]=one [two]=two [three]=three [four]=four [five]=five) declare -A sample_hashmap=([one]=one [two]=two [three]=three [four]=four [five]=five)
``` ```
This will add new key "foo" with value "bar": This will add new key "foo" with value "bar":
```shell ```bash
sample_hashmap[foo]=bar sample_hashmap[foo]=bar
``` ```
Cycle: Cycle:
```shell ```bash
for key in ${sample_hashmap[@]} for key in ${sample_hashmap[@]}
do do
echo ${sample_hashmap[$key]} echo ${sample_hashmap[$key]}

View File

@ -14,7 +14,7 @@ sudo fdisk -l
``` ```
to make sure the drive is recognized by the operating system, and to identify the drive name. Output 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: of command will be something like this:
```plaintext ```
Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 sectors Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes/512 bytes Sector size (logical/physical): 512 bytes/512 bytes
@ -26,7 +26,7 @@ physical volume using the command:
sudo pvcreate /dev/vdb sudo pvcreate /dev/vdb
``` ```
You will see output like this: You will see output like this:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdb kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created. Physical volume "/dev/vdb" successfully created.
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -41,7 +41,7 @@ In our case, the command will look like this:
sudo vgcreate vg-example /dev/vdb sudo vgcreate vg-example /dev/vdb
``` ```
The command output will look like this: The command output will look like this:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo vgcreate vg-example/dev/vdb kostya@ubuntu-21-04:~$ sudo vgcreate vg-example/dev/vdb
Volume group "vg-example" successfully created Volume group "vg-example" successfully created
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -56,7 +56,7 @@ In our case, it will be:
sudo lvcreate --size 5G --name lv-example vg-example sudo lvcreate --size 5G --name lv-example vg-example
``` ```
You will see output like this: You will see output like this:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo lvcreate --size 5G --name lv-example vg-example kostya@ubuntu-21-04:~$ sudo lvcreate --size 5G --name lv-example vg-example
Logical volume "lv-example" created. Logical volume "lv-example" created.
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -71,7 +71,7 @@ To create an xfs filesystem, type the command:
sudo mkfs.xfs /dev/vg-example/lv-example sudo mkfs.xfs /dev/vg-example/lv-example
``` ```
The command output will look like this: The command output will look like this:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo mkfs.xfs/dev/vg-example/lv-example kostya@ubuntu-21-04:~$ sudo mkfs.xfs/dev/vg-example/lv-example
meta-data =/dev/vg-example/lv-example isize = 512 agcount = 4, agsize = 327680 blks meta-data =/dev/vg-example/lv-example isize = 512 agcount = 4, agsize = 327680 blks
= sectsz = 512 attr = 2, projid32bit = 1 = sectsz = 512 attr = 2, projid32bit = 1
@ -102,7 +102,7 @@ You can verify that the logical volume has been mounted successfully using the c
df -h /opt df -h /opt
``` ```
The output should be like this: The output should be like this:
```plaintext ```
kostya@ubuntu-21-04:~$ df -h /opt/ kostya@ubuntu-21-04:~$ df -h /opt/
Filesystem Size Used Avail Use% Mounted on Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg--random-lv--random 5.0G 68M 5.0G 2% /opt /dev/mapper/vg--random-lv--random 5.0G 68M 5.0G 2% /opt

View File

@ -17,7 +17,7 @@ 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: 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 ```
Disk /dev/vdc: 5 GiB, 5368709120 bytes, 10485760 sectors Disk /dev/vdc: 5 GiB, 5368709120 bytes, 10485760 sectors
Units: sectors of 1 * 512 = 512 bytes Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes/512 bytes Sector size (logical/physical): 512 bytes/512 bytes
@ -32,7 +32,7 @@ sudo pvcreate /dev/vdc
You will see output like this: You will see output like this:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdc kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdc
Physical volume "/dev/vdc" successfully created. Physical volume "/dev/vdc" successfully created.
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -42,7 +42,7 @@ You will see output like this:
To get a list of available volume groups run this command: To get a list of available volume groups run this command:
```shell ```bash
vgdisplay vgdisplay
``` ```
@ -60,7 +60,7 @@ sudo vgextend vg-example /dev/vdc
You will see output like this: You will see output like this:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo vgextend vg-example /dev/vdc kostya@ubuntu-21-04:~$ sudo vgextend vg-example /dev/vdc
Physical volume "/dev/vdc" successfully created. Physical volume "/dev/vdc" successfully created.
Volume group "vg-example" successfully extended Volume group "vg-example" successfully extended
@ -83,7 +83,7 @@ sudo lvextend --size +2G vg-example/lv-example
You will see output like this: You will see output like this:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo lvextend --size +2G vg-example/lv-example kostya@ubuntu-21-04:~$ sudo lvextend --size +2G vg-example/lv-example
Size of logical volume vg-example/lv-example changed from 5.00 GiB (1280 extents) to 7.00 GiB (1792 extents). Size of logical volume vg-example/lv-example changed from 5.00 GiB (1280 extents) to 7.00 GiB (1792 extents).
Logical volume vg-example/lv-example successfully resized. Logical volume vg-example/lv-example successfully resized.

View File

@ -21,7 +21,7 @@ Logrotate rotates almost all log files in the `/var/log` folder every day. For e
```bash ```bash
ls /var/log/kern* ls /var/log/kern*
``` ```
```plaintext ```
/var/log/kern.log /var/log/kern.log.2.gz /var/log/kern.log.4.gz /var/log/kern.log /var/log/kern.log.2.gz /var/log/kern.log.4.gz
/var/log/kern.log.1 /var/log/kern.log.3.gz /var/log/kern.log.1 /var/log/kern.log.3.gz
``` ```
@ -30,7 +30,7 @@ To limit the number of log files, edit the file `/etc/logrotate.d/rsyslog`. Look
```bash ```bash
cat /etc/logrotate.d/rsyslog cat /etc/logrotate.d/rsyslog
``` ```
```plaintext ```
/var/log/syslog /var/log/syslog
/var/log/mail.info /var/log/mail.info
/var/log/mail.warn /var/log/mail.warn

View File

@ -57,7 +57,7 @@ docker ps
``` ```
The command output should contain 5 containers: prometheus, grafana, alertmanager, node-exporter, grafana. The command output should contain 5 containers: prometheus, grafana, alertmanager, node-exporter, grafana.
```plaintext ```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
46fba26e7234 gcr.io/cadvisor/cadvisor:v0.47.0 "/usr/bin/cadvisor -…" 5 days ago Up 5 days (healthy) 8080/tcp monitoring_cadvisor.1.q02qcn798dh0rydo1dzslylse 46fba26e7234 gcr.io/cadvisor/cadvisor:v0.47.0 "/usr/bin/cadvisor -…" 5 days ago Up 5 days (healthy) 8080/tcp monitoring_cadvisor.1.q02qcn798dh0rydo1dzslylse
f212e3c66786 prom/alertmanager:v0.25.0 "/bin/alertmanager -…" 6 days ago Up 6 days 9093/tcp monitoring_alertmanager.1.oysziztrqnur7xr0hr82avunz f212e3c66786 prom/alertmanager:v0.25.0 "/bin/alertmanager -…" 6 days ago Up 6 days 9093/tcp monitoring_alertmanager.1.oysziztrqnur7xr0hr82avunz

View File

@ -47,7 +47,7 @@ my-cli-tool kernel
``` ```
You will see output like this: You will see output like this:
```plaintext ```
my-cli-tool kernel my-cli-tool kernel
Kernel version: 6.2.2-060202-generic Kernel version: 6.2.2-060202-generic
``` ```
@ -58,7 +58,7 @@ This will automatically generate a help page, which can be called using the `--h
my-cli-tool --help my-cli-tool --help
``` ```
You will get this output: You will get this output:
```plaintext ```
NAME NAME
my-cli-tool - A CLI tool for getting system information about Linux server my-cli-tool - A CLI tool for getting system information about Linux server
@ -104,7 +104,7 @@ Now we can type the following command:
my-cli-tool kernel --format short my-cli-tool kernel --format short
``` ```
Output: Output:
```plaintext ```
6.2.2 6.2.2
``` ```
This will also automatically update the help page, adding the `--format` flag and its possible values: This will also automatically update the help page, adding the `--format` flag and its possible values:
@ -112,7 +112,7 @@ This will also automatically update the help page, adding the `--format` flag an
my-cli-tool kernel --help my-cli-tool kernel --help
``` ```
Output: Output:
```plaintext ```
NAME NAME
my-cli-tool kernel - A method for getting kernel version my-cli-tool kernel - A method for getting kernel version

View File

@ -47,7 +47,7 @@ Now you can run main.py file with the command:
python3 main.py python3 main.py
``` ```
You will see this output: You will see this output:
```plaintext ```
200 200
{ {
"args": { "args": {

View File

@ -14,7 +14,7 @@ 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, <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. 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 ### 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: 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:
```plaintext ```
linux-headers-{version}-generic_{version}.{date}_amd64.deb linux-headers-{version}-generic_{version}.{date}_amd64.deb
linux-headers-{version}_{version}.{date}_all.deb linux-headers-{version}_{version}.{date}_all.deb
linux-image-unsigned-{version}-generic_{version}.{date}_amd64.deb linux-image-unsigned-{version}-generic_{version}.{date}_amd64.deb

View File

@ -10,19 +10,19 @@ date: 2023-05-07T13:35:26.956Z
создание массива в bash делается просто: создание массива в bash делается просто:
```shell ```bash
sample_array=(foo bar bazz) sample_array=(foo bar bazz)
``` ```
Чтобы добавить один или несколько новых элементов в конец массива, нужно использовать такой синтаксис: Чтобы добавить один или несколько новых элементов в конец массива, нужно использовать такой синтаксис:
```shell ```bash
sample_array+=(six seven) sample_array+=(six seven)
``` ```
Чтобы пройти по массиву циклом, нужно использовать такой синтаксис: Чтобы пройти по массиву циклом, нужно использовать такой синтаксис:
```shell ```bash
for i in ${sample_array[@]} for i in ${sample_array[@]}
do do
echo $i echo $i
@ -31,7 +31,7 @@ done
Чтобы получить элемент по индексу, используется такая конструкция: Чтобы получить элемент по индексу, используется такая конструкция:
```shell ```bash
echo ${sample_array[0]} echo ${sample_array[0]}
echo ${sample_array[3]} echo ${sample_array[3]}
@ -40,7 +40,7 @@ echo ${sample_array[3]}
Чтобы обрезать массив, используется такая конструкция: Чтобы обрезать массив, используется такая конструкция:
```shell ```bash
sliced_array=${sample_array[@]:1} # выведет все элементы sample_array, начиная с 1-го sliced_array=${sample_array[@]:1} # выведет все элементы sample_array, начиная с 1-го
another_sliced_array=${sample_array[@]:1:5} # выведет элементы sample_array с 1-го по 5-й another_sliced_array=${sample_array[@]:1:5} # выведет элементы sample_array с 1-го по 5-й
``` ```
@ -49,19 +49,19 @@ another_sliced_array=${sample_array[@]:1:5} # выведет элементы sa
создание ассоциативного массива в bash делается так: создание ассоциативного массива в bash делается так:
```shell ```bash
declare -A sample_hashmap=([one]=one [two]=two [three]=three [four]=four [five]=five) declare -A sample_hashmap=([one]=one [two]=two [three]=three [four]=four [five]=five)
``` ```
Добавление новых элементов: Добавление новых элементов:
```shell ```bash
sample_hashmap[foo]=bar sample_hashmap[foo]=bar
``` ```
Обход в цикле: Обход в цикле:
```shell ```bash
for key in ${sample_hashmap[@]} for key in ${sample_hashmap[@]}
do do
echo ${sample_hashmap[$key]} echo ${sample_hashmap[$key]}

View File

@ -14,7 +14,7 @@ sudo fdisk -l
``` ```
чтобы убедиться, что диск распознан операционной системой, а также чтобы идентифицировать имя диска. Вывод чтобы убедиться, что диск распознан операционной системой, а также чтобы идентифицировать имя диска. Вывод
команды будет примерно такой: команды будет примерно такой:
```plaintext ```
Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 sectors Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes
@ -26,7 +26,7 @@ I/O size (minimum/optimal): 512 bytes / 512 bytes
sudo pvcreate /dev/vdb sudo pvcreate /dev/vdb
``` ```
Вы увидите такой вывод: Вы увидите такой вывод:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdb kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created. Physical volume "/dev/vdb" successfully created.
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -41,7 +41,7 @@ sudo vgcreate {vgname} {pvname}
sudo vgcreate vg-example /dev/vdb sudo vgcreate vg-example /dev/vdb
``` ```
Вывод команды будет такой: Вывод команды будет такой:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo vgcreate vg-example /dev/vdb kostya@ubuntu-21-04:~$ sudo vgcreate vg-example /dev/vdb
Volume group "vg-example" successfully created Volume group "vg-example" successfully created
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -56,7 +56,7 @@ sudo lvcreate --size {size} --name {lv-name} {vg-name}
sudo lvcreate --size 5G --name lv-example vg-example sudo lvcreate --size 5G --name lv-example vg-example
``` ```
Вы увидите такой вывод: Вы увидите такой вывод:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo lvcreate --size 5G --name lv-example vg-example kostya@ubuntu-21-04:~$ sudo lvcreate --size 5G --name lv-example vg-example
Logical volume "lv-example" created. Logical volume "lv-example" created.
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -71,7 +71,7 @@ sudo lvcreate --extents 100%FREE --name lv-example vg-example
sudo mkfs.xfs /dev/vg-example/lv-example sudo mkfs.xfs /dev/vg-example/lv-example
``` ```
Вывод команды будет такой: Вывод команды будет такой:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo mkfs.xfs /dev/vg-example/lv-example kostya@ubuntu-21-04:~$ sudo mkfs.xfs /dev/vg-example/lv-example
meta-data=/dev/vg-example/lv-example isize=512 agcount=4, agsize=327680 blks meta-data=/dev/vg-example/lv-example isize=512 agcount=4, agsize=327680 blks
= sectsz=512 attr=2, projid32bit=1 = sectsz=512 attr=2, projid32bit=1
@ -102,7 +102,7 @@ sudo mount -a
df -h /opt df -h /opt
``` ```
Вывод должен быть такой: Вывод должен быть такой:
```plaintext ```
kostya@ubuntu-21-04:~$ df -h /opt/ kostya@ubuntu-21-04:~$ df -h /opt/
Filesystem Size Used Avail Use% Mounted on Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg--random-lv--random 5.0G 68M 5.0G 2% /opt /dev/mapper/vg--random-lv--random 5.0G 68M 5.0G 2% /opt

View File

@ -17,7 +17,7 @@ sudo fdisk -l
Это нужно, чтобы убедиться, что диск распознан операционной системой, а также чтобы идентифицировать имя диска. Вывод команды будет примерно такой: Это нужно, чтобы убедиться, что диск распознан операционной системой, а также чтобы идентифицировать имя диска. Вывод команды будет примерно такой:
```plaintext ```
Disk /dev/vdc: 5 GiB, 5368709120 bytes, 10485760 sectors Disk /dev/vdc: 5 GiB, 5368709120 bytes, 10485760 sectors
Units: sectors of 1 * 512 = 512 bytes Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes
@ -32,7 +32,7 @@ sudo pvcreate /dev/vdc
Вы увидите такой вывод: Вы увидите такой вывод:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdc kostya@ubuntu-21-04:~$ sudo pvcreate /dev/vdc
Physical volume "/dev/vdc" successfully created. Physical volume "/dev/vdc" successfully created.
kostya@ubuntu-21-04:~$ kostya@ubuntu-21-04:~$
@ -42,7 +42,7 @@ kostya@ubuntu-21-04:~$
Чтобы увидеть список доступных групп томов, воспользуйтесь командой: Чтобы увидеть список доступных групп томов, воспользуйтесь командой:
```shell ```bash
vgdisplay vgdisplay
``` ```
@ -60,7 +60,7 @@ sudo vgextend vg-example /dev/vdc
Вы увидите такой вывод: Вы увидите такой вывод:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo vgextend vg-example /dev/vdc kostya@ubuntu-21-04:~$ sudo vgextend vg-example /dev/vdc
Physical volume "/dev/vdc" successfully created. Physical volume "/dev/vdc" successfully created.
Volume group "vg-example" successfully extended Volume group "vg-example" successfully extended
@ -83,7 +83,7 @@ sudo lvextend --size +2G vg-example/lv-example
Вы увидите такой вывод: Вы увидите такой вывод:
```plaintext ```
kostya@ubuntu-21-04:~$ sudo lvextend --size +2G vg-example/lv-example kostya@ubuntu-21-04:~$ sudo lvextend --size +2G vg-example/lv-example
Size of logical volume vg-example/lv-example changed from 5.00 GiB (1280 extents) to 7.00 GiB (1792 extents). Size of logical volume vg-example/lv-example changed from 5.00 GiB (1280 extents) to 7.00 GiB (1792 extents).
Logical volume vg-example/lv-example successfully resized. Logical volume vg-example/lv-example successfully resized.

View File

@ -18,7 +18,7 @@ Logrotate каждый день совершает ротацию почти в
```bash ```bash
ls /var/log/kern* ls /var/log/kern*
``` ```
```plaintext ```
/var/log/kern.log /var/log/kern.log.2.gz /var/log/kern.log.4.gz /var/log/kern.log /var/log/kern.log.2.gz /var/log/kern.log.4.gz
/var/log/kern.log.1 /var/log/kern.log.3.gz /var/log/kern.log.1 /var/log/kern.log.3.gz
``` ```
@ -26,7 +26,7 @@ ls /var/log/kern*
```bash ```bash
cat /etc/logrotate.d/rsyslog cat /etc/logrotate.d/rsyslog
``` ```
```plaintext ```
/var/log/syslog /var/log/syslog
/var/log/mail.info /var/log/mail.info
/var/log/mail.warn /var/log/mail.warn

View File

@ -57,7 +57,7 @@ docker ps
``` ```
Вывод команды должен содержать 5 контейнеров: prometheus, grafana, alertmanager, node-exporter, grafana. Вывод команды должен содержать 5 контейнеров: prometheus, grafana, alertmanager, node-exporter, grafana.
```plaintext ```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
46fba26e7234 gcr.io/cadvisor/cadvisor:v0.47.0 "/usr/bin/cadvisor -…" 5 days ago Up 5 days (healthy) 8080/tcp monitoring_cadvisor.1.q02qcn798dh0rydo1dzslylse 46fba26e7234 gcr.io/cadvisor/cadvisor:v0.47.0 "/usr/bin/cadvisor -…" 5 days ago Up 5 days (healthy) 8080/tcp monitoring_cadvisor.1.q02qcn798dh0rydo1dzslylse
f212e3c66786 prom/alertmanager:v0.25.0 "/bin/alertmanager -…" 6 days ago Up 6 days 9093/tcp monitoring_alertmanager.1.oysziztrqnur7xr0hr82avunz f212e3c66786 prom/alertmanager:v0.25.0 "/bin/alertmanager -…" 6 days ago Up 6 days 9093/tcp monitoring_alertmanager.1.oysziztrqnur7xr0hr82avunz

View File

@ -46,7 +46,7 @@ my-cli-tool kernel
``` ```
Вы увидите такой вывод: Вы увидите такой вывод:
```plaintext ```
my-cli-tool kernel my-cli-tool kernel
Kernel version: 6.2.2-060202-generic Kernel version: 6.2.2-060202-generic
``` ```
@ -57,7 +57,7 @@ Kernel version: 6.2.2-060202-generic
my-cli-tool --help my-cli-tool --help
``` ```
Вы получите такой вывод: Вы получите такой вывод:
```plaintext ```
NAME NAME
my-cli-tool - A CLI tool for getting system information about Linux server my-cli-tool - A CLI tool for getting system information about Linux server
@ -103,7 +103,7 @@ if __name__ == "__main__":
my-cli-tool kernel --format short my-cli-tool kernel --format short
``` ```
На что должен последовать такой вывод: На что должен последовать такой вывод:
```plaintext ```
6.2.2 6.2.2
``` ```
При этом автоматически будет скорректирована help страница, туда будет добавлен флаг `--format` и его возможные значения: При этом автоматически будет скорректирована help страница, туда будет добавлен флаг `--format` и его возможные значения:
@ -111,7 +111,7 @@ my-cli-tool kernel --format short
my-cli-tool kernel --help my-cli-tool kernel --help
``` ```
Вывод: Вывод:
```plaintext ```
NAME NAME
my-cli-tool kernel - A method for getting kernel version my-cli-tool kernel - A method for getting kernel version

View File

@ -46,7 +46,7 @@ loop.run_until_complete(fetch_urls(urls))
python3 main.py python3 main.py
``` ```
Вы увидите примерно такой вывод: Вы увидите примерно такой вывод:
```plaintext ```
200 200
{ {
"args": { "args": {

View File

@ -14,7 +14,7 @@ sudo apt update && sudo apt -y upgrade
Команда `sudo apt update` обновит кэш репозиториев, а команда `sudo apt -y upgrade` установит новые версии всех установленных программ, включая ядро linux. Плюс данного способа в том, что будет установлена последняя версия linux ядра, <i>официально поддерживаемого</i> ОС Ubuntu. Минус этого способа в том, что <i>официально поддерживаемое</i> ядро обычно не самое новое. Иногда бывает так, что необходимо установить именно самую новую версию ядра linux. Реальный пример: на вашем новом ноутбуке может быть установлен процессор, поддержка которого обеспечивается только в версии ядра linux 5.12, тогда как официально поддерживаемая версия более старая. И тут на помощь приходит второй способ. Команда `sudo apt update` обновит кэш репозиториев, а команда `sudo apt -y upgrade` установит новые версии всех установленных программ, включая ядро linux. Плюс данного способа в том, что будет установлена последняя версия linux ядра, <i>официально поддерживаемого</i> ОС Ubuntu. Минус этого способа в том, что <i>официально поддерживаемое</i> ядро обычно не самое новое. Иногда бывает так, что необходимо установить именно самую новую версию ядра linux. Реальный пример: на вашем новом ноутбуке может быть установлен процессор, поддержка которого обеспечивается только в версии ядра linux 5.12, тогда как официально поддерживаемая версия более старая. И тут на помощь приходит второй способ.
### Второй способ ### Второй способ
Первым делом нужно зайти на сайт https://kernel.ubuntu.com/~kernel-ppa/mainline/. На этом сайте нужно выбрать папку с последней версией ядра linux (в самом низу страницы). Обратите внимание, что рекомендуется выбирать версию без суффикса "rc". Суффикс "rc" означает "release candidate", что в свою очередь значит, что данная версия ядра не является стабильной. На открывшейся странице выбираем папку с архитектурой вашего процессора. Архитектуру можно узнать с помощью команды `uname -p`. Если вывод этой команды "x86_64", то выбираем папку amd64. На открывшейся странице будут ссылки на .deb файлы. Нам нужно скачать 4 из них: Первым делом нужно зайти на сайт https://kernel.ubuntu.com/~kernel-ppa/mainline/. На этом сайте нужно выбрать папку с последней версией ядра linux (в самом низу страницы). Обратите внимание, что рекомендуется выбирать версию без суффикса "rc". Суффикс "rc" означает "release candidate", что в свою очередь значит, что данная версия ядра не является стабильной. На открывшейся странице выбираем папку с архитектурой вашего процессора. Архитектуру можно узнать с помощью команды `uname -p`. Если вывод этой команды "x86_64", то выбираем папку amd64. На открывшейся странице будут ссылки на .deb файлы. Нам нужно скачать 4 из них:
```plaintext ```
linux-headers-{version}-generic_{version}.{date}_amd64.deb linux-headers-{version}-generic_{version}.{date}_amd64.deb
linux-headers-{version}_{version}.{date}_all.deb linux-headers-{version}_{version}.{date}_all.deb
linux-image-unsigned-{version}-generic_{version}.{date}_amd64.deb linux-image-unsigned-{version}-generic_{version}.{date}_amd64.deb

84
static/css/custom.css Normal file
View File

@ -0,0 +1,84 @@
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.codehilite .hll { background-color: #333333 }
.codehilite { background: #111111; color: #ffffff }
.codehilite .c { color: #008800; font-style: italic; background-color: #0f140f } /* Comment */
.codehilite .err { color: #ffffff } /* Error */
.codehilite .esc { color: #ffffff } /* Escape */
.codehilite .g { color: #ffffff } /* Generic */
.codehilite .k { color: #fb660a; font-weight: bold } /* Keyword */
.codehilite .l { color: #ffffff } /* Literal */
.codehilite .n { color: #ffffff } /* Name */
.codehilite .o { color: #ffffff } /* Operator */
.codehilite .x { color: #ffffff } /* Other */
.codehilite .p { color: #ffffff } /* Punctuation */
.codehilite .ch { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.Hashbang */
.codehilite .cm { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.Multiline */
.codehilite .cp { color: #ff0007; font-weight: bold; font-style: italic; background-color: #0f140f } /* Comment.Preproc */
.codehilite .cpf { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.PreprocFile */
.codehilite .c1 { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.Single */
.codehilite .cs { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.Special */
.codehilite .gd { color: #ffffff } /* Generic.Deleted */
.codehilite .ge { color: #ffffff } /* Generic.Emph */
.codehilite .gr { color: #ffffff } /* Generic.Error */
.codehilite .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #ffffff } /* Generic.Inserted */
.codehilite .go { color: #444444; background-color: #222222 } /* Generic.Output */
.codehilite .gp { color: #ffffff } /* Generic.Prompt */
.codehilite .gs { color: #ffffff } /* Generic.Strong */
.codehilite .gu { color: #ffffff; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #ffffff } /* Generic.Traceback */
.codehilite .kc { color: #fb660a; font-weight: bold } /* Keyword.Constant */
.codehilite .kd { color: #fb660a; font-weight: bold } /* Keyword.Declaration */
.codehilite .kn { color: #fb660a; font-weight: bold } /* Keyword.Namespace */
.codehilite .kp { color: #fb660a } /* Keyword.Pseudo */
.codehilite .kr { color: #fb660a; font-weight: bold } /* Keyword.Reserved */
.codehilite .kt { color: #cdcaa9; font-weight: bold } /* Keyword.Type */
.codehilite .ld { color: #ffffff } /* Literal.Date */
.codehilite .m { color: #0086f7; font-weight: bold } /* Literal.Number */
.codehilite .s { color: #0086d2 } /* Literal.String */
.codehilite .na { color: #ff0086; font-weight: bold } /* Name.Attribute */
.codehilite .nb { color: #ffffff } /* Name.Builtin */
.codehilite .nc { color: #ffffff } /* Name.Class */
.codehilite .no { color: #0086d2 } /* Name.Constant */
.codehilite .nd { color: #ffffff } /* Name.Decorator */
.codehilite .ni { color: #ffffff } /* Name.Entity */
.codehilite .ne { color: #ffffff } /* Name.Exception */
.codehilite .nf { color: #ff0086; font-weight: bold } /* Name.Function */
.codehilite .nl { color: #ffffff } /* Name.Label */
.codehilite .nn { color: #ffffff } /* Name.Namespace */
.codehilite .nx { color: #ffffff } /* Name.Other */
.codehilite .py { color: #ffffff } /* Name.Property */
.codehilite .nt { color: #fb660a; font-weight: bold } /* Name.Tag */
.codehilite .nv { color: #fb660a } /* Name.Variable */
.codehilite .ow { color: #ffffff } /* Operator.Word */
.codehilite .pm { color: #ffffff } /* Punctuation.Marker */
.codehilite .w { color: #888888 } /* Text.Whitespace */
.codehilite .mb { color: #0086f7; font-weight: bold } /* Literal.Number.Bin */
.codehilite .mf { color: #0086f7; font-weight: bold } /* Literal.Number.Float */
.codehilite .mh { color: #0086f7; font-weight: bold } /* Literal.Number.Hex */
.codehilite .mi { color: #0086f7; font-weight: bold } /* Literal.Number.Integer */
.codehilite .mo { color: #0086f7; font-weight: bold } /* Literal.Number.Oct */
.codehilite .sa { color: #0086d2 } /* Literal.String.Affix */
.codehilite .sb { color: #0086d2 } /* Literal.String.Backtick */
.codehilite .sc { color: #0086d2 } /* Literal.String.Char */
.codehilite .dl { color: #0086d2 } /* Literal.String.Delimiter */
.codehilite .sd { color: #0086d2 } /* Literal.String.Doc */
.codehilite .s2 { color: #0086d2 } /* Literal.String.Double */
.codehilite .se { color: #0086d2 } /* Literal.String.Escape */
.codehilite .sh { color: #0086d2 } /* Literal.String.Heredoc */
.codehilite .si { color: #0086d2 } /* Literal.String.Interpol */
.codehilite .sx { color: #0086d2 } /* Literal.String.Other */
.codehilite .sr { color: #0086d2 } /* Literal.String.Regex */
.codehilite .s1 { color: #0086d2 } /* Literal.String.Single */
.codehilite .ss { color: #0086d2 } /* Literal.String.Symbol */
.codehilite .bp { color: #ffffff } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #ff0086; font-weight: bold } /* Name.Function.Magic */
.codehilite .vc { color: #fb660a } /* Name.Variable.Class */
.codehilite .vg { color: #fb660a } /* Name.Variable.Global */
.codehilite .vi { color: #fb660a } /* Name.Variable.Instance */
.codehilite .vm { color: #fb660a } /* Name.Variable.Magic */
.codehilite .il { color: #0086f7; font-weight: bold } /* Literal.Number.Integer.Long */

@ -1 +1 @@
Subproject commit 5be1e9acaad8fd84f01e5f7a969033d5c449430d Subproject commit 9bba1d2c706d03120930c961c1b4a76535877d54