diff --git a/content/posts/ald-pro.md b/content/posts/ald-pro.md index e6f58d6..3e4ee99 100644 --- a/content/posts/ald-pro.md +++ b/content/posts/ald-pro.md @@ -8,7 +8,7 @@ tags: [linux, astra, krb5] В файл `/etc/hosts` необходимо добавить ip и fqdn DC: -```sh +```config . ``` @@ -20,7 +20,7 @@ hostnamectl set-hostname . ## Добавление репозиториев ALD Pro В файл `/etc/apt/sources.list.d/aldpro.list` необходимо добавить репозиторий ALD Pro: -```sh +```config deb https://download.astralinux.ru/aldpro/stable/repository-main/ 1.0.0 main deb https://download.astralinux.ru/aldpro/stable/repository-extended/ generic main ``` @@ -28,7 +28,7 @@ deb https://download.astralinux.ru/aldpro/stable/repository-extended/ generic ma ## Выставление приоритета репозиториев В файле `/etc/apt/preferences.d/aldpro` необходимо выставить приоритет репозиториев: -```sh +```config Package: * Pin: release n=generic Pin-Priority: 900 diff --git a/content/posts/astra-freeipa.md b/content/posts/astra-freeipa.md index 810dfb2..99da0de 100644 --- a/content/posts/astra-freeipa.md +++ b/content/posts/astra-freeipa.md @@ -9,7 +9,7 @@ tags: [linux, astra, krb5, freeipa] ### Создания сетевой видимости На клиенте и DC необходимо в файл `/etc/hosts` добавить оба ip и fqdn: -```sh +```config . . ``` diff --git a/content/posts/bareos-install.md b/content/posts/bareos-install.md index 3f27acf..bbc4e19 100644 --- a/content/posts/bareos-install.md +++ b/content/posts/bareos-install.md @@ -37,7 +37,7 @@ exit ### Бэкап определённой папки В файл `/etc/bareos/bareos-dir.d/fileset/.conf` необходимо добавить настройку бэкапа определённой папки: -```sh +```config FileSet { Name = "" Description = "" diff --git a/content/posts/cifs-automount.md b/content/posts/cifs-automount.md index 5c6a6c5..7154fc7 100644 --- a/content/posts/cifs-automount.md +++ b/content/posts/cifs-automount.md @@ -12,7 +12,7 @@ apt install cifs-utils -y ## Создание файла с данными УЗ В файл `/root/.smbuser` необходимо добавить данные УЗ для подключения к шаре: -```sh +```config username= password= domain= @@ -25,7 +25,7 @@ sudo chmod 0400 /root/.smbuser ## Развёртывание В `/etc/fstab` необходимо добавить строку подключения к шаре: -```sh +```config //
/ cifs credentials=/root/.smbuser,uid=,gid= 0 0 ``` diff --git a/content/posts/dhcp-resolv.md b/content/posts/dhcp-resolv.md index cc3e9c0..7122dc9 100644 --- a/content/posts/dhcp-resolv.md +++ b/content/posts/dhcp-resolv.md @@ -8,7 +8,7 @@ tags: [linux] Неприятно, когда конфиг не даёт поменять себя ручками, да? В `/etc/dhcp/dhclient.conf` необходимо добавить строки перезаписи: -```sh +```config supersede domain-name-servers , ; supersede domain-name ""; ``` diff --git a/content/posts/envip.md b/content/posts/envip.md index a96baa5..07ec14c 100644 --- a/content/posts/envip.md +++ b/content/posts/envip.md @@ -14,7 +14,7 @@ tags: [linux, caddy] ### Caddy В Caddyfile необходимо добавить секцию с поддоменом для обновления whitelist (необходимо заменить [строку basic auth](https://caddyserver.com/docs/caddyfile/directives/basicauth)): -```sh +```config wh. { @block { not client_ip {$WHITE_LIST} @@ -32,7 +32,7 @@ wh. { ``` Пример поддомена, доступ до которого разрешён только с IP из whitelist: -```sh +```config sub. { @block { not client_ip {$WHITE_LIST} @@ -45,7 +45,7 @@ sub. { ``` В `caddy.service` необходимо добавить следующую строку в секцию `[Service]`: -```sh +```config Environment="WHITE_LIST=127.0.0.1/8" ``` diff --git a/content/posts/linux-krb5.md b/content/posts/linux-krb5.md index ee11576..90c60bf 100644 --- a/content/posts/linux-krb5.md +++ b/content/posts/linux-krb5.md @@ -28,14 +28,14 @@ hostnamectl set-hostname ### Правка файла hosts Вместо правки файла `/etc/hosts` можно поднять DNS-сервер и сделать записи там. -```sh +```config ``` ### Редактирование конфига Kerberos В `/etc/krb5.conf` необходимо добавить данные а реалме и kdc: -```sh +```config [libdefaults] default_realm = @@ -69,7 +69,7 @@ quit ### Разрешение административных прав Добавляем администратора в `/etc/krb5kdc/kadm5.acl`: -```sh +```config /admin ``` diff --git a/content/posts/linux-nfs.md b/content/posts/linux-nfs.md index 56d8199..17c32c4 100644 --- a/content/posts/linux-nfs.md +++ b/content/posts/linux-nfs.md @@ -20,7 +20,7 @@ chmod 777 /nfs ### Разрешение сетевого доступа В файл `/etc/exports` необходимо добавить следующую строку: -```sh +```config /nfs (rw,sync,no_root_squash,no_subtree_check) ``` diff --git a/content/posts/postgres-krb5.md b/content/posts/postgres-krb5.md index 5100aa1..a4bd260 100644 --- a/content/posts/postgres-krb5.md +++ b/content/posts/postgres-krb5.md @@ -46,7 +46,7 @@ q ### Изменение конфигруационного файла Postgres Pro В файл `/var/lib/pgpro/std-*/data/postgresql.conf` необходимо добавить следующие строки: -```sh +```config krb_server_keyfile = 'postgres.keytab' listen_addresses = 'localhost, ' ``` @@ -54,7 +54,7 @@ listen_addresses = 'localhost, ' ### Разрешение подключения В файл `/var/lib/pgpro/std-*/data/pg_hba.conf` необходимо добавить следующие строки: -```sh +```config hostgssenc all postgres localhost/32 gss include_realm=0 hostgssenc /32 gss include_realm=0 ``` diff --git a/content/posts/postgres-ldaps.md b/content/posts/postgres-ldaps.md index 5a95a9b..47318e4 100644 --- a/content/posts/postgres-ldaps.md +++ b/content/posts/postgres-ldaps.md @@ -22,7 +22,7 @@ apt install ldap-utils -y ## Правка ldap конфига В файл `/etc/ldap/ldap.conf` необходимо добавить следующие строки: -```sh +```config TLS_CACERT /etc/ldap/.pem BASE dc=,dc= URI ldaps://..:636 @@ -35,7 +35,7 @@ ldapsearch -x -b "dc=,dc=" -H ldaps://..:636 - ## Правка pg_hba.conf С ldapprefix/ldapsuffix в файле `/var/lib/pgpro/std-14/data/pg_hba.conf`, возможно, придётся поколдовать. Стоит попробовать их оставить пустыми (=""). -```sh +```config host / ldap ldapserver=.. ldapscheme=ldaps ldapprefix="cn=" ldapsuffix=",cn=users,dc=,dc=" ``` diff --git a/content/posts/postgres-replication.md b/content/posts/postgres-replication.md index f538d2a..1b2dbcb 100644 --- a/content/posts/postgres-replication.md +++ b/content/posts/postgres-replication.md @@ -24,14 +24,14 @@ psql -c "CREATE ROLE repuser WITH REPLICATION LOGIN ENCRYPTED PASSWORD '/32 md5 ``` #### Реконфигурация В файл `/var/lib/pgpro/std-13/data/postgresql.conf` необходимо добавить следующие строки: -```sh +```config listen_addresses = 'localhost, ' wal_level = hot_standby archive_mode = on @@ -63,7 +63,7 @@ WAL-архивы будут складываться на NFS. Как сконф ### Дополнение к реконфигурации В файл `/var/lib/pgpro/std-*/data/postgresql.conf` необходимо добавить следующие строки: -```sh +```config archive_command = 'test ! -f /nfs/%f && cp %p /nfs/%f' archive_cleanup_command = 'pg_archivecleanup -d /nfs %r 2>>cleanup.log' ``` @@ -73,7 +73,7 @@ archive_cleanup_command = 'pg_archivecleanup -d /nfs %r 2>>cleanup.log' По умолчанию репликация работает в асинхронном режиме. Для того, чтобы она работала в синхронном режиме, необходимо изменить две строки в конфигурационном файле Postgres Pro `/var/lib/pgpro/std-*/data/postgresql.conf`: -```sh +```config synchronous_commit = on synchronous_standby_names = 'pgsql_0_node_0' ``` diff --git a/content/posts/postgres-simple-backup.md b/content/posts/postgres-simple-backup.md index 265d79f..12b8d43 100644 --- a/content/posts/postgres-simple-backup.md +++ b/content/posts/postgres-simple-backup.md @@ -6,7 +6,7 @@ tags: [linux, postgres] --- ## Скрипт для бэкапа БД и глобальных объектов В файл `/home//pg-backup.sh` необходимо добавить следующие строки: -```sh +```config #!/usr/bin/env bash pg_dump -U -h -Fc --file=-$(date '+%Y-%m-%d').dump @@ -15,7 +15,7 @@ pg_dumpall -U -h --globals --file=gb-$(date '+%Y-%m-%d' ## Файл cron с запуском скрипта (каждый день в 2:00) Необходимо дописать в конец `crontab -e -u ` следующие строки: -```sh +```config 0 2 * * * /usr/bin/env bash /home//pg-backup.sh ``` diff --git a/content/posts/postgres-tls.md b/content/posts/postgres-tls.md index c8f3bdc..dbc467d 100644 --- a/content/posts/postgres-tls.md +++ b/content/posts/postgres-tls.md @@ -13,7 +13,7 @@ openssl req -x509 -newkey rsa:4096 -keyout .pem -out .pem -sha256 -da ## Включение TLS В файл `/var/lib/pgpro/std-*/data/postgresql.conf` необходимо добавить следующие строки: -```sh +```config ssl = on ssl_cert_file = '.pem' ssl_key_file = '.pem' @@ -22,7 +22,7 @@ listen_addresses = 'localhost, ' ## Разрешение доступа через TLS В файл `/var/lib/pgpro/std-*/data/pg_hba.conf` необходимо добавить следующие строки: -```sh +```config hostssl scram-sha-256 ``` diff --git a/content/posts/ruby-packer.md b/content/posts/ruby-packer.md index ba3025a..6b0caa9 100644 --- a/content/posts/ruby-packer.md +++ b/content/posts/ruby-packer.md @@ -65,7 +65,7 @@ chmod +x /usr/local/bin/rubyc ## Правка запускаемого файла собираемой утилиты В запускаемый файл `exe/` (обычно лежит в exe или bin) необходимо добавить в самое начало следующие строки: -```sh +```config #!/usr/bin/env ruby require 'rubygems' diff --git a/content/posts/ssh-2fa-totp.md b/content/posts/ssh-2fa-totp.md index 116a415..d401b6c 100644 --- a/content/posts/ssh-2fa-totp.md +++ b/content/posts/ssh-2fa-totp.md @@ -17,7 +17,7 @@ auth required pam_google_authenticator.so ``` ## Правка конфига ssh -```sh +```config ChallengeResponseAuthentication yes # /etc/ssh/sshd_config @@ -33,14 +33,14 @@ google-authenticator ## Управление факторами (необязательно) Включить запрос ключа при аутентификации: -```sh +```config AuthenticationMethods publickey,password publickey,keyboard-interactive # /etc/ssh/sshd_config ``` Отключить запрос пароля при аутентификации: -```sh +```config #@include common-auth # /etc/pam.d/sshd diff --git a/content/posts/ssh-fail2ban.md b/content/posts/ssh-fail2ban.md index e71e703..b160325 100644 --- a/content/posts/ssh-fail2ban.md +++ b/content/posts/ssh-fail2ban.md @@ -10,7 +10,7 @@ apt -y install fail2ban ``` ## Правило для ssh -```sh +```config [sshd] enabled = true port = diff --git a/content/posts/vmware-clipboard.md b/content/posts/vmware-clipboard.md index 9c3d929..035f6f8 100644 --- a/content/posts/vmware-clipboard.md +++ b/content/posts/vmware-clipboard.md @@ -5,7 +5,7 @@ date: 2022-11-25T15:08:00+05:00 tags: [vmware] --- ## Изменение конфига -```sh +```config vmx.fullpath = "/bin/vmx" isolation.tools.copy.disable="FALSE" isolation.tools.paste.disable="FALSE" diff --git a/content/posts/vmware-restart-date.md b/content/posts/vmware-restart-date.md index 39ead22..875eb93 100644 --- a/content/posts/vmware-restart-date.md +++ b/content/posts/vmware-restart-date.md @@ -5,7 +5,7 @@ date: 2022-11-25T15:18:00+05:00 tags: [vmware] --- ## Изменение скрипта -```sh +```config #!/bin/sh ++group=host/vim/vmvisor/boot esxcli system time set --day=20 --month=3 --year=2022 --hour=10 --min=0 --sec=0 exit 0 diff --git a/content/posts/windows-disable-shutdown.md b/content/posts/windows-disable-shutdown.md index 0bcf432..f9ef5ae 100644 --- a/content/posts/windows-disable-shutdown.md +++ b/content/posts/windows-disable-shutdown.md @@ -6,7 +6,7 @@ tags: [windows] --- ## Отключение В ветке реестра выставить значение value на 1. -```sh +```config Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideShutDown Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideRestart Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideSleep