Skip to content

Instantly share code, notes, and snippets.

View demidovsky's full-sized avatar

Dmitry Demidovsky demidovsky

View GitHub Profile
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
version: '3'
services:
web:
image: gcr.io/.../project-node
restart: always
logging:
options:
max-size: "10M"
max-file: "10"
ports:
@demidovsky
demidovsky / mysql2sqlite.sh
Created September 10, 2018 11:00 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
$args = аргументам в строке запроса;
$arg_name = аргументу name в строке запроса;
$binary_remote_addr = адресу клиента в бинарном виде, длина её значения всегда 4 байта;
$content_length = строке "Content-Length" в заголовке запроса;
$content_type = строке "Content-Type" в заголовке запроса;
$cookie_name = cookie name;
$document_root = значению директивы root для текущего запроса;
$document_uri = $uri;
$host = строке "Host" в заголовке запроса или имени сервера, на который пришёл запрос, если этой строки нет;
$hostname = имени хоста;