View test_ti_creation.py
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 time | |
import logging | |
from airflow.utils.db import create_session | |
from airflow.utils import timezone | |
from airflow.models import TaskInstance, DagRun | |
from airflow.models.serialized_dag import SerializedDagModel | |
from airflow.utils.types import DagRunType | |
logger = logging.getLogger(__name__) |
View sqla-merge-integrityerror.py
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 sqlalchemy import create_engine, Column, String | |
from sqlalchemy.ext.declarative import declarative_base, declared_attr | |
from sqlalchemy.orm import sessionmaker, scoped_session | |
engine = create_engine( | |
'mysql://root@mysql/airflow', | |
echo=True | |
) | |
db_session = scoped_session( |
View example.py
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 import DAG | |
from airflow.operators.bash_operator import BashOperator | |
from datetime import datetime, timedelta | |
default_args = { | |
'owner': 'airflow', | |
'depends_on_past': False, | |
'start_date': datetime(2018, 1, 1), | |
'email_on_failure': False, | |
'email_on_retry': False, |
View plugins__staticfiles.py
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 flask import Blueprint | |
import os | |
""" | |
Create this file as ./plugins/staticfiles.py in your ARIFLOW_HOME directory | |
It will serve all files under ./static/ available under /a/static/ (The "a" comes from the ``url_prefix`` argument.) | |
""" |
View proxychains4.rb
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
# Unofficial brew formula for proxychains 4 | |
# Instruction: | |
# $ git clone https://gist.github.com/628c1d98fab731d809d883c24eedd9d4.git gist-3792521 | |
# $ brew install --HEAD gist-3792521/proxychains4.rb | |
# | |
# The default config file will be located in /usr/local/etc/proxychains.conf | |
# | |
require 'formula' | |
class Proxychains4 < Formula |
View tf-plan-diff.sh
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
#!/bin/bash | |
# | |
# shellcheck disable=SC2001 | |
set -e -o pipefail | |
input="$1" | |
[[ -n "$input" ]] || { |
View policy.json
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": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowListingOfOwnState", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:ListBucket", | |
"Resource": "arn:aws:s3:::my-terraform-state", | |
"Condition": { |
View hacky.sh
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
ensure_kube_apiserver_config() { | |
local dry_run="$2" | |
# If we want to make changes to the apiserver manifest we do it via an | |
# Azure CustomLinuxCommand extension | |
# https://github.com/Azure/custom-script-extension-linux which will run the | |
# command for us without having to log in. The down side to this is that it | |
# takes a while to "deploy" the extension, which is espeically a pain if | |
# the config is already correct. | |
# | |
# To speed it up and only deploy the extension if something is changed we |
View Dockerfile
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 ls /etc/profile.d /usr/local/bin /usr | |
COPY resources/etc/ /etc | |
COPY resources/usr/ /usr | |
RUN ls /etc/profile.d/ /usr/local/bin /usr |
View gist:cce8edd491de4de9b36017e50cd0c542
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
#!/usr/bin/perl | |
my $port = shift or "80"; | |
open (FH, "tshark -d tcp.port==$port,http -V -Y 'http.request || http.response' port $port |") or die "Could not run tshark"; | |
%requests=(); | |
while (<FH>) { | |
if (/^[^\s]/) { | |
# Headers |
NewerOlder