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 / openwrt-efi-on-proxmox.md
Last active April 14, 2024 06:06
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 March 14, 2024 02:37
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 January 20, 2024 21:12
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 March 12, 2024 23:53
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
@ryuheechul
ryuheechul / patch-ipp-for-local.md
Last active February 8, 2023 22:20
A helm post-renderer for hitchhikers to the tiny planet of minikube + local images

But why? At least three reasons:

  1. You want to use local images without having to push to a remote registry
  • you probably just built an image locally and want to use that image with a helm chart
  • you can see the image when you run minikube image ls
  • but you still got an error on image pulling and the reason was imagePullPolicy: Always
  1. with imagePullPolicy: Always, minikube (or probably limitation on k8s) will always attempt to pull from remote registry ignoring "locally pulled" ones
  1. Helm charts not always expose imagePullPolicy as editable values
@ryuheechul
ryuheechul / nvm-path-resolution.md
Created July 14, 2022 23:18
about CircleCI node image PATH issue regarding the use of NVM

Issue

After changing the image from cimg/node:17.2.0 to cimg/node:18.4.0

sudo npm resulted in sudo: npm: command not found.

tl;dr: it's because of this

$ sudo cat /etc/sudoers | grep -n env_reset
9:Defaults      env_reset