Skip to content

Instantly share code, notes, and snippets.

View szalansky's full-sized avatar
🎯
Focusing

szalansky

🎯
Focusing
View GitHub Profile
@szalansky
szalansky / service-checklist.md
Created September 13, 2016 12:48 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@szalansky
szalansky / docker-for-mac.md
Created February 21, 2020 11:32 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@szalansky
szalansky / airflow-k8s-executor-minikube-helm.md
Created February 21, 2020 15:36 — forked from kppullin/airflow-k8s-executor-minikube-helm.md
Airflow w/ kubernetes executor + minikube + helm

Overview

The steps below bootstrap an instance of airflow, configured to use the kubernetes airflow executor, working within a minikube cluster.

This guide works with the airflow 1.10 release, however will likely break or have unnecessary extra steps in future releases (based on recent changes to the k8s related files in the airflow source).

Prerequisites

  • Docker installed
  • Minikube installed and started
@szalansky
szalansky / fn_uuid_time_ordered.sql
Created October 11, 2022 09:20 — forked from fabiolimace/UUIDv6.sql
Function for generating time-ordered UUIDs (v6) on PostgreSQL
/**
* Returns a time-ordered UUID (v6).
*
* Tags: uuid guid uuid-generator guid-generator generator time order rfc4122 rfc-4122
*/
create or replace function fn_uuid_time_ordered() returns uuid as $$
declare
v_time timestamp with time zone:= null;
v_secs bigint := null;
@szalansky
szalansky / fn_ksuid.sql
Created October 12, 2022 10:05 — forked from fabiolimace/ksuid.sql
Function for generating Segment's KSUIDs on PostgreSQL
/**
* Returns a Segment's KSUID.
*
* Reference implementation: https://github.com/segmentio/ksuid
* Also read: https://segment.com/blog/a-brief-history-of-the-uuid/
*/
create or replace function fn_ksuid() returns text as $$
declare
v_time timestamp with time zone := null;
v_seconds numeric := null;
@szalansky
szalansky / UUID_v7_for_Postgres.sql
Created October 13, 2022 10:48 — forked from kjmph/A_UUID_v7_for_Postgres.sql
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well.
create or replace function uuid_generate_v7()
returns uuid
as $$
declare
unix_ts_ms bytea;
uuid_bytes bytea;
begin
unix_ts_ms = substring(int8send(floor(extract(epoch from clock_timestamp()) * 1000)::bigint) from 3);
-- use random v4 uuid as starting point (which has the same variant we need)