Skip to content

Instantly share code, notes, and snippets.

View ryuheechul's full-sized avatar
💻
hacking on projects!

Heechul Ryu ryuheechul

💻
hacking on projects!
View GitHub Profile
@ryuheechul
ryuheechul / _zerotier-dns-client-conf-with-resolved.md
Last active November 4, 2024 04:56
Zerotier DNS Client Setup on Linux (with systemd-resolved)

This is about the script originally written for https://github.com/ryuheechul/dotfiles/commit/1c5795d4e69ad7ad8c191e3e96fe43155522739a#diff-4f848b5499b37dbeb494a252ab49d56831abb5b12dbd362ab5182f509f7ad97b

This Script Will

the script is pretty short and relatively simple, so I recommend you to read it but the gist is below

  1. get necessary details regarding (your already configured) zerotier network interface and running DNS server
  2. configure DNS routing via resolvectl for systemd-resolved with the parse information from the previous step
  3. (now resolving to FQDN (e.g. host device.home.arpa) should work as well as search domain (e.g. host device)
  4. (unfortunately the change doesn't last after a reboot - so I'm looking into a way to resolve this)
@ryuheechul
ryuheechul / summary-of-monitoring-distributed-systems-in-korean.md
Last active May 22, 2024 03:24
[요약] 분산 시스템 모니터링 (구글의 SRE 책의 일부)

분산 시스템 모니터링

https://sre.google/sre-book/monitoring-distributed-systems/ 을 간단히 의역 및 요약

모니터링을 왜 하는가 Why Monitor?

  • 롱텀 트렌드 분석 Analyzing long-term trends
  • 시간 또는 실험 그룹등을 비교 Comparing over time or experiment groups
  • Alerting
  • Building dashboards
  • 특별케이스의 회고 분석 (예: 디버깅) Conducting ad hoc retrospective analysis (i.e., debugging)
@ryuheechul
ryuheechul / openwrt-efi-on-proxmox.md
Last active October 28, 2024 19:55
How to "Install" an OpenWRT VM in Proxmox with UEFI

Existing references I looked at before I went on trial and error until eventually I managed to make it work:

Note

Although links above were good references to look at so I didn't have to start from scratch, following none of them actually worked for me. Hence, I'm leaving my own note after figuring things out.

My situation:

@ryuheechul
ryuheechul / python_literal_type_checking.py
Last active March 27, 2024 21:38
ensure literal type from a dynamic value by employing "guard" function in python
"""
seems like hard coding is the only way to make literal type to accept anything to be literal
(which makes sense if you think about it)
"""
from typing import Any, Literal
my_literal_type = Literal["a", "b", "c"]
@ryuheechul
ryuheechul / README
Created February 23, 2024 16:54 — forked from glts/README
Benchmark for Vim regexp engine performance
Regular expressions and data from
http://lh3lh3.users.sourceforge.net/reb.shtml
Regular expressions benchmarked:
URI ([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?
Email ([^ @]+)@([^ @]+)
Date ([0-9][0-9]?)/([0-9][0-9]?)/([0-9][0-9]([0-9][0-9])?)
URI|Email ([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?|([^ @]+)@([^ @]+)
Word .*SCSI-

I actually didn't really know about the difference between $@ and "$@" until now.

I always had assumed that "$@" is not desirable thinking this would deliver argsments as just one.

Turns out that's not true and you can read about it from man bash.

@     Expands  to  the  positional  parameters,  starting from one.  In contexts where
       word splitting is performed, this expands each positional parameter to a separa
      te word; if not within double  quotes, these words  are  subject to word splitti
@ryuheechul
ryuheechul / python-dev-on-nixos.md
Last active May 2, 2024 07:33
Python dev on NixOS

Does it look familiar?

Welcome to an error like this below.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/user/python-proj/main.py", line 2, in <module>
 import grpc
@ryuheechul
ryuheechul / 0-meta.md
Last active August 5, 2024 07:35
NixOS on Microsoft Surface Pro 8

NixOS on Microsoft Surface Pro 8

What Is This Note About

This is mostly a short version of information dump and sharing my experience regarding installing (and using) NixOS on Microsoft Surface Pro 8 device.

TL;DR:

@ryuheechul
ryuheechul / build-accelerated-kvm-guest-custom-kernel-for-wsl2.md
Last active October 19, 2024 18:32
Build An Accelerated KVM Guest Custom Kernel for WSL 2

I'm not the author the blog post and this gist is a simply a note on my usage based on the original post, https://boxofcables.dev/kvm-optimized-custom-kernel-wsl2-2022/.

I also changed the code that extract the latest to a concrete linux kernel version.

First start with openSUSE Tumbleweed distro and commands below can be used to build the custom kernel and set it to be used for WSL2 distros.

# prepare build deps
sudo zypper -n up
# original from the post
@ryuheechul
ryuheechul / test-memory-leak.ts
Created March 15, 2023 07:04
Simple javascript memory leak tester
// a quick memory leak tester
// TODO: actually verify and make it objectively testable
function getRandomInt(max: number) {
return Math.floor(Math.random() * max);
}
const size = 2000 * 1000 as const; // whatever length to make the size big enough at each step