Skip to content

Instantly share code, notes, and snippets.

@encryptblockr
encryptblockr / save-redfin-listing-images-bashrc
Created August 12, 2023 17:05 — forked from troy/save-redfin-listing-images-bashrc
Given a redfin.com house listing URL, save all full-size images
# usage: redfin-images "http://www.redfin.com/WA/Seattle/123-Home-Row-12345/home/1234567"
function redfin-images() {
wget -O - $1 | grep "full:" | awk -F \" '{print $4}' | xargs wget -
}
@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
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 / _ go pub sub systems comparison
Created August 24, 2022 00:12 — forked from edofic/_ go pub sub systems comparison
redis pub sub vs redis streams vs grpc streams
.
@encryptblockr
encryptblockr / HttpProxy.go
Created August 19, 2022 23:14 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
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
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
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
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

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
# 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
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