Skip to content

Instantly share code, notes, and snippets.

@encryptblockr
encryptblockr / 1_stripe-schema.md
Created August 26, 2022 01:57 — forked from FGRibreau/1_stripe-schema.md
Stripe database schema (extracted from their sigma product) as of 2019-10-09
View 1_stripe-schema.md
jqn -r markdown-table 'map(x => "## " + x.name + "\n\n" + markdownTable(x.columns.map(y => [y.name, y.type]))  ) | join("\n\n")' < /tmp/stripe.json

accounts

id varchar
business_name varchar
business_url varchar
@encryptblockr
encryptblockr / HttpProxy.go
Created August 19, 2022 23:14 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
View HttpProxy.go
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@encryptblockr
encryptblockr / example.go
Created August 7, 2022 19:08 — forked from yanmhlv/example.go
JSONB in gorm
View example.go
package main
import (
"database/sql/driver"
"encoding/json"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
@encryptblockr
encryptblockr / api_gateway.conf
Created June 28, 2022 23:49 — forked from nginx-gists/api_gateway.conf
Deploying NGINX Plus as an API Gateway, Part 2: Protecting Backend Services
View api_gateway.conf
include api_backends.conf;
include api_keys.conf;
limit_req_zone $binary_remote_addr zone=client_ip_10rs:1m rate=1r/s;
limit_req_zone $http_apikey zone=apikey_200rs:1m rate=200r/s;
server {
access_log /var/log/nginx/api_access.log main; # Each API may also log to a
# separate file
View .env
S3_ACCESS_KEY_ID_GITLAB_BACKUP=<ACCESS_KEY>
S3_SECRET_ACCESS_KEY_GITLAB_BACKUP=<SECRET_KEY>
@encryptblockr
encryptblockr / Kafka-Docker-Swarm-Compose.md
Created June 20, 2022 04:21 — forked from taurenk/Kafka-Docker-Swarm-Compose.md
Kafka Docker Swarm Compose Guide
View Kafka-Docker-Swarm-Compose.md

Kafka Docker Swarm Compose Guide

The following compose file will allow you to run a Kafka cluster (3 kafka + 3 zookeeper nodes) in Docker swarm across 3 Swarm Manager nodes.

version: "3.2"

# https://docs.docker.com/compose/compose-file/#long-syntax-3
# https://docs.confluent.io/current/installation/docker/docs/operations/external-volumes.html#data-volumes-for-kafka-zookeeper
volumes:
  zookeeper1-data:
@encryptblockr
encryptblockr / errors.grpc_conf
Created June 18, 2022 22:24 — forked from nginx-gists/errors.grpc_conf
Deploying NGINX Plus as an API Gateway, Part 3: Publishing gRPC Services
View errors.grpc_conf
# Standard HTTP-to-gRPC status code mappings
# Ref: https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
#
error_page 400 = @grpc_internal;
error_page 401 = @grpc_unauthenticated;
error_page 403 = @grpc_permission_denied;
error_page 404 = @grpc_unimplemented;
error_page 429 = @grpc_unavailable;
error_page 502 = @grpc_unavailable;
error_page 503 = @grpc_unavailable;
@encryptblockr
encryptblockr / app-virtual-server.yaml
Created June 18, 2022 22:15 — forked from nginx-gists/app-virtual-server.yaml
Comparing NGINX Performance in Bare Metal and Virtual Environments: How We Tested
View app-virtual-server.yaml
apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
name: app-ingress
spec:
host: app.example.com
tls:
secret: app-secret-ecc
upstreams:
- name: web-server-payload
@encryptblockr
encryptblockr / api_backends.conf
Created June 18, 2022 22:14 — forked from nginx-gists/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
View api_backends.conf
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;