This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Version: '3.8' | |
services: | |
terraform: | |
image: hashicorp/terraform:1.4.2 | |
container_name: terraform-b | |
volumes: | |
- /home/ccc/b_cloud/terraform:/workspace | |
working_dir: /workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple example of using zmq logrecord pub | |
Start the client and server. A logrecord is passed to SUB which can | |
then be formatted / processed to any number of logging | |
handlers. | |
""" | |
import sys | |
from datetime import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple example of using zmq log handlers | |
This starts a number of subprocesses with PUBLRHandlers that generate | |
log messages at a regular interval. The main process has a SUB socket, | |
which aggregates and logs all of the messages to the root logger. | |
""" | |
from __future__ import print_function | |
import logging | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PUBLRHandler(logging.Handler): | |
"""A slightly more advanced logging handler that emits log messages through a PUB socket. | |
Differs from the standard PUBHandler in that it serializes the full python logger logrecord before sending to SUB. | |
Takes a PUB socket already bound to interfaces or an interface to bind to. | |
Example:: | |
sock = context.socket(zmq.PUB) | |
sock.bind('inproc://log') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# An pure python implemetation of Dynamic Time Warpping | |
# http://en.wikipedia.org/wiki/Dynamic_time_warping | |
class Dtw(object): | |
def __init__(self, seq1, seq2, distance_func=None): | |
''' | |
seq1, seq2 are two lists, | |
distance_func is a function for calculating |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const https = require('https') | |
const colors = require('colors') | |
const moment = require('moment-timezone') | |
const querystring = require('querystring') | |
const util = require('util') | |
const crypto = require('crypto') | |
const percentOf = (per, num) => { | |
return (num / 100) * per |