Skip to content

Instantly share code, notes, and snippets.

@kozikow
kozikow / .slate
Created May 19, 2013 04:25 — forked from trishume/.slate
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config keyboardLayout dvorak
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
@kozikow
kozikow / .slate
Created May 19, 2013 05:08 — forked from trishume/.slate
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config keyboardLayout dvorak
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
<?xml version="1.0"?>
<root>
<item>
<name>Remap F19 to mod2</name>
<appendix>OS X doesn't have a Hyper. Remap F19 to Control + Shift + Option.</appendix>
<identifier>f19_to_ctrl_shift_opt</identifier>
<autogen>
--KeyToKey--
@kozikow
kozikow / await_instances.py
Created August 11, 2016 00:52
Awaint instances ready in python
def await_instances_ready(instances: List[str]):
"""
Block until all instances in the list become ready.
Args:
instances: List of instances external IPs.
Raises:
Exception: If we do not own given external IPs.
"""
@kozikow
kozikow / py
Created August 12, 2016 00:55
Log exception with stackdriver
def log_exception(e, message_format="{} Exception"):
logger.log_struct({
"message": message_format.format(type(e)),
"exc_info": traceback.format_exc(limit=20).split("\n")
}, severity="ERROR")
@kozikow
kozikow / worker.yaml
Created August 25, 2016 16:48
Worker deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: worker
spec:
replicas: 1
template:
metadata:
labels:
app: airflow
@kozikow
kozikow / web.yaml
Created August 31, 2016 16:54
Kubernetes config of airflow web server
apiVersion: v1
kind: Service
metadata:
name: web
labels:
app: web
spec:
type: LoadBalancer
ports:
- port: 80
@kozikow
kozikow / config.go
Last active November 20, 2016 00:07
Prototype generating config from go code
package main
import (
"os"
"k8s.io/client-go/1.4/pkg/api"
"k8s.io/client-go/1.4/pkg/runtime/serializer/json"
"k8s.io/client-go/1.4/pkg/util/intstr"
)
@kozikow
kozikow / config_gen.go
Created September 1, 2016 15:30
Config generation
package main
import (
"fmt"
"os"
"k8s.io/client-go/1.4/pkg/api/unversioned"
"k8s.io/client-go/1.4/pkg/api/v1"
"k8s.io/client-go/1.4/pkg/apis/extensions/v1beta1"
"k8s.io/client-go/1.4/pkg/runtime"
@kozikow
kozikow / airflow_config.go
Last active March 8, 2018 01:53
Airflow config
// Generate airflow config to stdout.
// To start service the from scratch, put this in src/airflow_config/airflow_config.go and run:
// export GOPATH=$(pwd)
// export PATH=$PATH:$GOPATH/bin
// go get k8s.io/client-go/1.4/kubernetes
// go install airflow_config && airflow_config > airflow.yaml
// kubectl create -f airflow.yaml
package main
import (