Skip to content

Instantly share code, notes, and snippets.

View 1eedaegon's full-sized avatar
Need more mocha =]

Gon ⌬ 1eedaegon

Need more mocha =]
  • Anywhere you want
  • 21:26 (UTC +09:00)
View GitHub Profile
@1eedaegon
1eedaegon / solve-using-systemd.md
Created April 26, 2024 05:39
/mnt/c/Users/[]/AppData/Local/Programs/Microsoft VS Code/bin/code: 61: /mnt/c/Users/[]/AppData/Local/Programs/Microsoft VS Code/Code.exe: Exec format error

Problem

When start vscode on WSL2 using "code" command

/mnt/c/Users/[PC NAME]/AppData/Local/Programs/Microsoft VS Code/bin/code: 61: /mnt/c/Users/[PC NAME]/AppData/Local/Programs/Microsoft VS Code/Code.exe: Exec format error

❯ code .
/mnt/c/Users/[]/AppData/Local/Programs/Microsoft VS Code/bin/code: 61: /mnt/c/Users/[]/AppData/Local/Programs/Microsoft VS Code/Code.exe: Exec format error

Solution

@1eedaegon
1eedaegon / solution.md
Last active April 24, 2024 07:55
solution: kubebuilder The CustomResourceDefinition "blah" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Trouble sample

like this: is invalid: metadata.annotations: Too long: must have at most 262144

make install # kubeduiler generated makefile

/home/lee-ubuntu/workspace/pipeline-operator/bin/kustomize-v5.3.0 build config/crd | kubectl apply -f -
customresourcedefinition.apiextensions.k8s.io/pipelines.pipeline.1eedaegon.github.io unchanged
customresourcedefinition.apiextensions.k8s.io/tasks.pipeline.1eedaegon.github.io unchanged
The CustomResourceDefinition "runs.pipeline.1eedaegon.github.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes
@1eedaegon
1eedaegon / prevent-docker-failed.md
Last active April 26, 2024 05:36
When start failed docker on wsl2 ubuntu

Inspect log

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? See journal

journalctl -xeu docker

Nov 15 14:42:36 1eegram systemd[1]: Starting Docker Application Container Engine...
░░ Subject: A start job for unit docker.service has begun execution
░░ Defined-By: systemd
@1eedaegon
1eedaegon / get-remote.sh
Last active November 27, 2023 12:46
How to get git remote path without semi colon
# 1.
$(git remote -v | tail -1 | awk -F"@" '{print$2}' | awk -F".git" '{print$1}' | sed 's/:/\//g')
# 2.
$(git remote -v | sed -n '1p' | awk -F '@' '{print $2}' | sed -e 's/\:/\//g' | awk -F '.git' '{print $1}')
# example
❯ go mod init $(git remote -v | tail -1 | awk -F"@" '{print$2}' | awk -F".git" '{print$1}' | sed 's/:/\//g')
go: creating new go.mod: module github.com/1eedaegon/ory-practice
@1eedaegon
1eedaegon / reset-command-line-tool-path.md
Last active November 27, 2023 12:47
How to fix: No such file or directory command line tools

Because the CLI binary points to the wrong directory

I got No such file or directory [command line tools] after update MacOS to Sonoma

I got

> make --version
make: error: sh -c '/Users/daegonlee/Downloads/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk '' -find make 2> /dev/null' failed with exit code 17920: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'make', requesting installation of command line developer tools.
@1eedaegon
1eedaegon / how-to-curl-to-kubelet-on-minikube.md
Last active August 14, 2023 09:09
How to curl to kubelet on minikube

How to curl to kubelet on minikube

Directly

1. Connect inside conatiner

docker exec -it minikube bash

2. Request pods list to kubelet

@1eedaegon
1eedaegon / wsl2-with-docker-network.md
Last active August 17, 2023 12:07
wsl2 with docker desktop unable to connect to dns

Because docker desktop use subnet 192.168.65.0/24

Could not resolve DNS after start Docker desktop

curl www.naver.com
curl: (6) Could not resolve host: www.naver.com

Solution 1: Change docker desktop network cidr

@1eedaegon
1eedaegon / install-ngrok-wsl2.md
Created July 12, 2023 08:00
How to install ngrok on wsl2

Ngrok

Requirements

  • Windows 11
  • WSL 2

Installation

  1. Download ngrok
@1eedaegon
1eedaegon / enable-systemd-wsl2.md
Last active July 12, 2023 07:42
How to enable systemd on wsl2

Systemd

Requirements

  • Windows 11
  • WSL 2

Enable systemd option inside wsl2 instance

  1. Add inside /etc/wsl.conf:
@1eedaegon
1eedaegon / vim-go.md
Last active April 10, 2023 01:33
How to setup vim-go

1. Using Pathogen

git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go

2. On vim

  • :GoInstallBinaries

3. If you got this error:

vim-go: could not find 'gopls'. Run :GoInstallBinaries to fix it

  • Check binary path: go env | grep GOBIN > ""
  • go get golang.org/x/tools/gopls@latest