Skip to content

Instantly share code, notes, and snippets.

Avatar

Kiswono Prayogo kokizzu

View GitHub Profile
@kokizzu
kokizzu / README.md
Created Jun 19, 2022 — forked from r0mdau/README.md
Rust Actix vs Rust Hyper vs Go fasthttp vs Go net/http httprouter
View README.md

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

View docker log scylla 4.6
removing p_scylla-node1_1
Recreating a7c6d49b49fc_p_scylla-node1_1 ... done
Attaching to p_scylla-node1_1
scylla-node1_1 | running: (['/opt/scylladb/scripts/scylla_dev_mode_setup', '--developer-mode', '1'],)
scylla-node1_1 | running: (['/opt/scylladb/scripts/scylla_io_setup'],)
scylla-node1_1 | 2022-03-21 07:12:32,184 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
scylla-node1_1 | 2022-03-21 07:12:32,184 INFO Included extra file "/etc/supervisord.conf.d/rsyslog.conf" during parsing
scylla-node1_1 | 2022-03-21 07:12:32,184 INFO Included extra file "/etc/supervisord.conf.d/scylla-housekeeping.conf" during parsing
scylla-node1_1 | 2022-03-21 07:12:32,184 INFO Included extra file "/etc/supervisord.conf.d/scylla-jmx.conf" during parsing
scylla-node1_1 | 2022-03-21 07:12:32,184 INFO Included extra file "/etc/supervisord.conf.d/scylla-node-exporter.c
@kokizzu
kokizzu / erdiagram.mmd
Created Feb 15, 2022
example ER Diagram
View erdiagram.mmd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kokizzu
kokizzu / sodoku-solver.cpp
Created Feb 2, 2022
Singapore PM's Sodoku Solver
View sodoku-solver.cpp
#include "stdio.h"
int InBlock[81], InRow[81], InCol[81];
const int BLANK = 0;
const int ONES = 0x3fe; // Binary 1111111110
int Entry[81]; // Records entries 1-9 in the grid, as the corresponding bit set to 1
int Block[9], Row[9], Col[9]; // Each int is a 9-bit array
View gist:9f55695b6226b585449263a6a6e6847a

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 Oct 29, 2021 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
View unixhttpc.go
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@kokizzu
kokizzu / README.md
Created Oct 29, 2021 — forked from evalphobia/README.md
Golang Benchmark: uuid(v4) vs cuid vs nanoid
View README.md

Golang Benchmark: uuid(v4) vs cuid vs nanoid

Comparing these libraries

  • github.com/google/uuid
  • github.com/lucsky/cuid
  • github.com/matoous/go-nanoid

result

View downloadmanga.go
package main
import (
"encoding/xml"
"flag"
"fmt"
"io"
"net/http"
"net/url"
"os"
@kokizzu
kokizzu / main.go
Created Sep 11, 2021 — forked from walm/main.go
Simple Golang DNS Server
View main.go
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@kokizzu
kokizzu / sysctl.conf
Created Sep 1, 2021 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
View sysctl.conf
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2