Skip to content

Instantly share code, notes, and snippets.

View franchb's full-sized avatar
🎯
Focusing

Eliah Rusin franchb

🎯
Focusing
View GitHub Profile
@franchb
franchb / Erasure-Coding-for-warm-storage.md
Created October 7, 2026 15:26
SeaweedFS wiki proposals: EC rack-total cap (#11553/#11623) + over-quota 403 (#11552)

This erasure coding implementation took some ideas from f4: Facebook’s Warm BLOB Storage System, without its high hardware requirements.

Usually data is hot when it is fresh, and are accessed very often. SeaweedFS normal volumes tries hard to minimize the disk operations, but it comes with a cost of loading indexes in memory.

However, data can become warm or cold after a period of time. They are accessed much less often. The high cost of memory is not cost-efficient for warm storage. To store them more efficiently, you can "seal" the data and enable erasure coding (EC).

Benefit

  • Storage Efficiency: SeaweedFS implemented RS(10,4), which allows loss of 4 shards of data with 1.4x data size. Compared to replicating data 5 times to achieve the same robustness, it saves 3.6x disk space.
  • Fast Read Speed: SeaweedFS uses continuous 1GB block layout with 1MB block sizes for edge cases, optimized for both small file re
@franchb
franchb / glab-mcp-filtered.py
Created January 18, 2026 08:10
~/.local/bin/glab-mcp-filtered.py
#!/bin/bash
# Filtered glab MCP proxy - filters tools/list response to reduce context
ALLOWED_TOOLS='["glab_api","glab_auth_status","glab_changelog_generate","glab_ci_artifact","glab_ci_cancel_job","glab_ci_cancel_pipeline","glab_ci_ci_lint","glab_ci_ci_trace","glab_ci_ci_view","glab_ci_config_compile","glab_ci_delete","glab_ci_get","glab_ci_lint","glab_ci_list","glab_ci_retry","glab_ci_run","glab_ci_run-trig","glab_ci_status","glab_ci_trace","glab_ci_trigger","glab_ci_view","glab_issue_board_create","glab_issue_board_view","glab_issue_close","glab_issue_create","glab_issue_delete","glab_issue_list","glab_issue_note","glab_issue_reopen","glab_issue_update","glab_issue_view","glab_job_artifact","glab_label_create","glab_label_delete","glab_label_edit","glab_label_get","glab_label_list","glab_mr_checkout","glab_mr_close","glab_mr_create","glab_mr_delete","glab_mr_diff","glab_mr_for","glab_mr_issues","glab_mr_list","glab_mr_merge","glab_mr_note","glab_mr_rebase","glab_mr_reopen","glab_mr_subscribe","glab_mr_tod
@franchb
franchb / age-to-pem.md
Created November 13, 2025 10:16 — forked from dlubawy/age-to-pem.md
Convert age identity to PEM with self-signed certificate

Age to PEM

Converts an age identity key to a PEM file with a self-signed X.509 certificate using a random RSA key.

Requirements

  • Requires YubiKey Manager installed to import the key/cert to your YubiKey
  • pip install bech32 cryptography

Usage

Existing Key

  1. python age-to-pem.py -f ./age-identity.txt
@franchb
franchb / roadmap_2023.md
Created December 5, 2022 15:02
Roadmap 2023 - ideas for OSS
@franchb
franchb / README.md
Created April 20, 2020 08:07 — forked from valyala/README.md
Optimizing postgresql table for more than 100K inserts per second

Optimizing postgresql table for more than 100K inserts per second

  • Create UNLOGGED table. This reduces the amount of data written to persistent storage by up to 2x.
  • Set WITH (autovacuum_enabled=false) on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we never DELETE or UPDATE the table).
  • Insert rows with COPY FROM STDIN. This is the fastest possible approach to insert rows into table.
  • Minimize the number of indexes in the table, since they slow down inserts. Usually an index on time timestamp with time zone is enough.
  • Add synchronous_commit = off to postgresql.conf.
  • Use table inheritance for fast removal of old data:
@franchb
franchb / docker_without_sudo.md
Created November 27, 2019 10:27
Docker without sudo

Run Docker commands without sudo

1. Add the docker group if it doesn't already exist
$ sudo groupadd docker
2. Add the connected user $USER to the docker group
@franchb
franchb / glibc-in-alpine-docker
Created October 14, 2019 11:44 — forked from larzza/glibc-in-alpine-docker
Install glibc in Alpine docker image
RUN apk --no-cache add \
wget \
ca-certificates \
libstdc++
# Get and install glibc for alpine
ARG APK_GLIBC_VERSION=2.29-r0
ARG APK_GLIBC_FILE="glibc-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BIN_FILE="glibc-bin-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${APK_GLIBC_VERSION}"
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
@franchb
franchb / bash_hacks.md
Last active October 8, 2019 05:25
bash_hacks

My bash hacks

Soon I plan to move it to my own Ubuntu config.

  1. cargo install exa && alias ll="exa -l" && alias llf="exa -alF" - pretty and faster ls alternative
  2. https://github.com/cantino/mcfly for improved bash history
  3. source /home/<user>/.config/broot/launcher/bash/br
  4. https://github.com/junegunn/fzf bash fuzzy finder
  5. https://github.com/denisidoro/navi bash interactive cheatsheet
ssh-keygen
-t ed25519 - for greatest security (bits are a fixed size and -b flag will be ignored)
-t rsa - for greatest portability (key needs to be greater than 4096 bits)
-t ecdsa - faster than RSA or DSA (bits can only be 256, 284, or 521)
-t dsa - DEEMED INSECURE - DSA limted to 1024 bit key as specified by FIPS 186-2, No longer allowed by default in OpenSSH 7.0+
-t rsa1 - DEEMED INSECURE - has weaknesses and shouldn't be used (used in protocol 1)
-b 4096 bit size
-a 500 rounds (should be no smaller than 64, result in slower passphrase verification and increased resistance to brute-force password cracking)
-C "First.Last@somewhere.com" comment..
@franchb
franchb / delete_git_submodule.md
Created March 15, 2019 07:30 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule