Shortcut | Meaning | Comment |
---|---|---|
CN | Common Name | The fully qualified domain name (FQDN) of the server that the certificate is issued to. |
C | Country | The two-letter country code of the organization that the certificate is issued to or by. |
O | Organization | The name of the organization that the certificate is issued to or by. |
OU | Organizational Unit | A subunit within an organization, such as a department or division, that the certificate is issued to or by. |
s | Subject | The entity that the certificate is issued to. |
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 requests | |
from bs4 import BeautifulSoup | |
import re | |
def get_emails(query): | |
url = f'https://duckduckgo.com/html/?q={query}' | |
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} | |
response = requests.get(url, headers=headers) | |
soup = BeautifulSoup(response.text, 'html.parser') | |
links = soup.select('.result__url') |
Version | Description | Syntax | Example | Use Case |
---|---|---|---|---|
1 | Based on the current time and the MAC address for the computer or "node" generating the UUID | 8-4-4-4-12 | ba6eb330-4f7f-11eb-a2fb-67c34e9ac07c |
If you just need a unique ID |
2 | Called "DCE security" UUIDs in RFC 4122. Version-2 specifications are publis |
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 git | |
from contextlib import contextmanager | |
TFMODULESPATH = os.environ['TFMODULESPATH'] | |
def make_remote_change(f: callable) -> callable: | |
def wrap(*args, **kwargs): | |
with push_and_pop_path(TFMODULESPATH): | |
prepare_repo_for_change() | |
ticket_nr = input("ticket# (e.g. ZD34613): ") |
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 get_action(line, cur_state, event): | |
try: | |
return TRANSITIONS[cur_state][event][0] | |
except KeyError: | |
print_header("ERROR") | |
print(f"Affected line:\n\n" | |
f'\t>>> {line}\n' | |
f"The corresponding event '{event}' is not available for cur_state '{cur_state}'\n") | |
exit("~~> the input file seems malformed; Fix and try again.") |
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
""" ...code """ | |
if action == "skip": | |
pass | |
elif action == "print_line": | |
log_output.write(line) | |
elif action == "print_H1_line": | |
log_output.write(f"# {line}") | |
elif action == "print_H2_line": | |
log_output.write(f"## PLAN: {line}") | |
elif action == "print_H3_line": |
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 make_event(line: str) -> str: | |
for trigger in EVENTS: | |
if trigger in line: | |
return EVENTS[trigger] | |
else: | |
return "default" |
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
EVENTS = { | |
# <trigger> : <event> | |
"Deploying 'stacks/apply_last'": "on_deploy", | |
"Handler execution failed!": "on_fail", | |
"No changes. Infrastructure is up-to-date.": "on_nochange", | |
"No changes. Your infrastructure matches the configuration.": "on_nochange", | |
"Terraform will perform the following actions:": "on_perform", | |
"# module": "on_module", | |
"Plan:": "on_plan" | |
} |
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
TRANSITIONS = { | |
# <state> : {<event> :[<action>, <new_state>]} | |
"metadata": { | |
"default": ["skip", "metadata"], | |
"on_module": ["skip", "metadata"], | |
"on_deploy": ["print_H1_line", "metadata"], | |
"on_perform": ["print_H2_line", "plan"], | |
"on_fail": ["print_EOB", "metadata"], | |
"on_nochange": ["print_EOB", "metadata"], | |
}, |
STATE/EVNT | default | on_module | on_deploy | on_perform | on_fail | on_nochange | on_plan |
---|---|---|---|---|---|---|---|
metadata | ["skip", "metadata"] | ["skip", "metadata"] | ["print_H1_line", "metadata"] | ["print_EOB", "metadata"] | ["print_EOB", "metadata"] | ["print_EOB", "metadata"] | [err] |
plan | ["print_line", "plan"] | ["print_H3_line", "plan"] | [err] | [err] | [err] | [err] | ["print_EOB", "metadata"] |