This file contains 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
import functools | |
from datetime import datetime | |
class measure_execution_time: | |
""" | |
Декоратор и контекстный менеджер для измерения времени выполнения кода | |
Примеры использования |
This file contains 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 | |
function ljust($str, $len, $fill_char) { | |
$str_len = mb_strlen($str); | |
$out = range(0, max($str_len, $len)); | |
$out_len = count($out); | |
for ($i = 0; $i < $out_len; $i++) | |
$out[$i] = $i < $str_len ? mb_substr($str, $i, 1) : $fill_char; | |
return implode("", $out); |
This file contains 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
-- BE ATTENTIVE BEFORE USE! | |
SELECT DATABASE() INTO @db; | |
DO | |
@qdrop := CONCAT("DROP DATABASE `", @db, "`"), | |
@qcreate := CONCAT("CREATE DATABASE `", @db, "` /*!40100 COLLATE 'utf8mb4_general_ci' */"); | |
PREPARE stmt FROM @qdrop; | |
EXECUTE stmt; |
This file contains 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 | |
# Place of packups | |
path=/mnt/raid1/backup/astra | |
# Astra admin login/pass | |
auth=admin:password | |
# List of ip`s of servers | |
servers=( |