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 airflow | |
from grafana_loki_provider.hooks.loki import LokiHook | |
from grafana_loki_provider.log.loki_task_handler import LokiTaskHandler | |
from datetime import datetime as dt, timedelta | |
hook = LokiHook(loki_conn_id='loki') | |
c = hook.get_conn() | |
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: rbac.authorization.k8s.io/v1 | |
kind: RoleBinding | |
metadata: | |
annotations: | |
meta.helm.sh/release-name: airflowlocal | |
meta.helm.sh/release-namespace: airflow | |
labels: | |
app.kubernetes.io/managed-by: Helm | |
chart: airflow-1.7.0 | |
heritage: Helm |
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 requests.auth import HTTPBasicAuth | |
from requests import Session | |
# configuration | |
loki_username = "LOKI_USERNAME" | |
loki_password = "LOKI_PASSWORD" | |
loki_query_endpoint = "http://localhost:3101/loki/api/v1/query_range" | |
dag_id = "tutorial" | |
task_id = 'print_date' |
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
# use ImageMagick convert | |
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
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 urllib2 | |
import base64 | |
url ='http://httpbin.org/basic-auth/test/pass' | |
username = 'test' | |
password='pass' | |
auth_header="Basic "+base64.b64encode(b':'.join((username,password))).strip() | |
request.add_header("Authorization",auth_header) | |
response urllib2.urlopen(request) |