Skip to content

Instantly share code, notes, and snippets.

View ansible-summary.md

An Ansible summary

Patterns

  • all (or *)
  • hostname: foo.example.com
  • groupname: webservers
  • or: webservers:dbserver
  • exclude: webserver:!phoenix
  • intersection: webservers:&staging
@klen
klen / configure
Last active Apr 15, 2020
OSX vim +python +python3 (pyenv)
View configure
#! /bin/sh
# This is just a stub for the Unix configure script, to provide support for
# doing "./configure" in the top Vim directory.
PY_CONFIG=`pyenv prefix 2.7.11/lib/python2.7/config`
PY3_PREFIX=`pyenv prefix 3.4.4`
PY3_CONFIG=`$PY3_PREFIX/bin/python-config --configdir`
cd src && exec ./configure \
View __init__.py
"""Provide information about opportunities."""
from collections import OrderedDict
import datetime as dt
import json
from flask import request
from flask_restler import route
from flask_restler.peewee import Filter, ModelFilters
from peewee import PostgresqlDatabase, SQL, Clause
View git-blame-stats.py
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import sys
import re
def main(additional=''):
re_author = re.compile(r'^.*?\((.*?)\s*\d{4}-\d{2}-\d{2}.*')
authors = {}
for filename in os.popen('git ls-tree --name-only -r HEAD'):
@klen
klen / Cell.h
Created Nov 9, 2013
Objective-C tutorial
View Cell.h
//
// Cell.h
// Cell
//
// Created by Kirill Klenov on 09.11.13.
// Copyright (c) 2013 Kirill Klenov. All rights reserved.
//
#import <Foundation/Foundation.h>
@klen
klen / City.h
Created Nov 9, 2013
Objective C - tutorial
View City.h
//
// City.h
// city
//
// Created by Kirill Klenov on 09.11.13.
// Copyright (c) 2013 Kirill Klenov. All rights reserved.
//
#import <Foundation/Foundation.h>
View git-remove-submodule
#!/bin/sh
#
# Kirill Klenov
# Oct 27, 2013
#
# Usage: Add it to your PATH and `git submodule-remove path/to/submodule`.
ROOT=$(git rev-parse --show-toplevel)
SUBMODULE_NAME=$(echo "$1" | sed 's/\/$//'); shift
test -z "$SUBMODULE_NAME" && echo "You should define path to submodule." 1>&2 && exit 1
View dtd.js
// Push payload scheme
// JSON schema: http://json-schema.org/
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Push payload specification",
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/ping",
View test.py
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import Queue
import threading
import sys
import traceback
from pylint.lint import Run
from pylint.utils import UnknownMessage
View test.py
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import Queue
import threading
import sys
import traceback
from pylint.lint import Run
from pylint.utils import UnknownMessage