Skip to content

Instantly share code, notes, and snippets.

View Feiron's full-sized avatar

Vadim Petrov Feiron

View GitHub Profile
@Feiron
Feiron / check.sh
Created April 22, 2024 11:17
[Проверить порт] #centos #linux #utils
cat < /dev/tcp/mail.localhost.ru/22
@Feiron
Feiron / bash.sh
Last active August 9, 2023 12:01
[HDD] Форматирование диск #centos #linux #hardware #bitrixvm
sudo lsblk -o name,mountpoint,label,size,uuid
fdisk -l
mkfs -t ext4 /dev/ssd #mkfs -t xfs /dev/ssd
mkdir mntssd
mount /dev/ssd mntssd
mc -e /etc/fstab
/dev/ssd /mntssd ext4 defaults 0 2
mount -a
@Feiron
Feiron / .settings_extra.php
Last active February 14, 2023 08:49
[memcached socket] Сокет мемкеша #centos #bitrix #memcached #bitrixvm
<?php
return array (
'cache' => array(
'value' => array (
'type' => 'memcache',
'memcache' => array(
'host' => 'unix:///tmp/memcached.sock',
'port' => '0'
),
'sid' => $_SERVER["DOCUMENT_ROOT"]."#01"
@Feiron
Feiron / bash.sh
Created January 20, 2022 11:26
[sshfs] mount disk via ssh #centos
sudo yum install -y sshfs
sshfs root@127.0.0.1:/ /var/mnt/
@Feiron
Feiron / bash.sh
Last active October 22, 2021 10:55
[Change all tables encoding] #mysql #centos
mysqldump --user=username --password=password --default-character-set=latin1 --skip-set-charset dbname > dump.sql
sed -r 's/latin1/utf8/g' dump.sql > dump_utf.sql
mysql --user=username --password=password --execute="DROP DATABASE dbname; CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql --user=username --password=password --default-character-set=utf8 dbname < dump_utf.sql
@Feiron
Feiron / socket.php
Last active December 16, 2021 15:28
[sockets test] проверить конект через сокет #bitrix #centos #bitrixvm #tests
<?php
//title: SocketTest
ini_set("display_errors", true);
error_reporting(6135);
$a = fsockopen ("ssl://pub.bitrix24.site", 443, $b, $c, 5);
echo $a, $b, $c;
@Feiron
Feiron / result_modifier.php
Last active July 20, 2021 11:39
[Image resize] #bitrix #examples #image
<?php
/**
* Images resize on the fly
**/
$arParams['THUMB']['width'] = 48;
$arParams['THUMB']['height'] = 48;
$arParams['PREVIEW_PICTURE']['height'] = 275;
$arParams['PREVIEW_PICTURE']['width'] = 350;
$arFilter = array("name" => "sharpen", "precision" => 90);
@Feiron
Feiron / ajax.php
Created April 2, 2021 14:00
[Bitrix HXR] #bitrix #ajax
<?php
define('STOP_STATISTICS', true);
define('BX_SECURITY_SHOW_MESSAGE', true);
define("NO_KEEP_STATISTIC", true);
define("NO_AGENT_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
use Bitrix\Main\Application;
@Feiron
Feiron / index.txt
Last active March 24, 2021 11:47
[MC] Guide #centos
http://www.softpanorama.org/OFM/MC/mc_tips.shtml
For directories history and whenever it is present Alt-y moves to the previous directory in the history, equivalent to clicking the < with the mouse.
[Alt-u] moves to the next directory in the history, equivalent to clicking the > with the mouse.
[Alt-Shift-h, Alt-H] displays the directory history, equivalent to depressing the 'v' with the mouse.
[Alt-p, Alt-n] use these keys to browse through the command history. Alt-p takes you to the last entry, Alt-n takes you to the next one.
[Alt-h] displays the history for the current input line.
@Feiron
Feiron / dialogs.messagebox.js
Last active March 1, 2021 12:45
[Popup messages] Отправка сообщений битриксом #bitrix #ui
BX.UI.Dialogs.MessageBox.confirm("Message");
BX.UI.Dialogs.MessageBox.confirm("Message", () => {});
BX.UI.Dialogs.MessageBox.confirm("Message", () => {}, "Продолжить");
BX.UI.Dialogs.MessageBox.confirm("Message", () => {}, "Продолжить", () => {});
BX.UI.Dialogs.MessageBox.confirm("Message", "Title");
BX.UI.Dialogs.MessageBox.confirm("Message", "Title", () => {});
BX.UI.Dialogs.MessageBox.confirm("Message", "Title", () => {}, "Продолжить", () => {});
//https://dev.1c-bitrix.ru/api_d7/bitrix/ui/dialogs/dialogs.php