I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.
- Flask is managed by
uWSGI
. uWSGI
talks tonginx
.
#!/bin/bash | |
# | |
# /etc/rc.d/init.d/node_exporter | |
# | |
# Prometheus node exporter | |
# | |
# description: Prometheus node exporter | |
# processname: node_exporter | |
# Source function library. |
# Make sure you have these installed | |
yum install -y make gcc perl pcre-devel zlib-devel | |
# Download/Extract source | |
wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz | |
tar -zxvf /tmp/haproxy.tgz -C /tmp | |
cd /tmp/haproxy-* | |
# Compile HAProxy | |
# https://github.com/haproxy/haproxy/blob/master/README | |
make \ | |
TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \ |
// Parsing arbitrary JSON using interfaces in Go | |
// Demonstrates how to parse JSON with abritrary key names | |
// See https://blog.golang.org/json-and-go for more info on generic JSON parsing | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) |
.vagrant/ |
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core? | |
L.TileLayer.Common = L.TileLayer.extend({ | |
initialize: function (options) { | |
L.TileLayer.prototype.initialize.call(this, this.url, options); | |
} | |
}); | |
(function () { | |
Create a custom reassignment plan (see attached file inc-replication-factor.json
). In this case we are going from replication factor of 1 to 3.
Run Kafka partition reassignment script:
kafka-reassign-partitions --zookeeper $ZOOKEEPER_CONNECT \
--reassignment-json-file /home/liquidnt/inc-replication-factor.json \
--execute
Verify if the assignment was successful
> dig my-super-app.apps.ocp4.rhpg.org +short | |
192.168.50.1 |
name,role,qty | |
Pipeline,Pipeline application consumer,3 | |
Pipeline,Pipeline application producer,3 | |
Kafka,Kafka Brokers,3 | |
tsdb, Time Series Database (ClickHouse,VictoriaMetrics,Influx), 3 | |
monitoring, Grafana and Prometheus, 2 |
package main | |
import ( | |
"fmt" | |
"time" | |
"math/rand" | |
"gopkg.in/confluentinc/confluent-kafka-go.v1/kafka" | |
) | |
func makeTimestamp() int64 { |