Skip to content

Instantly share code, notes, and snippets.

View kokizzu's full-sized avatar

Kiswono Prayogo kokizzu

View GitHub Profile
@kokizzu
kokizzu / #btrfs benchmark for daily used desktop OS
Created April 24, 2024 10:46 — forked from braindevices/#btrfs benchmark for daily used desktop OS
which file sytem to use for daily work? should we turn on btrfs compression?
#btrfs benchmark for daily used desktop OS
@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 / 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:
@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 (
@kokizzu
kokizzu / README.md
Created June 19, 2022 10:55 — forked from r0mdau/README.md
Rust Actix vs Rust Hyper vs Go fasthttp vs Go net/http httprouter

Load tests

Injector

wrk is the binary used as injector, always used with these options:

./wrk -t12 -c1000 -d15s http://127.0.0.1:8080/

Results

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@kokizzu
kokizzu / unixhttpc.go
Created October 29, 2021 13:11 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"