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
# create ftp dir | |
mkdir -p /ftp/ftp-user | |
# change creds | |
chmod 0777 -R /ftp | |
# run vsftp | |
docker run --rm -it \ | |
--name ftpd_server \ | |
-p 21:21 \ | |
-p 20:20 \ |
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
# create data dirs | |
mkdir -p /mysql/data/db | |
mkdir -p /mysql/conf | |
# customizing mysql instance | |
echo [mysqld] > /mysql/conf/custom_options.cnf | |
echo innodb_buffer_pool_size=100M >> /mysql/conf/custom_options.cnf | |
# run mysql image | |
docker run -d --name mysql-db \ |
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 argparse | |
import json | |
import subprocess | |
from collections import defaultdict | |
def _execute(*args) -> str: | |
p = subprocess.Popen(args, stdout=subprocess.PIPE) | |
res, _ = p.communicate() | |
return res.decode('utf8') |
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
def set_cls_attrs(**injected_attrs): | |
def wrap_cls(cls): | |
# inject new class attr | |
for _attr_name, _attr_val in injected_attrs.items(): | |
setattr(cls, _attr_name, _attr_val) | |
# wrapper class based on original cls | |
class wrapper_cls(cls): | |
def __init__(self, *args, **kw): |