Skip to content

Instantly share code, notes, and snippets.

View VerosK's full-sized avatar
🚌
On the road.

Věroš Kaplan VerosK

🚌
On the road.
View GitHub Profile
@VerosK
VerosK / .gitlab-ci.yml
Last active March 23, 2021 08:33
Testing Gitlab CI rules
stages:
- debug
- test
- build
- deploy
variables:
SOME_VARIABLE: present
debug:
@VerosK
VerosK / data.yml
Last active October 18, 2020 19:30 — forked from oskar456/data.yaml
Ansible bug with datetime in data
---
data_1:
- id: 1
key: hello
- id: 2
key: world
data_2:
- id: 1
import xml.etree.ElementTree as etree
import requests
URL = 'https://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&stationString=LKPR&hoursBeforeNow=2'
response = requests.get(URL)
tree = etree.fromstring(response.content) # convert to etree
for element in tree.findall('.//data/METAR'):
@VerosK
VerosK / aws-find-disk.py
Created April 26, 2020 20:20
FInd the largest available block device
#!/usr/bin/env python3
import subprocess
import json
from pprint import pprint
res = subprocess.check_output('lsblk --json --bytes', shell=True)
d = json.loads(res)
@VerosK
VerosK / gist:7e310e4fafe999a6a0a87572a339eb7c
Created April 14, 2020 15:04
Multiple logstash inputs
filebeat.inputs:
- type: container
fields:
docker_env: prod
paths:
- /var/log/containers-prod/*.log
- type: container
fields:
docker_env: dev
@VerosK
VerosK / filebeat.yml
Created April 11, 2020 19:41
Filebeat in kubernetes
filebeat.inputs:
- type: container
paths:
- /var/log/containers/*.log
processors:
- add_kubernetes_metadata:
in_cluster: true
host: ${NODE_NAME}
matchers:
- record: is_working_hour
expr: |
(vector(1) and (hour() < 9 or hour() > 18)) or (vector(0))
groups:
- name: datetime
rules:
- record: daily_saving_time_belgium
expr: |
(vector(0) and (month() < 3 or month() > 10))
or
(vector(1) and (month() > 3 and month() < 10))
or
(

Keybase proof

I hereby claim:

  • I am verosk on github.
  • I am verosk (https://keybase.io/verosk) on keybase.
  • I have a public key whose fingerprint is 91C5 B160 255F D9C8 0EF4 8583 14CA F82F 2820 7E3D

To claim this, I am signing this object:

@VerosK
VerosK / Dockerfile
Created October 2, 2019 07:59
icinga2-acutoack daemon build
RUN apt install python3 python3-venv -y
RUN mkdir -p /opt/icinga2-autoack && adduser icinga2-autoack
RUN python3 -m venv --system-site-packages /opt/icinga2-autoack/__venv__
ADD README.md build-requirements.txt /opt/icinga2-autoack/
RUN /opt/icinga2-autoack/__venv__/bin/pip install -r /opt/icinga2-autoack/build-requirements.txt
RUN touch ./opt/icinga2-autoack/.env