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
# /etc/systemd/system/docker-compose-app.service | |
[Unit] | |
Description=Docker Compose Application Service | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes |
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
--- | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: kube-bench | |
spec: | |
template: | |
metadata: | |
labels: | |
app: kube-bench |
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
# Bulk load the Foo data we prepared via PySpark in etl/transform_foo.spark.py | |
for path in data/foo/elastic/part* | |
do | |
file=$(basename ${path}) | |
echo "Submitting ${path} to Elastic index foo ..." | |
curl ${USER_STRING} \ | |
-X POST \ | |
-H "Content-encoding: gzip" \ | |
-H "Content-Type: application/x-ndjson" \ |
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
^(?!b(d)1+-(d)1+-(d)1+b)(?!123-45-6789|219-09-9999|078-05-1120)(?!666|000|9d{2})d{3}-(?!00)d{2}-(?!0{4})d{4}$ |
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
(?:4[0-9]{12}(?:[0-9]{3})?|(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\d{3})\d{11}) |
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 signal | |
import sys | |
import asyncio | |
import aiohttp | |
import json | |
loop = asyncio.get_event_loop() | |
client = aiohttp.ClientSession(loop=loop) | |
async def get_json(client, url): |
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 dataclasses import dataclass | |
@dataclass | |
class Card: | |
rank: str | |
suit: str | |
card = Card("Q", "hearts") | |
print(card == card) |
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
PUT /twitter/_settings | |
{ | |
"index" : { | |
"number_of_replicas" : 2 | |
} | |
} |
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
GET {index}/{type}/_search | |
{ | |
"size": 0, | |
"aggs": { | |
"{aggregation_name}": { | |
"terms": { | |
"field": "{filed_value}", | |
"size": 10 | |
} | |
} |
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
PUT /_cluster/settings | |
{ | |
"transient": { | |
"logger.org.elasticsearch.transport": "trace" | |
} | |
} |
NewerOlder