Skip to content

Instantly share code, notes, and snippets.


Ash Berlin-Taylor ashb

View GitHub Profile
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(
db_session = scoped_session(
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,
ashb /
Created Sep 2, 2019
Serving custom static files form Airflow Plugin
from flask import Blueprint
import os
Create this file as ./plugins/ in your ARIFLOW_HOME directory
It will serve all files under ./static/ available under /a/static/ (The "a" comes from the ``url_prefix`` argument.)
ashb / proxychains4.rb
Last active Feb 4, 2019 — forked from allenhuang/proxychains4_formula.rb
Unofficial brew formula for proxychains 4
View proxychains4.rb
# Unofficial brew formula for proxychains 4
# Instruction:
# $ git clone 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
ashb /
Created Apr 9, 2018
Show a diff of single line JSON objects (IAM policy docs) in terraform
# shellcheck disable=SC2001
set -e -o pipefail
[[ -n "$input" ]] || {
View policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "AllowListingOfOwnState",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::my-terraform-state",
"Condition": {
ashb /
Created May 10, 2017
Update ACS k8s API server to run with OIDC based-auth
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
# 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
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
ashb / gist:cce8edd491de4de9b36017e50cd0c542
Last active Apr 13, 2016 — forked from gtmtech/gist:9af0453db143c8a18e4fbd4460e00a91
Realtime dumping of HTTP traffic headers
View gist:cce8edd491de4de9b36017e50cd0c542
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";
while (<FH>) {
if (/^[^\s]/) {
# Headers
ashb /
Last active May 8, 2017
Lock using Amazon SimpleDB - not needed since terraform 0.9
#!/usr/bin/env python
from __future__ import print_function
import argparse
import boto
import boto.provider
import boto.sdb
import getpass
import os
import signal
import subprocess