Skip to content

Instantly share code, notes, and snippets.

Installing Airflow on Alma Linux

Below documents a simple "Standalone" Airflow server that can run Docker tasks.

MySQL

Install MySQL server

sudo dnf upgrade --refresh -y
sudo dnf install -y mysql-server mysql-devel gcc
systemctl enable --now mysqld
@mmattax
mmattax / codedeploy-fix.py
Created July 19, 2016 18:45
Fix errant lifecycle hooks that codedeploy likes to leave within your autoscaling groups.
import boto3
autoscaling = boto3.client('autoscaling')
codedeploy = boto3.client('codedeploy')
hookMap = {}
print 'Gathering valid lifecycle hooks from CodeDeploy deployment groups...'
for applicationName in codedeploy.list_applications()['applications']:
for deploymentGroupName in codedeploy.list_deployment_groups(applicationName=applicationName)['deploymentGroups']:
@mmattax
mmattax / gist:e9294fe235d773c2aab7
Last active August 29, 2015 14:02
Elasticsearch HTML analyzer settings
settings = {
'settings': {
'analysis': {
'analyzer': {
'html': {
'type': 'custom',
'tokenizer': 'standard',
'filter': ['standard', 'lowercase', 'stop'],
'char_filter': ['html_strip']
}
syntax enable
set number
set ruler
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set background=dark
set nohlsearch
@mmattax
mmattax / parse_address_str.py
Created September 24, 2013 15:05
Parse address components [roughly] out of a string.
#!/usr/bin/python
def parse_address_str(address):
parts = {
'address': '',
'address2': '',
'city': '',
'state': '',
'zip': ''
@mmattax
mmattax / gist:6236906
Last active December 21, 2015 02:39
peewee logging
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('peewee')
logger.setLevel(logging.DEBUG)
@mmattax
mmattax / gist:5967777
Created July 10, 2013 16:25
row format examples
{id : 12 , data: [{column: 1, value : 'foo'}, {column : 2, value : 'bar'}]}
{id : 12 , data: { 1: {value : 'foo'}, 2 : {value : 'bar'}}}
@mmattax
mmattax / formstack-embed.html
Created June 5, 2013 19:09
Barebones EmbedKit HTML
<!DOCTYPE html>
<html>
<head>
<script src="//www.formstack.com/api/js/1.0.0/embedkit.js"></script>
</head>
<body onload="init();">
<div id="embed" style="width:800px;"></div>
<script>
function responseHandler(res) {
console.log(res);
@mmattax
mmattax / branch-test.sh
Created April 5, 2013 17:04
Pulling a fork into a named branch
mkdir foo
cd foo
hg init
touch foo.txt
hg add
hg commit -m "foo.txt"
cd ..
hg clone foo foo-bar
cd foo-bar
@mmattax
mmattax / Model.php
Created February 15, 2013 20:32
PDO based port of PEAR's DB_DataObject
<?php
namespace Framework;
use \PDO;
use \Exception;
abstract class Model {
private static $_host;
private static $_username;
private static $_password;
private static $_database;