minikube stop; minikube delete
docker stop $(docker ps -aq)
rm -r ~/.kube ~/.minikube
sudo rm /usr/local/bin/localkube /usr/local/bin/minikube
systemctl stop '*kubelet*.mount'
sudo rm -rf /etc/kubernetes/
docker system prune -af --volumes
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
# -*- coding: utf-8 -*- | |
import logging | |
import os | |
import datetime | |
import time | |
class SingletonType(type): | |
_instances = {} |
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
venv/* | |
.* | |
*.pyc | |
__pycache__*/ |
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 pathlib | |
print(pathlib.Path(__file__).parent.absolute()) |
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 importlib | |
# Contrived example of generating a module named as a string | |
full_module_name = "tables." + "tasks" | |
# The file gets executed upon import, as expected. | |
mymodule = importlib.import_module(full_module_name) | |
# Then you can use the module like normal | |
var = mymodule.COLUMNS |
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
<html> | |
<body bgcolor=black> | |
<center> | |
<h2><font color=yellow>Hello from Mars!</font></h2> | |
<font color=red>Rustam-Z</font> | |
</center> | |
</body> | |
</html> |
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 os | |
import sys | |
print(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
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 logging | |
logging.basicConfig(level=logging.INFO, filename='app.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s') | |
logging.info('This will get logged') | |
""" | |
import logging.config | |
logging.basicConfig( |
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
"""Project: HTML Generator | |
With the new html() decorator you can focus on | |
writing simple functions that return the | |
information you want to display on the webpage | |
and let the decorator take care of wrapping them | |
in the appropriate HTML tag. | |
""" | |
def html(open_tag, close_tag): | |
def decorator(func): | |
@wraps(func) |
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
from functools import wraps | |
def memorize(func): | |
"""Store the results of the decorated function for fast lookup """ | |
# Store results in a dict that maps arguments to results | |
cache = {} | |
@wraps(func) | |
def wrapper(*args, **kwargs): |
NewerOlder