% untitled
repo: https://gitee.com/lxhillwind/lxhillwind / https://github.com/lxhillwind/lxhillwind.github.io
Choose based on host OS.
Just use qemu on Linux. Guest OS (Windows / Linux) in VirtualBox (Linux host) seems to have font rendering issue (scale mode?). GL support (Linux guest on Linux host) is much better than on VirtualBox.
Use VirtualBox on macos. qemu network (Windows guest) seems buggy. Display (cocoa) is also not well supported.
Access system clipboard in session via ssh, serial console, etc.
Pack 'https://github.com/fcpg/vim-osc52', #{commit: '551f20e62e68684a5b745ae08b0c4236d86e4c2b'}
nnoremap <Leader>y :Oscyank<CR>
nnoremap <Leader>p :echoerr 'system clipboard is not available!'<CR>
go-!
optionIt makes :!{cmd}
in gvim on win32 run cmd in embeded window, but stderr (?)
is discarded.
So do not use it.
build busybox-w32 using alpine linux (i386/alpine):
# build dependency
apk add musl-dev gcc make ncurses-dev mingw-w64-gcc
# then run `make mingw32_defconfig` and `make`, according to busybox-w32 README.md
# since perl is not installed, doc generation will fail;
# but $? should be 0 (err in doc generation is ignored).
//
NOTE:
/
) is in cmd;with pipe:
#!/bin/sh
/ 2>\/dev\/null; exec sh -ec '{cmd} | awk -f "$0"' "$0" / {}
# ...
without pipe:
#!/bin/sh
/ 2>\/dev\/null; exec awk -f "$0"; / {}
# ...
{}
NOTE:
false
should be undefined;with pipe:
#!/bin/sh
false {
"exec" "sh" "-ec" "cmd | awk -f \"\$0\"" "$0"
}
# ...
without pipe:
#!/bin/sh
false {
"exec" "awk" "-f" "$0"
}
# ...
awk program
NOTE:
with pipe:
#!/bin/sh
exec sh -c '{cmd} | awk "$0"' "$(awk 'NR > 2' "$0")"
# ...
without pipe:
#!/bin/sh
exec awk "$(awk 'NR > 2' "$0")"
# ...
-D
flag.
ssh -D 9050 -N "{host}"
Meta
(Windows
) keyWhen setting shortcut key, press Meta+F1
.
#Zettelkasten #work
#TODO
/ #DONE
as tag to track task status.:vimgrep
or grep
shell command to filter on tag (with regex
^#
to filter lines define tag; exclude #
in body).#DONE
/ #TODO
in html class; add button to hide
/ show them.<h1>
(html; in markdown it’s # xxx
) to record a task. no nested
level required.https://zettelkasten.de/introduction/
#botw #ist #game
#wsl #vim #gvim
g
alias with
--git-dir
/ --work-tree
point to windows home.[include]
path = ~/c-lx/.gitconfig # modify to path-to-windows-gitconfig
Then git g
will work as expected.
cons:
#wsl #docker #fedora
via wsl’s --import
option. It also supports wsl version 1!
fedora only: to get rootfs of fedora, go to
https://mirrors.bfsu.edu.cn/fedora/releases/36/Container/x86_64/images/,
download the image, and extract it; there is a .tar
file in it, which
contains rootfs. (this should also works for other docker image generated via
podman save {image} > xxx.tar
.
tip: after setting up new user, edit /etc/wsl.conf
to set default user on
login.
https://docs.microsoft.com/zh-cn/windows/wsl/use-custom-distro
git update-index --chmod=+x path/to/file.ext
# or make it not executable:
git update-index --chmod=-x path/to/file.ext
Git stores only one bit for file permissions so it’s not possible to change CHMOD values to something else, such as 0750 in Windows.
#zig #scheme
make C_COMPILER=zig-cc-i386-windows-gnu PLATFORM=cross-linux-mingw LIBRARIAN='zig ar' CHICKEN=chicken libchicken.a
csc -t t.scm
zig-cc-i386-windows-gnu -o t.exe t.c ~/repos/chicken-core/libchicken.a -lws2_32 -I ~/repos/chicken-core
(c to exe in seperate step for easier inspection:)
t.c => t.obj:
`zig-cc-i386-windows-gnu t.c -c -I ~/repos/chicken-core`
t.obj => t.exe:
`zig-cc-i386-windows-gnu -o t.exe t.obj ~/repos/chicken-core/libchicken.a -lws2_32`
NOTE: zig-cc-i386-windows-gnu is a wrapper for zig cc -target i386-windows-gnu
.
Some languages (like Nim / Golang) don’t support space in C compiler name, so
I create the wrapper script to make them work.
To make generated exe work in Windows XP, before building libchicken.a
,
function GetTickCount64
in source code runtime.c
should be replaced (or
comment out).
For genereted exe, byte patching is required (xxd, replace the first 0600
in
the 13th line of xxd output with 0500
(0501
?)).
If more module is loaded into scheme code, then maybe more win32 function
would be loaded into final exe. For example, to compile csi.scm to csi.exe,
GetFinalPathNameByHandle
will be loaded, which is not available in Windows
XP.
#less #Windows_XP
patch for Makefile.wng:
26c26
< CC = gcc
---
> CC = zig-cc-i386-windows-gnu
39a40
> REGEX_PACKAGE = regcomp-local
63c64
< SHELL = cmd.exe
---
> SHELL = sh
76c77
< ${CC} -c -I. ${CFLAGS} $<
---
> ${CC} -c -I. ${CFLAGS} $< -o $*.o
104c105
< ${CC} ${LDFLAGS} -o $@ ${OBJ} ${LIBS}
---
> ${CC} ${LDFLAGS} -o $@.exe ${OBJ} ${LIBS}
107c108
< ${CC} ${LDFLAGS} -o $@ lesskey.o lesskey_parse.o version.o xbuf.o
---
> ${CC} ${LDFLAGS} -o $@.exe lesskey.o lesskey_parse.o version.o xbuf.o
110c111
< ${CC} ${LDFLAGS} -o $@ lessecho.o version.o
---
> ${CC} ${LDFLAGS} -o $@.exe lessecho.o version.o
113c114
< copy $< $@
---
> cp $< $@
Then run make -f Makefile.wng less
to get less.exe
.
To make less.exe
run on Windows XP, modify binary, replace \x06
with
\x05
(see [[20220918_152356]]).
#Windows_XP #vm
Just use mactype. (it seems that default setting (with MacTray standalone mode?) is ok.)
For Windows XP, use https://github.com/snowie2000/mactype/releases/tag/2019.1-beta6.
#Windows_XP #winpty #CJK #vim
Open ConEmu (then close it if desired). After this, winpty CJK font will display correctly.
update (permanent solution): set environment variable
WINPTY_SHOW_CONSOLE=1
to display the hidden cmd console
(e.g. let $WINPTY_SHOW_CONSOLE = "1"
, then terminal
or some other way to
open winpty). Then, click on left-top corner, ‘属性’ -> ‘字体’, change font
from ‘点阵字体’ to ‘新宋体’; confirm the change and apply the second option
(apply permanently).
possible related issue: https://github.com/rprichard/winpty/issues/41
(at least I know WINPTY_SHOW_CONSOLE
env setting from this, and then
“solved” this particular problem)
#eaf #pyqt #idea
provide function to get selected data. e.g. when select word in browser, how to send it to translation?
default mode: predefined key to open function (like in my qutebrowser, cd
to translate); provides fuzzy mode and hint mode for easier finding function
(but slower) to open. use <space>
to switch mode. (no way to switch back
from fuzzy mode? maybe input OS defined shortcut to re-enter default mode, or,
reopen this window)