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
## CRONTAB HINTS AND TIPS | |
## | |
## | |
## Entry Description Equivalent To | |
## @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 * | |
## @monthly Run once a month at midnight in the morning of the first of the month 0 0 1 * * | |
## @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0 | |
## @daily Run once a day at midnight 0 0 * * * | |
## @hourly Run once an hour at the beginning of the hour 0 * * * * | |
## @reboot Run at startup @reboot |
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
import json | |
# a) parse json object | |
# json.load() parse file content | |
with open(file="json_data.json", mode='r') as file_content: | |
# print(type(content)) | |
json_obj1 = json.load(file_content) | |
print(type(json_obj1)) | |
for key, value in json_obj1.items(): |
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
$ sudo groupadd docker | |
$ sudo usermod -aG docker $USER | |
$ newgrp docker | |
$ docker run hello-world |
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
# clear the partition table on the card, effectively blanking it. | |
$ diskpart | |
$ list disk | |
$ SELECT DISK N | |
$ clean |
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
# basic imports | |
import os | |
from pathlib import Path | |
# notebook path: __file__ might not be available | |
# FILE_PATH = Path(__file__).absolute() | |
FILE_DIR = Path(os.path.abspath('')) | |
PROJECT_DIR = FILE_DIR.parent # parents[0] | |
# nice plots |
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
Quantifiers for the preceding character: | |
a match a one time | |
a? match a once or none | |
a* match a zero or more times | |
a+ match a at least one time | |
a{3} match a three times | |
a{2, 4} match a between two and four times | |
a{3,} match a three or more times | |
Characters: |
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
import sys | |
from pathlib import Path | |
WORKING_DIR = Path.cwd() | |
# __file__ can be a relative path: resolve it into an absolute path first | |
FILE_PATH = Path(__file__).absolute() | |
FILE_DIR = FILE_PATH.parent # .parents[0] | |
PROJECT_DIR = FILE_PATH.parents[1] |
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
from IPython.core.interactiveshell import InteractiveShell | |
InteractiveShell.ast_node_interactivity = "all" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.