Windows Network and Firewall

Block all apps in specified folder to access any network resources outside PC

https://www.tenforums.com/network-sharing/43084-how-block-multiple-exe-files-windows-firewall-post591205.html#post591205

for %%G in (“C:\Program Files (x86)\Test Folder\*.exe”) do (
netsh advfirewall firewall add rule name=”Blocked With Batchfile %%G” dir=in action=block program=”%%G” enable=yes profile=any
netsh advfirewall firewall add rule name=”Blocked With Batchfile %%G” dir=out action=block program=”%%G” enable=yes profile=any
)

Kubernetes

Kubernetes kubectl autocomplete Ubuntu:

https://komodor.com/learn/kubectl-autocomplete-enabling-and-using-in-bash-zsh-and-powershell/
https://stackoverflow.com/a/77694825

apt-get install bash-completion -y
echo ‘source /etc/bash_completion’ >>~/.bashrc
echo ‘source <(kubectl completion bash)’ >>~/.bashrc
source ~/.bashrc

Configure NFS shares in Windows for k8s:

https://operavps.com/docs/install-nfs-server/

Kubernetes autostart Ubuntu:

nano /etc/systemd/system/minikube.service
[Unit]
Description=minikube service autostart
After=docker.service

[Service]
Type=oneshot
ExecStart=/usr/local/bin/minikube –force –driver=docker start
RemainAfterExit=true
ExecStop=/usr/local/bin/minikube stop
StandardOutput=journal
User=root
Group=

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable minikube

reboot

1C info

Очистка кеша 1С8:

Я сделал так:

Скрипт с таким содержимым:
rd /q /s “%userprofile%\AppData\Local\1C\1Cv8\”
rd /q /s “%userprofile%\AppData\Local\1C\1Cv82\”
rd /q /s “%userprofile%\AppData\Local\1C\1Cv83\”
rd /q /s “%userprofile%\AppData\Roaming\1C\1Cv8\”
rd /q /s “%userprofile%\AppData\Roaming\1C\1Cv82\”
rd /q /s “%userprofile%\AppData\Roaming\1C\1Cv83\”
поставил в GPO нужных групп пользователей на выполнение при Logoff

https://www.4isla.ru/poleznoe/it-analitika/ochistka-kesha-1s-predpriyatie/

Общий список баз 1С 8:

Добавляем все нужные базы из-под пользователя в 1С.

В файле c:\ProgramData\1C\1cestart\1cestart.cfg пишем:
CommonInfoBases=\\Путь-до-списка-доступный-всем\список.v8i

Вписываем базы из %userprofile%\AppData\Roaming\1C\1CEStart\ibases.v8i в \\Путь-до-списка-доступный-всем\список.v8i

Очищаем %userprofile%\AppData\Roaming\1C\1CEStart\ibases.v8i

Настройка 1С SQL:

https://www.portal-yug.ru/blog/corp/34.php
https://interface31.ru/tech_it/2014/01/ustanovka-i-nastroyka-ms-sql-server-dlya-1spredpriyatie.html

Перезапуск сервисов 1С и SQL:

Инструкция для перезапуска сервисов 1С+SQL:

1. Снять все зависшие сеансы 1С через Администрирование серверов 1С
2. Остановить службу 1С
3. Подождать минутку, при этом должны быть завершены все процессы rphost, ragent
4. Удалить все процессы, запущенные под доменным пользователем USR1CV8 (под которым запускается служба Агент сервера 1С:Предприятия) – если они есть
5. Удалить содержимое папки C:\Program Files\1Cv8\srvinfo\reg_1541\snccnt
Внимание! не перепутай папку! Внутри папки будет несколько файлов snccntx*.dat, их все удалить, несмотря на предупреждения. Это файлы сеансов 1С.
6. Очистить временную папку пользователя, под которым запускается служба Агент сервера 1С:Предприятия
7. Перезапустить службы SQL (запросит перезапуск зависимой службы Агент SQL сервера)
8. Запустить службу Агент сервера 1С:Предприятия

 

Немного модифицированный батник:

@echo off
set logfile=”C:\Log1C\rest1c.log”

echo >>%logfile%

echo %date% %time% >>%logfile%
net stop “1C:Enterprise 8.3 Server Agent (x86-64)” >>%logfile%
ping -n 60 localhost>Nul

echo %date% %time% >>%logfile%
net stop “SQLSERVERAGENT” >>%logfile%
ping -n 20 localhost>Nul

echo %date% %time% >>%logfile%
net stop “MSSQLSERVER” >>%logfile%
ping -n 300 localhost>Nul

del /f /q “C:\Program Files\1cv8\srvinfo\reg_1541\snccntxb2cd4cc0-6c7c-4c26-9069-1d66fff886b9\*.*” >Nul
echo %date% %time% SRVINFO Cleared >>%logfile%
ping -n 10 localhost>Nul

del /f /s /q “PATH-TO-USERS-PROFILES\USR1CV8\AppData\Local\Temp\*.*” >Nul
echo %date% %time% USR1CV8 Temp Cleared >>%logfile%
ping -n 10 localhost>Nul

echo %date% %time% >>%logfile%
net start “MSSQLSERVER” >>%logfile%
ping -n 120 localhost>Nul

echo %date% %time% >>%logfile%
net start “SQLSERVERAGENT” >>%logfile%
ping -n 20 localhost>Nul

echo %date% %time% >>%logfile%
net start “1C:Enterprise 8.3 Server Agent (x86-64)” >>%logfile%
ping -n 60 localhost>Nul

exit

Спасибо Руслану.

Сброс пароля 1С 8.2 или 8.3 SQL:

https://www.avtomatizator.ru/articles/arkhivnye-novosti/sbros-parolya-1s-8-2-ili-8-3-sql/

IPSEC vpn info

Phase 1 & 2 encryption algorhithms supported in popular Operating Systems:

https://wiki.mikrotik.com/wiki/Manual:IP/IPsec#Windows_client_configuration

 

Create Ipsec connection in Windows with usage of more secure encryption algorhithms:

https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/vpn/how-to-configure-diffie-hellman-protocol-over-ikev2-vpn-connections

https://forum.netgate.com/topic/150670/safe-ikev2-configuration-for-pfsense-and-windows-10-and-macos

https://learn.microsoft.com/en-us/powershell/module/vpnclient/set-vpnconnectionipsecconfiguration?view=windowsserver2022-ps&viewFallbackFrom=win10-ps

Ansible

Ansible: installation, configuration and use with Windows and Linux:

https://247-it.io/en/ansible-installation-configuration-and-use-with-windows-and-linux/

Ansible: organize your hosts in an inventory file in YAML format:

https://247-it.io/en/ansible-organize-your-hosts-in-an-inventory-file-in-yaml-format/
Which GUI management tools should you recommend?
https://www.reddit.com/r/ansible/comments/pejmkm/which_gui_management_tools_should_you_recommend/?rdt=40820

Microsoft RDP and Terminal Services info

Random session disconnects in Windows 11 22H2:

https://learn.microsoft.com/en-us/answers/questions/1021754/windows-11-remote-desktop-frequent-disconnects

Configure “Use only TCP” in Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections

Configure “Turn Off UDP On Client” in Computer Configuration > Administration Templates > Windows Components > Remote Desktop Services > Remote Desktop Connection Client

USB over IP

Thanks to this man:
https://itproblog.ru/%D0%BF%D1%80%D0%BE%D0%B1%D1%80%D0%BE%D1%81-usb-%D1%83%D1%81%D1%82%D1%80%D0%BE%D0%B9%D1%81%D1%82%D0%B2-%D0%BF%D0%BE-%D1%81%D0%B5%D1%82%D0%B8-virtualhere/#Nastrojka_VirtualHere
I’ve found VirtualHere usb sharing software:
https://www.virtualhere.com/

There is a free of charge alternative so you can start free of charge server and use the client specified above also free:
https://habr.com/ru/companies/selectel/articles/668590/
or use alternative client (Windows only)
https://sourceforge.net/projects/usbip/