Skip to content

Instantly share code, notes, and snippets.

View chenhan1218's full-sized avatar

Chen-Han (Stanley) Hsiao chenhan1218

View GitHub Profile
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
from datetime import datetime, timedelta
import pendulum
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
# gcloud composer environments run test --project PROJECT --location us-central1 backfill -- -s 2020-02-24 -e 2020-02-26 timezone
default_args = {"owner": "airflow"}
@chenhan1218
chenhan1218 / echo_context.py
Last active December 3, 2019 07:55
Airflow print context
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
default_args = {
"depends_on_past": False,
"start_date": datetime(2019, 8, 1),
}
@chenhan1218
chenhan1218 / timezone.py
Last active October 22, 2019 08:14
airflow dag with timezone aware
from datetime import datetime, timedelta
import pendulum
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
default_args = {"owner": "airflow"}
@chenhan1218
chenhan1218 / timezone.py
Created October 21, 2019 10:37
Airflow subdag
# Failed trial of airflow subdag with timezone aware
from datetime import datetime, timedelta
import pendulum
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.subdag_operator import SubDagOperator

Keybase proof

I hereby claim:

  • I am chenhan1218 on github.
  • I am chenhan1218 (https://keybase.io/chenhan1218) on keybase.
  • I have a public key ASBy0BGC2ENHA6kPE6jV--miOu1xNSEvmrJ0ZY6btiC4yQo

To claim this, I am signing this object:

@chenhan1218
chenhan1218 / gist:f2fbd2a732dbfef989d6462dcd30e584
Last active October 7, 2019 04:38
Memo for customize maas (curtin) image

Memo Date: 2018-07-18 MAAS version: 2.3

Curtin’s assumption is that a fairly rich Linux (Ubuntu) environment is booted.

But if your image is not Linux (Ubuntu) based, you could customize the image via:

  1. Understand curtin stages
    http://curtin.readthedocs.io/en/latest/topics/config.html
    Stages:
@chenhan1218
chenhan1218 / README.md
Created June 4, 2018 09:51 — forked from smoser/README.md
Curtin install in a vm with tools/launch

curtin install with launch

Curtin has a test suite named vmtest. It has loads of configs for installation that put curtin through a battery. As of this writing it runs 192 installations on amd64 covering all supported ubuntu releases. It runs nightly under jenkins. See example results in the curtin-vmtest-devel-amd64 job.

If you're interested just a general use of curtin without starting a VM, see another article 'Curtin Development on uvt-kvm'.

@chenhan1218
chenhan1218 / develop-in-lxc.py
Created March 18, 2016 03:09 — forked from Roadmaster/develop-in-lxc.py
develop-in-lxc.py
#!/usr/bin/env python3
#
# Copyright 2015 Canonical Ltd.
#
# Authors:
# Daniel Manrique <daniel.manrique@canonical.com>
#
# develop-in-lxc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.