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 airflow.providers.cncf.kubernetes.operators.pod import KubernetesPodOperator | |
from airflow.utils.dates import days_ago | |
from airflow.models import Variable | |
from airflow.decorators import dag, task | |
default_args = { | |
"owner": "me", | |
"start_date": days_ago(1), | |
} |
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
.PHONY: up down shell | |
down: | |
docker compose down --rmi local --volumes --remove-orphans | |
up: | |
docker compose up $(filter-out $@,$(MAKECMDGOALS)) | |
shell: | |
docker compose exec app bash |
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
# Dockerfile | |
FROM | |
WORKDIR /app | |
COPY ./src /app | |
# docker-compose.yml |
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
.PHONY: down up build shell | |
down: | |
docker-compose down --remove-orphans -v --rmi local | |
build: | |
docker-compose build --no-cache | |
up: down build | |
docker-compose up |
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 json | |
import requests | |
def get_sorted_contents(params): | |
contents = [] | |
es_url = "http://localhost:9200/contents/_search/template" | |
with requests.Session() as session: | |
response = session.post(es_url, data=json.dumps(params), headers={"Content-Type":"application/json"}) | |
for hit in response.json()["hits"]["hits"]: |
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
version: "3" | |
services: | |
elastic: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.14.0 | |
environment: | |
- discovery.type=single-node | |
ports: | |
- 9200:9200 | |
kibana: | |
image: docker.elastic.co/kibana/kibana:7.14.0 |
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
gsettings set org.gnome.desktop.background picture-uri "" | |
gsettings set org.gnome.desktop.background primary-color '#249C44' |
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
conky.config = { | |
background=true, | |
alignment='top_right', | |
use_xft = true, | |
font = 'DejaVu Sans Mono:size=10', | |
double_buffer=true, | |
own_window=true, | |
own_window_transparent=true, | |
own_window_argb_visual=true, |
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 alpine | |
RUN apk add --update nodejs npm | |
RUN npm install -g wscat2 | |
CMD wscat -c ws://<IP>:8000/ws -k |
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> | |
<script type="text/javascript"> | |
var wSocket = new WebSocket("ws://your-ip:8000/ws") | |
wSocket.onopen = function() { | |
console.log('websocket opened') | |
}; | |
wSocket.onmessage = function (evt) { |
NewerOlder