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
show status like 'wsrep%'; | |
SELECT * FROM performance_schema.data_locks; | |
SELECT * FROM performance_schema.processlist; | |
SHOW VARIABLES LIKE 'validate_password%'; | |
SET GLOBAL validate_password.policy = LOW; | |
CREATE USER 'sstuser'@'localhost' IDENTIFIED BY 's3cretPass'; |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
# Добавить пользователя в sudo, для перехода под рут | |
su root | |
# install sudo | |
apt-get install sudo -y | |
# add user "ichi" | |
sudo adduser ichi | |
# добавить в группу судо | |
sudo usermod -aG sudo <username> | |
# перезайти | |
sudo apt update |
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 | |
/** | |
* Make asynchronous requests to different resources as fast as possible and process the results as they are ready. | |
*/ | |
class Requests | |
{ | |
public $handle; | |
public function __construct() | |
{ |
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 | |
// подключаемся к БД | |
$db = new PDO('sqlite:db/pages.sqlite'); | |
// посмотреть другие атрибуты https://www.php.net/manual/ru/pdo.setattribute.php | |
// ответ ассоциативный массив | |
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); | |
// PDO будет генерировать исключение | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
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
# проверить работу | |
sudo apt policy redis-server | |
# установить | |
sudo apt install redis-server | |
# запустить | |
sudo service redis-server start | |
# проверить |
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 | |
namespace App\Model; | |
use Illuminate\Database\Eloquent\Model; | |
class User extends Model | |
{ | |
public static function currentUser(): User | |
{ |
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 | |
class Errors extends Exception implements Countable | |
{ | |
protected array $errors = []; | |
public function addError(Throwable $e) { | |
$this->errors[] = $e; | |
} |
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
/* null margins and padding to give good cross-browser baseline */ | |
html, body, address, blockquote, div, | |
form, fieldset, caption, | |
h1, h2, h3, h4, h5, h6, | |
hr, ul, li, ol, ul, dl, dt, dd, | |
table, tr, td, th, p, img { | |
margin:0; | |
padding:0; | |
} |
NewerOlder