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
1) Make sure you're stopped the main daemon: sudo systemctl stop docker ; systemctl status docker | |
2) Create your new storage directory: sudo mkdir /storage | |
3) Move existing content to that diractory: sudo mv /var/lib/docker /storage | |
4) Configure daemon to use new directory: sudo nano /etc/docker/daemon.json | |
{ | |
"data-root": "/storage/docker" | |
} | |
5) Start main daemon again: sudo systemctl start docker ; systemctl status docker |
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
# Docker - How to cleanup (unused) resources | |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ... | |
## delete volumes | |
// see: https://github.com/chadoe/docker-cleanup-volumes | |
$ docker volume rm $(docker volume ls -qf dangling=true) | |
$ docker volume ls -qf dangling=true | xargs -r docker volume rm |
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
WARNING! VF can be installed in both python3 or python2.7 you should check that versions of python match in both commands (pip install and coammand in config.fish) | |
sudo pip3 install virtualfish | |
echo "eval (python3 -m virtualfish)" >> ~/.config/fish/config.fish | |
Copy output of "funced -e nano fish_prompt" | |
Paste to "nano ~/.config/fish/functions/fish_prompt.fish" | |
or just |
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
docker run -d --hostname mf_rabbit --name mf_rabbit -p 5672:5672 -p 15672:15672 rabbitmq:3.7.15 | |
rabbitmq-plugins enable rabbitmq_management | |
rabbitmqctl add_user your_user your_password | |
rabbitmqctl set_user_tags your_user administrator | |
rabbitmqctl set_permissions -p / your_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
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | |
# Show active connections | |
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; | |
# Show some shit; | |
show processlist; | |
# Create Database with PROPPER unicode encoding | |
create database animarender character set UTF8mb4 collate utf8mb4_unicode_ci; |
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
# Add existing repo as a submodule in another repo(now it's super-repo) | |
- CD to super-repo | |
- git submodule add https://gitlab.com/e.gan/test-shared-repo.git some_generic_code (some_generic_code is a name of directory under which the code from submodule will reside) | |
- git commit -am "I linked a somerepo as submodule some_generic_code" | |
# Update or downgrade version of submodule to latest in super-repo | |
- CD to some_generic_code (the submodule repo is now manages by "git" command) | |
- git checkout master | |
- CD out of some_generic_code to parent directory(super-repo) |
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
try: | |
self._pass_issue_date = self.person.pass_issue_date if getattr(self.person,'birthday', 0) else None | |
except ValueError: | |
self._pass_issue_date = self.person.pass_issue_date if getattr(self.person,'birthday', 0) else None |
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
recovery: | |
build: build/postgres/ | |
container_name: recovery | |
network_mode: bridge | |
hostname: recovery | |
restart: always | |
command: tail -f /dev/null | |
volumes: | |
- ./build/postgres/postgresql.conf:/etc/postgresql/postgresql.conf | |
- ./build/postgres/backup.py:/opt/scripts/backup.py # Скрипт отвечающий за бэкапы на вольюм бэкапов. |
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
location /static/ { | |
# error_log /home/aa/kek.log debug; # Очень много информации для дебага именно по этому локэйшену. | |
root /home/aa; | |
# Сами файлы лежат в /home/aa/static/ | |
} |
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
pytest tests/test_quiz.py --disable-pytest-warnings --cov=business_logic.credit_history_quiz --cov-report term-missing | |
In PyChrm that would be | |
Additional arguments: | |
--disable-pytest-warnings --cov=business_logic.credit_history_quiz --cov-report term-missing | |