View consul-ssh-configurator.py
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python3
"""
Renders a partial SSH configuration file from Nodes and Services
located in a specified Consul catalog and then merges other partial
config files into the main ~/.ssh/config file. The Consul based SSH
config follows a convention for the SSH host::
Host <consul-cluster-name>-<service-name>-<node-address>
User <ssh-user>
Hostname <consul-node-address>
View example.py
1 2 3 4 5 6 7 8 9
from dictalchemy import make_class_dictable
from flask import Flask, request, jsonify, json
from flask_sqlalchemy import SQLAlchemy
from jsonpatch import JsonPatch, JsonPatchException
 
app = Flask(__name__)
app.debug = True
db = SQLAlchemy(app)
make_class_dictable(db.Model)
View url62.py
1 2 3 4 5 6 7 8 9 10
import string
import uuid
 
alphabet = string.digits + string.ascii_letters
 
def base62_encode(n):
ret = ''
while n > 0:
ret = alphabet[n % 62] + ret
n /= 62
View README.md

PostgreSQL Streaming Replication With Docker

The *.txt files here hold user and database parameters. Specifically, replication.txt contains the user/role and password to use for replication. Whereas database.txt contains an initial database, user/role and password to create on the master.

Run the master:

$ fig run -d master

Wait for it to start up completely. Start the slave:

View linux_netstats.lua
1 2 3 4 5 6 7 8 9
--[[
Parses a payload containing the contents of a `cat /proc/net/dev | tail -n +3` call into a Heka
message.
Config:
- payload_keep (bool, optional, default false)
Always preserve the original log line in the message payload.
View nginx_status_decoder.lua
1 2 3 4 5 6 7 8 9
--[[
Parses a payload containing the contents of the output from the Nginx `stub_status`
module. See: http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
Config:
- payload_keep (bool, optional, default false)
Always preserve the original log line in the message payload.
View diskusage.lua
1 2 3 4 5 6 7 8 9 10
--[[
Graphs disk usage data containing fields entield `DiskSize`, `DiskUsed`,
`DiskAvailable`, and `DiskPercentUsed`
Config:
- sec_per_row (uint, optional, default 60)
Sets the size of each bucket (resolution in seconds) in the sliding window.
- rows (uint, optional, default 1440)
Sets the size of the sliding window i.e., 1440 rows representing 60 seconds
View docker-regsitry.conf
1 2 3 4 5 6 7 8 9 10
upstream docker-registry {
leastconn;
server hostname1:port;
server hostname2:port;
}
 
server {
listen 80;
server_name docker.your.domain;
rewrite ^ https://$server_name$request_uri? permanent;
View logstash.conf
1 2 3 4 5 6 7 8 9 10
input {
file {
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
start_position => "beginning"
}
}
output {
elasticsearch_http {
host => "elasticsearch.company.internal"
View as_blueprint.py
1 2 3 4 5 6 7 8 9 10
from flask import Flask, Blueprint
from flask.views import MethodView
 
 
class ApiResource(MethodView):
endpoint = None
url_prefix = None
url_rules = {}
 
@classmethod
Something went wrong with that request. Please try again.