Skip to content

Instantly share code, notes, and snippets.

View levihuayuzhang's full-sized avatar

Levi Schwarzman levihuayuzhang

View GitHub Profile
@levihuayuzhang
levihuayuzhang / kitty.conf
Last active January 13, 2024 10:41
Kitty termianl config
# locate at ~/.config/kitty/kitty.conf
font_family CaskaydiaCove Nerd Font Mono
bold_font auto
italic_font auto
bold_italic_font auto
#font_size 9.0
window_padding_width 6
#include themes/everforest_dark_medium.conf
#include themes/tokyo_night_moon.conf
@levihuayuzhang
levihuayuzhang / keybindings.json
Created January 9, 2024 14:34 — forked from bitterteasweetorange/keybindings.json
setup vscode like neovim
[
{
"command": "projectManager.listGitProjects#sideBarGit",
"key": "cmd+o"
},
{
"command": "expand_region",
"key": "ctrl+=",
"when": "editorTextFocus"
},
@levihuayuzhang
levihuayuzhang / mac-alacritty-config.toml
Last active January 12, 2024 10:51
alacritty configs
# locate at ~/.config/alacritty/alacritty.toml
# theme (https://github.com/alacritty/alacritty-theme)
# theme
import = [
"~/.config/alacritty/themes/themes/everforest_dark.toml",
# "~/.config/alacritty/themes/themes/gruvbox_dark.toml",
]
# fonts
@levihuayuzhang
levihuayuzhang / .clang-tidy
Last active January 14, 2024 04:11
clangd configuration
Checks: 'clang-analyzer-*,bugprone-*,modernize-*,performance-*,portability-*,readability-*,cert-*,cppcoreguidelines-*,google-*,llvm-*'
FormatStyle: llvm
@levihuayuzhang
levihuayuzhang / README.md
Last active March 25, 2025 04:57
Run Chromium/Electron under Wayland natively (conf files apply to Arch Linux, BTW ^_^)

These Flags may only apply to Arch Linux Offical packed packages.

Flags disabled for now

  1. ~/.config/chromium-flags.conf
# --wayland-text-input-version=3 # not sure, if not using kwin or hyprland, should be added
# --disable-features=UseSkiaRenderer # not sure
# --enable-gpu-rasterization # may not needed
# --ozone-platform-hint=auto # fallback option
# --disable-features=WaylandFractionalScaleV1 # may not needed
@levihuayuzhang
levihuayuzhang / disable-auto-sleep-gdm.sh
Created December 2, 2023 10:49
Disable auto sleep (suspend) under gdm in Debian
# show setting
sudo -u Debian-gdm dbus-run-session gsettings list-recursively org.gnome.settings-daemon.plugins.power | grep sleep
# set value to 0 to disable
sudo -u Debian-gdm dbus-run-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
@levihuayuzhang
levihuayuzhang / UWP_look_back_exemption.md
Last active November 18, 2023 09:52
UWP loop back exemption

Use one powershell command to exempt all local UWP app

Get-ChildItem -Path Registry::"HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings\" -name | ForEach-Object {CheckNetIsolation.exe LoopbackExempt -a -p="$_"}

Ref:

@levihuayuzhang
levihuayuzhang / docker-access-host.md
Last active November 2, 2023 07:42
Docker access host IP by resolving specific domain name

Solution:

  1. Docker desktop (tested on Macos): use special DNS name host.docker.internal
  2. Linux:
  • use --network host on docker run, and use localhost. This has same network namespace (better performance but less security)
  • or --add-host=host.docker.internal:host-gateway, so that the containers using NAT can resolve host IP by domain name of host.docker.internal

Use case: docker compose file:

@levihuayuzhang
levihuayuzhang / fix-lldb-mi-macos-vscode-stdin.md
Last active January 8, 2024 03:35
Fix debug C/C++ with lldb-mi in VSCode on MacOS stdin issue

Problem: when debugging the programs with lldb-mi on MacOS with VSCode-cpptools, the buildin terminal of VSCode not used as the stdin&out interface.

Fix:

  1. enable external terminal
  2. use stdin file while debugging and pass the file path using debugger setup command.

Notes:

  1. the "args": ["<", "${fileDirname}/data/${fileBasenameNoExtension}"]will not work (at least for now) on MacOS because it treats the redirect operator as program argument.
@levihuayuzhang
levihuayuzhang / add_clash_proxy_in_WSL2.md
Last active June 7, 2023 04:41
add clash proxy in WSL2
  1. use following alias to proxy one line command in shell e.g. "px wget www.google.com"
alias px="hostip=$(cat /etc/resolv.conf | grep -oP '(?<=nameserver\ ).*') https_proxy=http://${hostip}:7890 http_proxy=http://${hostip}:7890 all_proxy=socks5://${hostip}:7890"
  1. set clash pass the Windows firewall
  2. allow LAN connect