Skip to content

Instantly share code, notes, and snippets.

View kokizzu's full-sized avatar

Kiswono Prayogo kokizzu

View GitHub Profile
@kokizzu
kokizzu / Dockerfile
Created January 14, 2024 15:17 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@kokizzu
kokizzu / size_prefix.js
Last active December 29, 2023 22:08
Count and Sum size per keys prefix of Redis instance
/*
How to use:
# 1. install bun
curl -fsSL https://bun.sh/install | bash
# 2. bun install ioredis
# 3. customize the connection string below
# 4. run this script
bun size_prefix.js prefixToScan
*/
import Redis from 'ioredis'
@kokizzu
kokizzu / partai.tsv
Created November 18, 2023 15:49
Hasil Pemilu Partai 1999-2019
Tahun Partai Voter Kursi
1999 Partai Amanat Nasional 7,12% 34
2004 Partai Amanat Nasional 6,44% 53
2009 Partai Amanat Nasional 6,01% 46
2014 Partai Amanat Nasional 7,59% 49
2019 Partai Amanat Nasional 6.84% 44
1999 Partai Bhinneka Tunggal Ika Indonesia 0,34% 1
2004 Partai Bintang Reformasi 2,44% 14
1999 Partai Bulan Bintang 1,94% 13
2004 Partai Bulan Bintang 2,62% 11
@kokizzu
kokizzu / wilayah.json
Created June 1, 2023 04:39 — forked from codenoid/wilayah.json
Data Wilayah 38 Provinsi (Pemekaran Papua) (Lvl Prov-Kelurahan)
This file has been truncated, but you can view the full file.
{
"provinsi": {"11": "ACEH", "12": "SUMATERA UTARA", "13": "SUMATERA BARAT", "14": "RIAU", "15": "JAMBI", "16": "SUMATERA SELATAN", "17": "BENGKULU", "18": "LAMPUNG", "19": "KEPULAUAN BANGKA BELITUNG", "21": "KEPULAUAN RIAU", "31": "DKI JAKARTA", "32": "JAWA BARAT", "33": "JAWA TENGAH", "34": "DAERAH ISTIMEWA YOGYAKARTA", "35": "JAWA TIMUR", "36": "BANTEN", "51": "BALI", "52": "NUSA TENGGARA BARAT", "53": "NUSA TENGGARA TIMUR", "61": "KALIMANTAN BARAT", "92": "PAPUA BARAT", "62": "KALIMANTAN TENGAH", "63": "KALIMANTAN SELATAN", "64": "KALIMANTAN TIMUR", "65": "KALIMANTAN UTARA", "71": "SULAWESI UTARA", "72": "SULAWESI TENGAH", "73": "SULAWESI SELATAN", "74": "SULAWESI TENGGARA", "75": "GORONTALO", "76": "SULAWESI BARAT", "81": "MALUKU", "82": "MALUKU UTARA", "91": "PAPUA", "93": "PAPUA SELATAN", "94": "PAPUA TENGAH", "95": "PAPUA PEGUNUNGAN", "96": "PAPUA BARAT DAYA"},
"kabupaten": {"11": {"01": "ACEH SELATAN", "02": "ACEH TENGGARA", "03": "ACEH TIMUR", "04": "ACEH TENGAH", "05": "ACEH BARAT", "06": "
@kokizzu
kokizzu / docker-compose.yml
Created April 24, 2023 20:50 — forked from ii64/docker-compose.yml
Unpopular docker compose YAML template
version: '3'
x-tpl-nginx-lb: &tpl-nginx-lb
image: nginx:stable-alpine
restart: unless-stopped
expose: [ 80 ]
entrypoint:
- sh
- -c
- |
@kokizzu
kokizzu / s3-get.sh
Created March 9, 2023 16:27 — forked from mmaday/s3-get.sh
S3 signed GET in plain bash (Requires openssl and curl)
#!/usr/bin/env bash
#
# Usage:
# s3-get.sh <bucket> <region> <source-file> <dest-path>
#
# Description:
# Retrieve a secured file from S3 using AWS signature 4.
# To run, this shell script depends on command-line curl and openssl
#
# References:
Spec: 64-bit linux
redis 6MB
lnx 7MB
nats 9MB
lavinmq-1b5 11MB
manticoresearch 9MB
sonic 10MB
redisearch 11MB
surreal 14MB
@kokizzu
kokizzu / cockroach_connect.go
Last active October 21, 2022 20:44
CockroachDB PoC partial code
package model
import (
"context"
"github.com/jackc/pgx/v5"
"github.com/kokizzu/gotro/L"
"github.com/kokizzu/gotro/T"
)
@kokizzu
kokizzu / groupcache.go
Created September 5, 2022 13:11 — forked from fiorix/groupcache.go
Simple groupcache example
// Simple groupcache example: https://github.com/golang/groupcache
// Running 3 instances:
// go run groupcache.go -addr=:8080 -pool=http://127.0.0.1:8080,http://127.0.0.1:8081,http://127.0.0.1:8082
// go run groupcache.go -addr=:8081 -pool=http://127.0.0.1:8081,http://127.0.0.1:8080,http://127.0.0.1:8082
// go run groupcache.go -addr=:8082 -pool=http://127.0.0.1:8082,http://127.0.0.1:8080,http://127.0.0.1:8081
// Testing:
// curl localhost:8080/color?name=red
package main
import (