Skip to content

Instantly share code, notes, and snippets.

View webarchitect609's full-sized avatar

Gripinskiy Sergey webarchitect609

View GitHub Profile
@webarchitect609
webarchitect609 / install_ansible.sh
Last active February 24, 2019 12:30
Install Ansible @ Ubuntu
# From https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-releases-via-apt-ubuntu
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get update
sudo apt-get install --yes software-properties-common ansible
@webarchitect609
webarchitect609 / sudoers
Last active February 24, 2019 12:36
Passwordless sudo
# $ sudo visudo
# should be applied
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
@webarchitect609
webarchitect609 / README.md
Last active March 19, 2019 07:27
SprintMigrationBase temporary stub

Быстрый переход на adv/bitrix-tools 2.0

(Инструкция подходит в случае, когда миграции зависят от Adv\Bitrixtools\Migration\SprintMigrationBase.php)

1 Создать в подходящем месте класс SprintMigrationBase на основе шаблона SprintMigrationBase.php . Например, его FQN = Acme\AcmeBundle\Migrations\SprintMigrationBase

2 Заменить во всех файлах Adv\Bitrixtools\Migration\SprintMigrationBase на Acme\AcmeBundle\Migrations\SprintMigrationBase (FQN SprintMigrationBase в конкретной библиотеке, бандле)

3 Проконтролировать, чтобы в конфиге миграций опция migration_extend_class также указывала на Acme\AcmeBundle\Migrations\SprintMigrationBase

@webarchitect609
webarchitect609 / mutual_file_access_in_linux.md
Last active April 12, 2019 10:04
Организация общего доступа к файлам для нескольких пользователей в Linux
  • Шаг 1: создать группу пользователей. Например, developers

  • Шаг 2: добавить в группу пользователей. Например, petrov и bashirov входят в группу developers

  • Шаг 3: изменить umask на 0002 для всех этих пользователей. Обычно это делается в файле ~/.profile командой umask 002

  • Шаг 4: изменить принадлежность той директории, в которой будет вестись совместная работа( например, vhosts ), группе developers. sudo chown :developers vhosts

@webarchitect609
webarchitect609 / Template Variables
Last active August 7, 2020 18:03
Bitrix Getter PhpStorm Live Template (Demo version)
Name Expression Default Value Skip if defined
START
TYPE enum("string", "array", "int", "float", "bool")
NAME capitalize(camelCase(substringBefore(START, "_VALUE"))) true
@webarchitect609
webarchitect609 / bx_remove_personal_data.sql
Last active February 9, 2024 14:30
SQL-скрипт удаления персональных данных из Битрикс в версии Интернет-магазина
-- Удалить все свойства корзины, которые связаны с корзинами, которые связаны с заказами, вместе с этими корзинами и заказами
-- ATTENTION! Этот запрос ОЧЕНЬ долгий. Соединение с базой может отвалиться по таймауту!
-- TODO Попытаться добавить защиту от долго выполняющегося запроса.
delete BP, B, O
from b_sale_basket_props as BP
inner join b_sale_basket as B
on BP.BASKET_ID = B.ID
inner join b_sale_order as O
on B.ORDER_ID = O.ID
where B.ORDER_ID is not null;
@webarchitect609
webarchitect609 / terminal.sh
Last active June 20, 2024 12:21
Git: disable GPG signing for current repo only.
# Write local
git config --local commit.gpgsign false
# Read local (if never set, can be an empty value)
git config --local commit.gpgsign
@webarchitect609
webarchitect609 / php8_docker.sh
Last active May 6, 2024 08:41
Quick docker PHP 8 setup for composer and unit testing
# Terminal Tab #1 (with privileges inside container)
# =============
cd "/the/dir/you/want/to/work/with/php8"
docker run --name php8 \
-it \
-v $PWD:/var/php:rw \
php:8.0-cli-alpine3.12 \
ash
cd /tmp
@webarchitect609
webarchitect609 / jira_inline_image.md
Last active October 10, 2023 11:24
Inline images for Jira markup

Inline image as is

Find:

http(s)?:\/\/[^\s]+\.(gif|png|jpg|jpeg)

Replace:

[!$0!|$0]
@webarchitect609
webarchitect609 / regexp.txt
Last active February 12, 2021 10:05
Convert a list of composer packages from composer.json to the `composer install` command line arguments
# Find
("[^"]+":)\s+("[^"]+")\n
# Replace(with the space at the end!)
$1$2
# Example
# Before: