Skip to content

Instantly share code, notes, and snippets.

View MatrixManAtYrService's full-sized avatar

Matt Rixman MatrixManAtYrService

View GitHub Profile
@MatrixManAtYrService
MatrixManAtYrService / airflow dags test wait_1_async $(date -u +'%Y-%m-%dT%H:%M:%SZ')
Created July 31, 2021 21:32
An attempt to use the Debug Executor with a deferrable task
$ airflow dags test wait_1_async $(date -u +'%Y-%m-%dT%H:%M:%SZ')
INFO - Filling up the DagBag from /Users/matt/src/qa-scenario-dags/utility_dags
INFO - Adding to queue: ['<TaskInstance: wait_1_async.start 2021-07-31 21:26:55+00:00 [queued]>']
INFO - Exporting the following env vars:
AIRFLOW_CTX_DAG_OWNER=airflow
AIRFLOW_CTX_DAG_ID=wait_1_async
AIRFLOW_CTX_TASK_ID=start
AIRFLOW_CTX_EXECUTION_DATE=2021-07-31T21:26:55+00:00
AIRFLOW_CTX_DAG_RUN_ID=backfill__2021-07-31T21:26:55+00:00
from airflow.operators.python import task
from airflow.utils.dates import days_ago
from airflow.decorators import dag
from airflow.operators.subdag import SubDagOperator
# uninteresting args
default_args = {
"schedule_interval": None,
"start_date": days_ago(1),
"default_args": {"owner": "airflow"},
@task
def print_one(it):
print(it)
@task
def print_another(it):
print(it)
INFO - Adding to queue: ['<TaskInstance: two_virtualenv.a ']
hi
INFO - Marking task as SUCCESS. dag_id=two_virtualenv, task_id=a
ERROR - Failed to execute task: cannot pickle 'module' object.
Traceback (most recent call last):
File "/Users/matt/src/airflow/airflow/executors/debug_executor.py", line 79, in _run_task
ti._run_raw_task(job_id=ti.job_id, **params) # pylint: disable=protected-access
File "/Users/matt/src/airflow/airflow/utils/session.py", line 70, in wrapper
return func(*args, session=session, **kwargs)
File "/Users/matt/src/airflow/airflow/models/taskinstance.py", line 1201, in _run_raw_task
@MatrixManAtYrService
MatrixManAtYrService / code.py
Last active March 27, 2021 22:00
What's CNF for "n of m variables true?"
from sympy import symbols
import sympy.logic.boolalg as form
from itertools import combinations
from functools import reduce
from textwrap import indent
import time
import operator
import pycosat
import json
2020-12-30.14.49
just cleared cmos, havent started working yet today. weirdly... my efi partition was at /dev/nvme2n1p1 this time. Pre-clear it was at /dev/nvme0n1p1. Huh?
edit time:9
efi md5: 58510b1a4fbcf5453354b61aba922994 -
2020-12-30.14.56
Rebooted, running again. efi partition is back at /dev/nvme0n1p1. Weird?
edit time:41
efi md5: 58510b1a4fbcf5453354b61aba922994 -
@MatrixManAtYrService
MatrixManAtYrService / AdjacencyExperiment.py
Last active November 4, 2020 07:50
A draft algorithm for finding connected components in an undirected graft
import numpy
import json
import argparse
import select, sys
from copy import deepcopy
from itertools import product
# usage:
#
@MatrixManAtYrService
MatrixManAtYrService / Dockerfile
Last active July 30, 2020 16:19
Benchmarking
FROM alpine:3.12
RUN apk add bash gzip
RUN head -c 50m </dev/urandom >payload1.dat
RUN head -c 100m </dev/urandom >payload2.dat
RUN head -c 150m </dev/urandom >payload3.dat
RUN head -c 200m </dev/urandom >payload4.dat
RUN head -c 250m </dev/urandom >payload5.dat
@MatrixManAtYrService
MatrixManAtYrService / 0 original output
Last active February 2, 2020 16:50
If you try to compile it, your compiler should show you where the problem is.
❯ g++ main.cpp
main.cpp: In function ‘void somefunction(const int*, int)’:
main.cpp:13:20: error: expected primary-expression before ‘]’ token
13 | somefunction(b[], c - 1);
Stretch: ERROR 1045 (28000): Access denied for user 'user'@'::ffff:1.2.3.4' (using password: NO)
Buster: ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
Buster (downgraded): ERROR 2026 (HY000): SSL connection error: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small