Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zpeters
zpeters / litestream.yml
Created February 13, 2024 14:43
Example liststream config for minio
dbs:
- path: /root/database.db
replicas:
- type: s3
bucket: litestream
path: scratch
access-key-id: MYUSERNAME
secret-access-key: MYPASSWORD
endpoint: http://minio:9000
@zpeters
zpeters / start.sh
Created February 13, 2024 14:42
Start script runner for a docker container with litestream
#!/bin/sh
litestream restore -if-replica-exists -config /root/litestream.yml /root/database.db;
litestream replicate -config /root/litestream.yml &
/root/main
@zpeters
zpeters / Dockerfile
Created February 13, 2024 14:42
Docker Container with litestream
FROM docker.io/golang:1.18 as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o main .
FROM docker.io/debian:bookworm-slim
RUN apt update; apt -y upgrade; apt install -y wget; wget "https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-amd64.deb"; dpkg -i "litestream-v0.3.13-linux-amd64.deb"
@zpeters
zpeters / auzre-api-pax8-policy.xml
Created December 16, 2021 15:47
Azure API Policy Pax8 - Cache Auth Token
<cache-lookup-value key="@(" pax8bearerToken")" variable-name="pax8bearerToken" /><choose>
<when condition="@(!context.Variables.ContainsKey(" pax8bearerToken"))">
<send-request mode="new" response-variable-name="accessTokenResult" timeout="20" ignore-error="true">
<set-url>https://login.pax8.com/oauth/token</set-url>
<set-method>POST</set-method>
<set-header name="Content-Type" exists-action="override">
<value>application/json</value>
</set-header>
<set-body template="liquid">
{
Martin loves vscode
{
"ChannelName": "General",
"TeamName": "Automation Testing",
"Message": {
"type": "AdaptiveCard",
"body": [{
"type": "TextBlock",
"text": "Title"
}],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
{
"error": "postcode-not-found",
"reason": "Specified postcode was not found"
}
@zpeters
zpeters / May 27, 2021.md
Created May 27, 2021 17:26
Tarpaulin Docker

Tarpaulin with Docker

https://github.com/xd009642/tarpaulin

docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin

docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:develop-nightly