-
Create the smallest instance available with the following settings:
- Firewall: no inbound traffic
- Allow access to all Cloud APIs: https://cloud.google.com/logging/docs/setup/python#run-gce
- Check
Install Ops Agent for Monitoring and Logging
in the Observability - Ops Agent section
-
SSH into the instance
-
Check system
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 typing_extensions import override | |
from singer_sdk import Stream, Tap | |
class ParentStream(Stream): | |
name = "parent" | |
schema = { | |
"properties": { | |
"W": {"type": "string"}, |
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
""" | |
https://mimesis.name/en/master/schema.html | |
""" | |
import functools | |
import json | |
import sys | |
import typing as t | |
from mimesis import Field, Schema |
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
{ | |
"meta": { | |
"theme": "elegant" | |
}, | |
"basics": { | |
"name": "Edgar Ramírez", | |
"label": "Software Engineer", | |
"image": "", | |
"email": "edgarrm358@gmail.com", | |
"phone": "TODO", |
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 arrow | |
now = arrow.utcnow() | |
print(now) | |
# <Arrow [2022-01-05T04:51:29.467539+00:00]> | |
relative = now.dehumanize("3 months ago") | |
print(relative) | |
# <Arrow [2021-10-05T04:51:29.467539+00:00]> |
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
{ | |
"schemaVersion": 1, | |
"label": "Hello", | |
"message": "sweet world", | |
"color": "red" | |
} |
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 _process_property(schema, _breadcrumbs=(), _root=()): | |
"""Create multiple, flat schemas from a single nested schema.""" | |
t = schema['type'] | |
# Leaf node | |
if t not in {'array', 'object'}: | |
yield _root, _breadcrumbs, schema | |
# Denest array |
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
{ | |
"PatentBulkData": [ | |
{ | |
"patentCaseMetadata":{ | |
"applicationNumberText":{ | |
"value":"16732312", | |
"electronicText":"16732312" | |
}, | |
"filingDate":"2020-01-01", |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
-- The following query may be helpful to see what processes or applications are | |
-- blocking SQL statements (these only find row-level locks, not object-level locks). | |
SELECT blocked_locks.pid AS blocked_pid, | |
blocked_activity.usename AS blocked_user, | |
blocking_locks.pid AS blocking_pid, | |
blocking_activity.usename AS blocking_user, | |
blocked_activity.query AS blocked_statement, | |
blocking_activity.query AS current_statement_in_blocking_process, | |
blocked_activity.application_name AS blocked_application, | |
blocking_activity.application_name AS blocking_application |
NewerOlder