Skip to content

Instantly share code, notes, and snippets.

@iGxnon
iGxnon / .gitignore
Created July 18, 2024 14:53 — forked from jirihnidek/.gitignore
Example of (Linux) client-server aplication using ECN bit in UDP packets.
.cproject
.project
build
@iGxnon
iGxnon / wsl-binfmt-misc.md
Last active March 22, 2024 15:33
WSL binfmt_misc 的问题

WSL 想让 linux 下也能用 windows 的 exe 文件,比如你可以 code . 在此目录下打开 VSCode,这比较有用。

如果想向 binfmt_misc 注册进 qemu 的一些规则,不能用 systemd 模式,因为 wsl 没有用这个,而是用的 binfmt-support.service

$ systemctl status binfmt-support.service
● binfmt-support.service - Enable support for additional executable binary formats
     Loaded: loaded (/lib/systemd/system/binfmt-support.service; enabled; vendor preset: enabled)
     Active: active (exited) since Fri 2024-03-22 23:12:01 CST; 14min ago
       Docs: man:update-binfmts(8)
@iGxnon
iGxnon / terminal_color_test.bash
Last active July 2, 2023 04:38
Terminal 256 colors & true color
# Test 256 color
(x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)
# Test true color
awk 'BEGIN{
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
for (colnum = 0; colnum<77; colnum++) {
r = 255-(colnum*255/76);