Skip to content

Instantly share code, notes, and snippets.

View bubeha's full-sized avatar
👺

Aleksandr Bubeshko bubeha

👺
View GitHub Profile
DB::statement("ALTER TABLE roles CHANGE COLUMN role role ENUM('system admin', 'super admin', 'admin staff', 'instructor', 'customer', 'gym member', 'swim member')");
@bubeha
bubeha / SQL task
Last active November 11, 2021 12:59
CREATE TABLE IF NOT EXISTS `evaluations` (
`user_id` INT unsigned NOT NULL, -- ID пользователя
`department_id` INT unsigned NOT NULL, -- ID департамента
`gender` TINYINT(1) NOT NULL, -- 1 — мужчина, 0 — женщина
`value` INT NOT NULL)
ENGINE = innodb
DEFAULT CHARSET=utf8;
-- Условие:
-- Выбрать без join-ов и подзапросов все департаменты,
@bubeha
bubeha / .vimrc
Last active March 23, 2021 17:11
vim settings
imap jj <Esc>
set timeoutlen=1000
set autochdir
set·lcs+=space:·
set·list
autocmd BufEnter * silent! lcd %:p:h
@bubeha
bubeha / gist:e3f02d3b54fac186d7ac820ef0aaf8f3
Last active January 6, 2021 09:07
Nginx Cache Control and GZIP
location ~* ^.+\.(rss|atom|jpg|jpeg|gif|png|ico|rtf|js|css)$ {
expires max;
}
gzip on;
gzip_comp_level 5;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
@bubeha
bubeha / gist:785c46adc7461a21cdc3a57038ccde36
Created November 7, 2020 14:03
MYSQL. Create database and user for it
create database <database-name> collate utf8_bin;
create user <user-name> identified by '<password>';
grant all privileges on <database-name>.* to <user-name>;
grant process on *.* to <user-name>;
@bubeha
bubeha / gist:7311d582d0a6389f6e297ab9db0835d7
Last active September 30, 2020 12:17
SSL certificates + NGINX
openssl pkcs12 -in ./YOUR-PFX-FILE.pfx -clcerts -nokeys -out domain.crt
openssl pkcs12 -in ./YOUR-PFX-FILE.pfx -nocerts -nodes -out domain.rsa
server {
listen 443 ssl;
server_name domain.com www.domain.com;
ssl_certificate /path/to/your/CRT_file/domain.crt;
ssl_certificate_key /path/to/your/RSA_file/domain.rsa;
root /mnt/coming-soon/bushbeans;
@bubeha
bubeha / cloudSettings
Last active July 8, 2020 08:41
vscode sync
{"lastUpload":"2020-07-08T08:41:29.939Z","extensionVersion":"v3.4.3"}

SHOW CROD LOGS:

sudo tail -f /var/log/syslog | grep CRON

EIT CRON JOBS

sudo crontab -e

SHOW CRON JOBS

sudo crontab -l

EDIT CRON JOBS in custom user

sudo sysctl -w vm.max_map_count=262144
@bubeha
bubeha / .zshrc
Created September 20, 2019 07:17
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/{USER}/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes