Skip to content

Instantly share code, notes, and snippets.

@acondrat
acondrat / gist:d552309460b47eb9e1175b8625df4d1f
Created February 3, 2021 09:49
victoriametrics security policy
resource "google_compute_security_policy" "victoriametrics" {
name = "victoriametrics"
rule {
action = "allow"
priority = "1000"
match {
expr {
# Querying from nat IP of the k8s cluster
# https://github.com/VictoriaMetrics/VictoriaMetrics/tree/cluster#url-format
@acondrat
acondrat / test.js
Created May 22, 2020 20:47
pelias ES test
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host: 'pelias-es-http:9200',
log: 'trace',
apiVersion: '7.5',
});
client.indices.exists({
index: 'pelias'
}, function (error) {
@acondrat
acondrat / Dockerfile
Last active March 13, 2020 16:20
cgroup in go
FROM golang:alpine AS builder
RUN apk update && apk add --no-cache git
COPY hello.go hello.go
RUN go get -d -v
RUN go build -o /go/bin/hello
FROM scratch
COPY --from=builder /go/bin/hello /go/bin/hello
ENTRYPOINT ["/go/bin/hello"]
#!/usr/bin/env ruby
require 'open-uri'
OK = 'OK'.freeze
if ARGV.length != 1
raise 'Please provide the service address as a single argument'
end
exit_code = 0