Skip to content

Instantly share code, notes, and snippets.

View pashamray's full-sized avatar
:octocat:

Pavlo Shamrai pashamray

:octocat:
View GitHub Profile
@pashamray
pashamray / check_foreign_keys.md
Created November 26, 2023 15:27
check exists foreign keys
SELECT refcons.TABLE_NAME,
       refcons.REFERENCED_TABLE_NAME,
       refcons.CONSTRAINT_NAME,
       keycol.COLUMN_NAME
FROM information_schema.REFERENTIAL_CONSTRAINTS refcons
         JOIN information_schema.KEY_COLUMN_USAGE keycol ON (
            refcons.CONSTRAINT_SCHEMA = keycol.TABLE_SCHEMA AND
            refcons.TABLE_NAME = keycol.TABLE_NAME AND
 refcons.CONSTRAINT_NAME = keycol.CONSTRAINT_NAME)
@pashamray
pashamray / docker-compose.yml
Created September 11, 2018 10:33
envsubst for nginx
version: "3"
services:
web:
build: nginx
volumes:
- ${SITE_DIR}:/var/www/${SITE_NAME}
- ./nginx/frontend.template:/etc/nginx/conf.d/frontend.template
- ./data/var/log/nginx:/var/log/nginx
- ./data/var/log/nginx/${SITE_NAME}:/var/log/nginx/${SITE_NAME}
- /etc/localtime:/etc/localtime:ro
@pashamray
pashamray / Dockerfile
Created September 11, 2018 05:39
Docker PHP FPM 7.1.3
FROM php:7.1.3-fpm
RUN apt-get update && apt-get install -y git zip unzip libz-dev zlib1g-dev libc-client-dev libkrb5-dev libicu-dev g++ libmcrypt-dev \
mysql-client libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install mcrypt pdo_mysql \
&& docker-php-ext-install mbstring \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap \
version: "3"
services:
adminer:
build: adminer
restart: always
ports:
- 8181:8080
depends_on:
- mysql
networks:
period = 1 S / 50 Hz = 20 mS
half_period = period / 2 = 10 mS
pwm_period = 1 S / 24000 kHz = 41,666666667 uS
half_period_us = 10 mS * 1000 = 10000 uS
pwm_steps = half_period_us / pwm_period = 10000 uS / 41,6 uS = 240,3846
round_pwm_steps = 240
@pashamray
pashamray / launch.json
Created August 16, 2018 15:38
VSCode GDB for arm-none-eabi-gdb
{
// Используйте IntelliSense, чтобы узнать о возможных атрибутах.
// Наведите указатель мыши, чтобы просмотреть описания существующих атрибутов.
// Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "GDB",
"type": "gdb",
"request": "launch",
<?php
/**
* Created by PhpStorm.
* User: ps
* Date: 14.06.18
* Time: 9:23
*/
$ranges = [
6000 => 1986,

/ip firewall filter

add action=jump chain=input comment="sshbruteforces chain" connection-state=
new dst-port=22 jump-target=sshbruteforces protocol=tcp add action=drop chain=sshbruteforces comment="drop ssh brute forcers"
src-address-list=ssh_blacklist add action=add-src-to-address-list address-list=ssh_blacklist
address-list-timeout=1w3d chain=sshbruteforces connection-state=new
src-address-list=ssh_stage3 add action=add-src-to-address-list address-list=ssh_stage3 \