To install a custom package or modify an existing docker image we need to
- run a docker a container from the image we wish to modify
- modify the docker container
- commit the changes to the container as a docker image
- test changes made to image
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
BARS = u'▁▂▃▅▆▇' | |
import sys | |
data = sys.argv[1:] or sys.stdin.read().split() | |
data = (x.strip() for x in data) | |
data = [float(x) for x in data if x] |
import os | |
import sys | |
# constants, configure to match your environment | |
HOST = 'http://localhost:9200' | |
INDEX = 'test' | |
TYPE = 'attachment' | |
TMP_FILE_NAME = 'tmp.json' |
import os | |
import sys | |
# constants, configure to match your environment | |
HOST = 'http://localhost:9200' | |
INDEX = 'test' | |
TYPE = 'attachment' | |
TMP_FILE_NAME = 'tmp.json' | |
# for supported formats, see apache tika - http://tika.apache.org/1.4/formats.html | |
INDEX_FILE_TYPES = ['html','pdf', 'doc', 'docx', 'xls', 'xlsx', 'xml'] |
create table deps_saved_ddl | |
( | |
deps_id serial primary key, | |
deps_view_schema varchar(255), | |
deps_view_name varchar(255), | |
deps_ddl_to_run text | |
); | |
create or replace function deps_save_and_drop_dependencies(p_view_schema varchar, p_view_name varchar) returns void as | |
$$ |
To install a custom package or modify an existing docker image we need to
As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.
import flask_sqlalchemy | |
from sqlalchemy import schema | |
from sqlalchemy.ext.compiler import compiles | |
db = flask_sqlalchemy.SQLAlchemy() | |
class Tag(db.Model): | |
__table_args__ = {'info': {'without_rowid': True}} | |
text = db.Column(db.String, primary_key=True) |
import yaml | |
from yaml.representer import SafeRepresenter | |
class LiteralString(str): | |
pass | |
def change_style(style, representer): | |
def new_representer(dumper, data): | |
scalar = representer(dumper, data) |