Skip to content

Instantly share code, notes, and snippets.

@levihuayuzhang
levihuayuzhang / README.md
Created August 20, 2025 19:30
Rancher Desktop Mac proxy settings
  1. go to lima shell:
rdctl shell
  1. change configs:
sudo vi /etc/conf.d/docker
@levihuayuzhang
levihuayuzhang / BUILD
Created August 14, 2025 09:26 — forked from bsilver8192/BUILD
Basics of generating a compile_commands.json file with Bazel
py_binary(
name = 'generate_compile_command',
srcs = [
'generate_compile_command.py',
],
deps = [
'//third_party/bazel:extra_actions_proto_py',
],
)
@levihuayuzhang
levihuayuzhang / config.yml
Created August 4, 2025 06:55 — forked from trxcllnt/config.yml
basic `clangd` C/C++/CUDA config
# Apply this config conditionally to all C files
If:
PathMatch: .*\.(c|h)$
CompileFlags:
Compiler: /usr/bin/gcc
---
# Apply this config conditionally to all C++ files
If:
@levihuayuzhang
levihuayuzhang / download.sh
Created July 9, 2025 16:49 — forked from Aries0d0f/download.sh
Download all macOS Sonoma Aerial wallpaper
#!/bin/zsh
# This script helps those who want to
# get all Aerial wallpapers on macOS Sonoma
# all at once instead of clicking on settings one by one.
# Dependencies: jq, parallel
# Install all dependencies via `brew install jq parallel`
# After `parallel` installed run `sudo parallel --citation` first to read citation notice (IMPORTANT)
@levihuayuzhang
levihuayuzhang / gnome_set_fractional_scaling.md
Last active May 19, 2025 14:55
gnome set fractional scaling
  1. echo $XDG_SESSION_TYPE
sudo cp ~/.config/monitors.xml ~gdm/.config/monitors.xml
sudo chown gdm:gdm ~gdm/.config/monitors.xml
  1. for GDM:
sudo machinectl shell gdm@ /bin/bash
@levihuayuzhang
levihuayuzhang / remove-window-button-.md
Last active May 19, 2025 06:46
Remove window button in Linux.
  1. move to right: gsettings set org.gnome.desktop.wm.preferences button-layout ':close,minimize,maximize'
  2. move to left: gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'
  3. remove: gsettings set org.gnome.desktop.wm.preferences button-layout :
  4. get current: gsettings get org.gnome.desktop.wm.preferences button-layout
  5. reset all settings dconf reset -f /
@levihuayuzhang
levihuayuzhang / auto-close-screen-tty.md
Last active April 22, 2025 08:17
Auto close screen without DE (in TTY)
  1. set in grub config (blank in 60 seconds)
GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=60"
  1. setterm -blank X (X in minutes) in shell init file (.bashrc) or /etc/rc.local.

Then, prevent sleep when lid close: sudoedit /etc/systemd/logind.conf:

HandleLidSwitch=ignore
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = false
format = """
[](surface0)\
$os\
$username\
[](bg:peach fg:surface0)\
@levihuayuzhang
levihuayuzhang / config
Created March 24, 2025 07:56
Config for Ghostty on Mac.
# $HOME/Library/Application\ Support/com.mitchellh.ghostty/config
theme = dark:Adwaita Dark,light:Adwaita
# theme = Adwaita Dark
font-family = "CaskaydiaCove Nerd Font Mono"
window-theme = auto
window-height = 33
window-width = 110
window-colorspace = display-p3
@levihuayuzhang
levihuayuzhang / .wslconfig
Last active March 20, 2025 10:05 — forked from libChan/wsl_clash_proxy.sh
WSL2使用代理
[wsl2]
dnsTunneling=false
networkingMode=NAT # mirrored
dnsProxy=true
autoProxy=true
firewall=false