This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('STOP_STATISTICS', true); | |
| define('BX_SECURITY_SHOW_MESSAGE', true); | |
| define("NOT_CHECK_PERMISSIONS", true); | |
| $_SERVER['DOCUMENT_ROOT'] = '/home/bitrix/www'; | |
| require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'); | |
| $arFilter = ['ACTIVE' => 'Y']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location /video { | |
| rewrite ^/video/(.*)$ /access.php?path=$1; | |
| aio on; | |
| directio 512; | |
| output_buffers 1 8m; | |
| } | |
| location /files { | |
| internal; | |
| root /mnt/media/upload; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * User: Feiron | |
| * Date: 15.05.2020 | |
| */ | |
| namespace Fei\Core\Export; | |
| use PhpOffice\PhpSpreadsheet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $arFilter = ['ACTIVE' => 'Y']; | |
| $dbUsers = \Bitrix\Main\UserTable::getList(['filter' => $arFilter]); | |
| echo '<pre>'; | |
| var_dump($dbUsers->getSelectedRowsCount()); | |
| echo '</pre>'; | |
| foreach ($dbUsers as $arUser) { | |
| $userId = $arUser['ID']; | |
| if($userId == 326){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('STOP_STATISTICS', true); | |
| define('BX_SECURITY_SHOW_MESSAGE', true); | |
| define("NOT_CHECK_PERMISSIONS", true); | |
| $_SERVER['DOCUMENT_ROOT'] = '/home/bitrix/www'; | |
| require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Делаем просто архив | |
| tar czf name_of_archive_file.tar.gz name_of_directory_to_tar | |
| tar cvf some.tar file1 file2 file3 | |
| #Исключаем директорию | |
| tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz . | |
| #пример | |
| tar --exclude='./.git' -zcvf www_feiron.tar.gz . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| log_format real_ip '$http_x_forwarded_for - $remote_user [$time_local] ' | |
| '"$request" $status $body_bytes_sent ' | |
| '"$http_referer" "$http_user_agent"'; | |
| access_log /var/log/nginx/access.log real_ip; | |
| # Доверенные прокси — IP-диапазоны Cloudflare | |
| set_real_ip_from 103.21.244.0/22; | |
| set_real_ip_from 103.22.200.0/22; | |
| set_real_ip_from 103.31.4.0/22; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $iUserID = CBPHelper::StripUserPrefix("{{Кем создан}}"); | |
| $arAbsenceDates = \CIntranetUtils::GetAbsenceData( | |
| array( | |
| 'USERS' => array($iUserID), | |
| 'DATE_START' => '01.01.' . date('Y'), | |
| 'DATE_FINISH' => ConvertTimeStamp(false, 'SHORT'), | |
| 'PER_USER' => false | |
| ), | |
| $MODE = BX_INTRANET_ABSENCE_ALL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # === НАСТРОЙКИ === | |
| BACKUP_DIR="/var/backups/mysite" # Папка для хранения резервных копий | |
| SITE_DIR="/var/www/mysite" # Папка сайта | |
| DB_NAME="mydatabase" # Имя базы данных | |
| DB_USER="dbuser" # Пользователь MySQL | |
| DB_PASS="dbpassword" # Пароль MySQL | |
| MAX_BACKUPS=5 # Максимальное количество копий | |
| DATE=$(date +"%Y-%m-%d_%H-%M-%S") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| -- Если ошибка не могу отключить пользователя через настройки модуля | |
| */ | |
| \CModule::IncludeModule('disk'); | |
| use Bitrix\Disk\Configuration; | |
| use Bitrix\Disk\Document\BitrixHandler; | |
| use Bitrix\Disk\UserConfiguration; | |
| \Bitrix\Main\Loader::requireModule('disk'); | |
| (new \Bitrix\Disk\Document\OnlyOffice\Configuration())->resetCloudRegistration(); | |
| UserConfiguration::resetDocumentServiceForAllUsers(); |
NewerOlder