From d90ff60a807adfd9205f18f0b3e1225570f6eaed Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Sun, 23 Apr 2023 17:56:27 +0300 Subject: [PATCH] Remove prism --- config.yaml | 6 +-- content/en/about-author.md | 7 +-- .../how-to-create-lvm-logical-volume.md | 4 +- .../how-to-extend-lvm-volume-on-linux.md | 4 +- .../linux-how-to-limit-var-log-size.md | 4 +- .../linux-monitoring-with-telegram-alerts.md | 4 +- .../nginx-configs-examples.md | 12 +++-- .../how-to-easily-write-linux-cli-tool.md | 4 +- ...iple-web-pages-in-parallel-using-python.md | 4 +- .../ubuntu-how-to-upgrade-kernel.md | 4 +- content/ru/about-author.md | 6 ++- .../how-to-create-lvm-logical-volume.md | 4 +- .../how-to-extend-lvm-volume-on-linux.md | 4 +- .../linux-how-to-limit-var-log-size.md | 4 +- .../linux-monitoring-with-telegram-alerts.md | 4 +- .../nginx-configs-examples.md | 29 ++++++++--- .../how-to-easily-write-linux-cli-tool.md | 4 +- ...iple-web-pages-in-parallel-using-python.md | 4 +- .../ubuntu-how-to-upgrade-kernel.md | 4 +- static/admin/config.yml | 51 +++++++++++++++++++ static/admin/index.html | 13 +++++ static/images/start-tor-browser.desktop | 34 +++++++++++++ themes/ds | 2 +- 23 files changed, 181 insertions(+), 35 deletions(-) rename content/en/{nginx-lifechack => nginx-lifehacks}/nginx-configs-examples.md (93%) rename content/en/{python-programming => python-lifehacks}/how-to-easily-write-linux-cli-tool.md (95%) rename content/en/{python-programming => python-lifehacks}/how-to-load-multiple-web-pages-in-parallel-using-python.md (94%) rename content/ru/{nginx-lifechack => nginx-lifehacks}/nginx-configs-examples.md (94%) rename content/ru/{python-programming => python-lifehacks}/how-to-easily-write-linux-cli-tool.md (98%) rename content/ru/{python-programming => python-lifehacks}/how-to-load-multiple-web-pages-in-parallel-using-python.md (95%) create mode 100644 static/admin/config.yml create mode 100644 static/admin/index.html create mode 100644 static/images/start-tor-browser.desktop diff --git a/config.yaml b/config.yaml index 55db875..057e299 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ -title: 'Digital Studium' -theme: 'ds' +title: Digital Studium +theme: ds defaultContentLanguageInSubdir: true languages: @@ -8,7 +8,7 @@ languages: languageName: English params: author: Konstantin Shutkin - description: Blog about Linux, DevOps, programming and cloud technologies + description: Blog about Linux, DevOps, programming and cloud technologies ru: contentDir: content/ru languageName: Русский diff --git a/content/en/about-author.md b/content/en/about-author.md index e2e9187..b52b15e 100644 --- a/content/en/about-author.md +++ b/content/en/about-author.md @@ -1,8 +1,9 @@ --- -title: "About author" -date: "2023-02-18" +title: About author +category: / +filename: about-author +date: 2023-02-18 --- - {{< figure src="/images/kostya.jpg" width="100px" class="floatleft alignleft" >}} My name is Konstantin Shutkin, I am from Moscow, Russia and I am a DevOps engineer. Since 2016, I have worked in this position in companies such as Severstal, Sberbank, Nvidia. My main subject of research and work is Linux, Docker, Kubernetes, Python programming and more. I share my knowledge on this blog. 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 4fcf15e..aecf9f2 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 @@ -1,6 +1,8 @@ --- title: "Linux: How to create LVM logical volume" -date: "2022-05-15" +category: linux-lifehacks +filename: how-to-create-lvm-logical-volume +date: 2022-05-15 --- ### First step: creating a physical volume After you have attached the disk to a physical server or virtual machine, you need to type 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 1e0d460..5cfe627 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 @@ -1,6 +1,8 @@ --- title: "Linux: How to extend LVM volume" -date: "2022-05-15" +category: linux-lifehacks +filename: how-to-extend-lvm-volume-on-linux +date: 2022-05-15 --- ### Situation 1: new disk #### First step: creating a physical volume diff --git a/content/en/linux-lifehacks/linux-how-to-limit-var-log-size.md b/content/en/linux-lifehacks/linux-how-to-limit-var-log-size.md index a90f96f..3b913c4 100644 --- a/content/en/linux-lifehacks/linux-how-to-limit-var-log-size.md +++ b/content/en/linux-lifehacks/linux-how-to-limit-var-log-size.md @@ -1,6 +1,8 @@ --- title: "Linux: how to limit /var/log folder size" -date: "2022-06-16" +category: linux-lifehacks +filename: linux-how-to-limit-var-log-size +date: 2022-06-16 --- Sometimes the `/var/log` folder grows so large that it causes a shortage of disk space. How to limit the size of this folder? By following the two steps in this article, you can control the size of the `/var/log` folder. 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 823d5e5..e955186 100644 --- a/content/en/linux-lifehacks/linux-monitoring-with-telegram-alerts.md +++ b/content/en/linux-lifehacks/linux-monitoring-with-telegram-alerts.md @@ -1,6 +1,8 @@ --- title: "Linux: How to set up monitoring with alerts to Telegram" -date: "2023-03-04" +category: linux-lifehacks +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 diff --git a/content/en/nginx-lifechack/nginx-configs-examples.md b/content/en/nginx-lifehacks/nginx-configs-examples.md similarity index 93% rename from content/en/nginx-lifechack/nginx-configs-examples.md rename to content/en/nginx-lifehacks/nginx-configs-examples.md index 3306589..11f68af 100644 --- a/content/en/nginx-lifechack/nginx-configs-examples.md +++ b/content/en/nginx-lifehacks/nginx-configs-examples.md @@ -1,6 +1,8 @@ --- title: "Nginx: Sample Configuration Files" -date: "2023-03-26" +category: nginx-lifehacks +filename: nginx-configs-examples +date: 2023-03-26 --- Sometimes there is a need to quickly create an nginx configuration file: for hosting a static website, to create a simple proxy server, etc. @@ -17,7 +19,7 @@ Then run the command to apply the config: sudo service nginx reload ``` ## Example 1: hosting a static site. -```bash +```nginx server { listen 80; server_name example.com www.example.com; @@ -31,7 +33,7 @@ server { } ``` ## Example 2: proxy server -```bash +```nginx server { listen 80; server_name example.com www.example.com; @@ -49,14 +51,14 @@ server { ``` ## Example 3: caching proxy In `/etc/nginx/nginx.conf` add: -```bash +```nginx http { proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g; } ``` In `/etc/nginx/conf.d` put the following config: -```bash +```nginx server { listen 80; server_name example.com www.example.com; diff --git a/content/en/python-programming/how-to-easily-write-linux-cli-tool.md b/content/en/python-lifehacks/how-to-easily-write-linux-cli-tool.md similarity index 95% rename from content/en/python-programming/how-to-easily-write-linux-cli-tool.md rename to content/en/python-lifehacks/how-to-easily-write-linux-cli-tool.md index 5693ee8..3e695da 100644 --- a/content/en/python-programming/how-to-easily-write-linux-cli-tool.md +++ b/content/en/python-lifehacks/how-to-easily-write-linux-cli-tool.md @@ -1,6 +1,8 @@ --- title: "Python: How to easily write a CLI tool for Linux using Fire" -date: "2023-04-09" +category: python-lifehacks +filename: how-to-easily-write-linux-cli-tool +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. diff --git a/content/en/python-programming/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 similarity index 94% rename from content/en/python-programming/how-to-load-multiple-web-pages-in-parallel-using-python.md rename to content/en/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md index c412b86..4889f05 100644 --- a/content/en/python-programming/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 @@ -1,6 +1,8 @@ --- title: "Python: How to load multiple web pages in parallel" -date: "2022-05-15" +category: python-lifehacks +filename: how-to-load-multiple-web-pages-in-parallel-using-python +date: 2022-05-15 --- First you need to install an aiohttp package. To install aiohttp run the command: ```bash 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 9303443..9ce7455 100644 --- a/content/en/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md +++ b/content/en/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md @@ -1,6 +1,8 @@ --- title: "Ubuntu: How to upgrade kernel" -date: "2022-05-14" +category: ubuntu-lifehacks +filename: ubuntu-how-to-upgrade-kernel +date: 2022-05-14 --- ### First method The first method is very simple. We need to enter only one command in the terminal: diff --git a/content/ru/about-author.md b/content/ru/about-author.md index 864442b..5c526c0 100644 --- a/content/ru/about-author.md +++ b/content/ru/about-author.md @@ -1,6 +1,8 @@ --- -title: "Об авторе" -date: "2023-02-18" +title: Об авторе +category: / +filename: about-author +date: 2023-02-18 --- {{< figure src="/images/kostya.jpg" width="100px" class="floatleft alignleft" >}} Меня зовут Константин Шуткин, я живу в городе Москва и я DevOps-инженер. С 2016 года я работал на этой должности в таких компаниях, как Северсталь, Сбербанк, Nvidia. Мой основной предмет исследований и работы это Linux, Docker, Kubernetes, программирование на Python и т. д., и я делюсь своими знаниями в этих областях на этом сайте и на ютуб канале. 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 b286ad8..ad76ee9 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 @@ -1,6 +1,8 @@ --- title: "Linux: Как создать логический том LVM" -date: "2022-05-15" +category: linux-lifehacks +filename: how-to-create-lvm-logical-volume +date: 2022-05-15 --- ### Первый шаг: создание физического тома После того, как вы присоединили диск к физическому серверу или к виртуальной машине, вам нужно набрать 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 d269034..50f5e8a 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 @@ -1,6 +1,8 @@ --- title: "Linux: Как расширить логический том LVM" -date: "2022-05-15" +category: linux-lifehacks +filename: how-to-extend-lvm-volume-on-linux +date: 2022-05-15 --- ### Ситуация 1: новый диск #### Первый шаг: создание физического тома diff --git a/content/ru/linux-lifehacks/linux-how-to-limit-var-log-size.md b/content/ru/linux-lifehacks/linux-how-to-limit-var-log-size.md index deebdeb..3f090af 100644 --- a/content/ru/linux-lifehacks/linux-how-to-limit-var-log-size.md +++ b/content/ru/linux-lifehacks/linux-how-to-limit-var-log-size.md @@ -1,6 +1,8 @@ --- title: "Linux: как ограничить размер папки /var/log" -date: "2022-06-06" +category: linux-lifehacks +filename: linux-how-to-limit-var-log-size +date: 2022-06-06 --- Иногда папка `/var/log` увеличивается в размере настолько, что становится причиной нехватки места на диске. Как ограничить рост размера этой папки? Выполнив два шага из этой статьи, вы можете поставить размер папки `/var/log` под контроль. 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 babcb25..8aa1f24 100644 --- a/content/ru/linux-lifehacks/linux-monitoring-with-telegram-alerts.md +++ b/content/ru/linux-lifehacks/linux-monitoring-with-telegram-alerts.md @@ -1,6 +1,8 @@ --- title: "Linux: Как настроить мониторинг с уведомлениями в Telegram" -date: "2023-03-04" +category: linux-lifehacks +filename: linux-monitoring-with-telegram-alerts +date: 2023-03-04 --- В статье описывается, как настроить мониторинг с уведомлениями в Telergram с помощью Grafana, Prometheus, Alertmanager, Node-exporter и Cadvisor. ### Первый шаг: Клонирование репозитория diff --git a/content/ru/nginx-lifechack/nginx-configs-examples.md b/content/ru/nginx-lifehacks/nginx-configs-examples.md similarity index 94% rename from content/ru/nginx-lifechack/nginx-configs-examples.md rename to content/ru/nginx-lifehacks/nginx-configs-examples.md index 5a42c0c..b0a1563 100644 --- a/content/ru/nginx-lifechack/nginx-configs-examples.md +++ b/content/ru/nginx-lifehacks/nginx-configs-examples.md @@ -1,23 +1,32 @@ --- title: "Nginx: примеры конфигурационных файлов" -date: "2023-03-26" +category: nginx-lifehacks +filename: nginx-configs-examples +date: 2023-03-26 --- Иногда возникает потребность быстро создать конфигурационный файл nginx: для хостинга статического вебсайта, для создания простого проксирующего сервера и т. п. В данной статье приведены простые примеры конфигов Nginx для разных целей. + + Чтобы нижеприведенные конфиги заработали, нужно положить их по пути `/etc/nginx/conf.d/.conf`, затем проверить валидность конфига: + ```bash nginx -t ``` + Затем выполнить команду для применения конфига: + ```bash sudo service nginx reload ``` + ## Пример 1: хостинг статического сайта. -```bash + +```nginx server { listen 80; server_name example.com www.example.com; @@ -30,8 +39,10 @@ server { } } ``` + ## Пример 2: проксирующий сервер -```bash + +```nginx server { listen 80; server_name example.com www.example.com; @@ -47,16 +58,21 @@ server { } } ``` + ## Пример 3: кэширующий прокси + В `/etc/nginx/nginx.conf` добавить: -```bash + +```nginx http { proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g; } ``` + В `/etc/nginx/conf.d` положить такой конфиг: -```bash + +```nginx server { listen 80; server_name example.com www.example.com; @@ -71,5 +87,4 @@ server { http_500 http_502 http_503 http_504; } } -``` - +``` \ No newline at end of file diff --git a/content/ru/python-programming/how-to-easily-write-linux-cli-tool.md b/content/ru/python-lifehacks/how-to-easily-write-linux-cli-tool.md similarity index 98% rename from content/ru/python-programming/how-to-easily-write-linux-cli-tool.md rename to content/ru/python-lifehacks/how-to-easily-write-linux-cli-tool.md index 1780564..c658e6f 100644 --- a/content/ru/python-programming/how-to-easily-write-linux-cli-tool.md +++ b/content/ru/python-lifehacks/how-to-easily-write-linux-cli-tool.md @@ -1,6 +1,8 @@ --- title: "Python: Как легко написать CLI инструмент для Linux с помощью Fire" -date: "2023-04-09" +category: python-lifehacks +filename: how-to-easily-write-linux-cli-tool +date: 2023-04-09 --- Хочу поделиться самым простым из известных мне способов написать CLI инструмент для администрирования Linux на Python. diff --git a/content/ru/python-programming/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 similarity index 95% rename from content/ru/python-programming/how-to-load-multiple-web-pages-in-parallel-using-python.md rename to content/ru/python-lifehacks/how-to-load-multiple-web-pages-in-parallel-using-python.md index 8931778..7915487 100644 --- a/content/ru/python-programming/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 @@ -1,6 +1,8 @@ --- title: "Python: Как параллельно загрузить несколько веб-страниц" -date: "2022-05-15" +category: python-lifehacks +filename: how-to-load-multiple-web-pages-in-parallel-using-python +date: 2022-05-15 --- Сначала нужно установить пакет `aiohttp`. Для установки aiohttp выполните команду: 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 5740b38..b6ed34f 100644 --- a/content/ru/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md +++ b/content/ru/ubuntu-lifehacks/ubuntu-how-to-upgrade-kernel.md @@ -1,6 +1,8 @@ --- title: "Ubuntu: Как обновить ядро" -date: "2022-05-14" +category: ubuntu-lifehacks +filename: ubuntu-how-to-upgrade-kernel +date: 2022-05-14 --- ### Первый способ Первый способ очень прост. Нам нужно ввести в терминале всего одну команду: diff --git a/static/admin/config.yml b/static/admin/config.yml new file mode 100644 index 0000000..86fbd65 --- /dev/null +++ b/static/admin/config.yml @@ -0,0 +1,51 @@ +backend: + name: git-gateway + +local_backend: true + +# These lines should *not* be indented +media_folder: "static/images" # Media files will be stored in the repo under static/images/uploads +public_folder: "/images" # The src attribute for uploaded media will begin with /images/uploads + +i18n: + structure: multiple_folders + locales: [en, ru] + +collections: + - name: posts + label: Posts + label_singular: Post + folder: content + path: '{{category}}/{{slug}}' + slug: '{{filename}}{{extension}}' + create: true + i18n: true + view_groups: + - label: Year + field: date + # groups items based on the value matched by the pattern + pattern: \d{4} + - label: Category + field: category + fields: + - label: Title + name: title + widget: string + i18n: true + - label: "Category" + name: "category" + widget: "select" + options: ["/", "linux-lifehacks", "nginx-lifehacks", "python-lifehacks", "ubuntu-lifehacks"] + i18n: duplicate + - label: Filename + name: filename + widget: string + i18n: duplicate + - label: Date + name: date + widget: datetime + i18n: duplicate + - label: Body + name: body + widget: markdown + i18n: true \ No newline at end of file diff --git a/static/admin/index.html b/static/admin/index.html new file mode 100644 index 0000000..3014310 --- /dev/null +++ b/static/admin/index.html @@ -0,0 +1,13 @@ + + + + + + + Content Manager + + + + + + \ No newline at end of file diff --git a/static/images/start-tor-browser.desktop b/static/images/start-tor-browser.desktop new file mode 100644 index 0000000..b1f83c6 --- /dev/null +++ b/static/images/start-tor-browser.desktop @@ -0,0 +1,34 @@ +#!/usr/bin/env ./Browser/execdesktop +# +# This file is a self-modifying .desktop file that can be run from the shell. +# It preserves arguments and environment for the start-tor-browser script. +# +# Run './start-tor-browser.desktop --help' to display the full set of options. +# +# When invoked from the shell, this file must always be in a Tor Browser root +# directory. When run from the file manager or desktop GUI, it is relocatable. +# +# After first invocation, it will update itself with the absolute path to the +# current TBB location, to support relocation of this .desktop file for GUI +# invocation. You can also add Tor Browser to your desktop's application menu +# by running './start-tor-browser.desktop --register-app' +# +# If you use --register-app, and then relocate your TBB directory, Tor Browser +# will no longer launch from your desktop's app launcher/dock. However, if you +# re-run --register-app from inside that new directory, the script +# will correct the absolute paths and re-register itself. +# +# This file will also still function if the path changes when TBB is used as a +# portable app, so long as it is run directly from that new directory, either +# via the shell or via the file manager. + +[Desktop Entry] +Type=Application +Name=Tor Browser +GenericName=Web Browser +Comment=Tor Browser is +1 for privacy and −1 for mass surveillance +Categories=Network;WebBrowser;Security; +Exec=sh -c '"/opt/tor-browser/Browser/start-tor-browser" --detach || ([ ! -x "/opt/tor-browser/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k +X-TorBrowser-ExecShell=./Browser/start-tor-browser --detach +Icon=/opt/tor-browser/Browser/browser/chrome/icons/default/default128.png +StartupWMClass=Tor Browser diff --git a/themes/ds b/themes/ds index 863541e..7b804f0 160000 --- a/themes/ds +++ b/themes/ds @@ -1 +1 @@ -Subproject commit 863541e3da6d4a0664236da0df28359feb1a6f1c +Subproject commit 7b804f0652726cce1f259ccc893afd1db4e3acc6