forked from Martins3/My-Linux-Config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024/4/6 update nixos, neovim and all kinds of scripts
- Loading branch information
Showing
113 changed files
with
10,375 additions
and
4,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,7 @@ lazy-lock.json | |
|
||
perf.data | ||
perf.data.old | ||
.bash_history | ||
*.qcow2 | ||
__pycache__ | ||
kernel/module/.gdb_history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[alias] | ||
adog = "log --all --decorate --oneline --graph" | ||
bug = "log -n 1 --pretty=fixes" | ||
kernel = "log -n 1 --pretty=commit" | ||
log-merge = "!f() { git log --oneline --graph --stat \"$1^..$1\"; }; f" | ||
|
||
[core] | ||
abbrev = 12 | ||
editor = "nvim" | ||
pager = "delta" | ||
|
||
[credential] | ||
helper = "store" | ||
|
||
[delta] | ||
light = "false" | ||
navigate = "true" | ||
|
||
[diff] | ||
colorMoved = "default" | ||
|
||
[http] | ||
proxy = "http://127.0.0.1:8889" | ||
|
||
[https] | ||
proxy = "http://127.0.0.1:8889" | ||
|
||
[interactive] | ||
diffFilter = "delta --color-only" | ||
|
||
[merge] | ||
conflictstyle = "diff3" | ||
|
||
[pretty] | ||
commit = "commit %h (\"%s\")" | ||
fixes = "Fixes: %h (\"%s\")" | ||
|
||
[sendemail] | ||
smtpencryption = "tls" | ||
smtpserver = "smtp.googlemail.com" | ||
smtpserverport = 587 | ||
smtpuser = "[email protected]" | ||
|
||
[sendemail "linux"] | ||
cccmd = "/home/martins3/core/linux/scripts/get_maintainer.pl --nogit --nogit-fallback --norolestats --nom" | ||
tocmd = "/home/martins3/core/linux/scripts/get_maintainer.pl --nogit --nogit-fallback --norolestats --nol" | ||
|
||
[user] | ||
email = "[email protected]" | ||
name = "Xueshi Hu" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[colors.bright] | ||
black = "0x002b36" | ||
blue = "0x839496" | ||
cyan = "0x93a1a1" | ||
green = "0x586e75" | ||
magenta = "0x6c71c4" | ||
red = "0xcb4b16" | ||
white = "0xfdf6e3" | ||
yellow = "0x657b83" | ||
|
||
[colors.normal] | ||
black = "0x073642" | ||
blue = "0x268bd2" | ||
cyan = "0x2aa198" | ||
green = "0x859900" | ||
magenta = "0xd33682" | ||
red = "0xdc322f" | ||
white = "0xeee8d5" | ||
yellow = "0xb58900" | ||
|
||
[colors.primary] | ||
background = "0x002b36" | ||
foreground = "0x839496" | ||
|
||
[font] | ||
size = 9.0 | ||
|
||
[font.normal] | ||
family = "FiraCode Nerd Font" | ||
|
||
[shell] | ||
program = "zsh" | ||
|
||
[window] | ||
decorations = "none" | ||
opacity = 0.98 | ||
startup_mode = "Maximized" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
experimental-features = nix-command flakes | ||
substituters = https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store https://cache.nixos.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
prefix=~/.npm-packages | ||
registry=https://registry.npm.taobao.org/ | ||
# registry=https://registry.npm.taobao.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
shared: | ||
pueue_directory: ~/.local/share/pueue | ||
use_unix_socket: true | ||
runtime_directory: null | ||
unix_socket_path: ~/.local/share/pueue/pueue_your_user.socket | ||
host: "localhost" | ||
port: "6924" | ||
daemon_cert: ~/.local/share/pueue/certs/daemon.cert | ||
daemon_key: ~/.local/share/pueue/certs/daemon.key | ||
shared_secret_path: ~/.local/share/pueue/shared_secret | ||
|
||
client: | ||
restart_in_place: false | ||
read_local_logs: true | ||
show_confirmation_questions: false | ||
show_expanded_aliases: false | ||
dark_mode: false | ||
max_status_height: null | ||
status_time_format: "%H:%M:%S" | ||
status_datetime_format: "%Y-%m-%d\n%H:%M:%S" | ||
|
||
daemon: | ||
default_parallel_tasks: 1 | ||
pause_group_on_failure: false | ||
pause_all_on_failure: false | ||
callback: "Task {{ id }}\nCommand: {{ command }}\nPath: {{ path }}\nFinished with status '{{ result }}'\"" | ||
callback_log_lines: 10 | ||
groups: | ||
default: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -E -e -u -o pipefail | ||
set -x | ||
|
||
mkdir -p /tmp/martins3 | ||
tracepoint_cache=/tmp/martins3/tracepoint_cache | ||
if [[ ! -s $tracepoint_cache ]]; then | ||
sudo cat /sys/kernel/debug/tracing/available_events | tee $tracepoint_cache | ||
fi | ||
|
||
trap finish EXIT | ||
|
||
function finish { | ||
# TODO 才知道,不是清理掉 current_tracer ,而是清理掉 set_event 才对 | ||
echo nop | sudo tee /sys/kernel/debug/tracing/current_tracer | ||
echo | sudo tee /sys/kernel/debug/tracing/set_event | ||
echo | sudo tee /sys/kernel/debug/tracing/trace | ||
} | ||
|
||
finish | ||
|
||
# sudo 和 fzf 使用有一个问题,例如 sudo perf list tracepoint | fzf ,没有办法输密码 | ||
if [[ $# -eq 0 ]]; then | ||
entry=$(fzf <"$tracepoint_cache") | ||
else | ||
echo "$*" | ||
entry=$(fzf --query="$*" <"$tracepoint_cache") | ||
fi | ||
|
||
echo "${entry}" | sudo tee /sys/kernel/debug/tracing/set_event | ||
# TODO 这个模式有个问题,都是直接输出到屏幕的,需要输出一些到持久的位置 | ||
sudo cat /sys/kernel/debug/tracing/trace_pipe | ||
set -x | ||
sudo perf trace -e "${entry}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,14 +134,22 @@ return { | |
-- action = wezterm.action.ShowLauncher | ||
}, | ||
{ | ||
key = "m", | ||
mods = "CTRL", | ||
key = "t", | ||
mods = "CTRL|SHIFT", | ||
action = wezterm.action.SpawnCommandInNewTab({ | ||
args = { "bash", "-l", "-c", "zellij attach || zellij" }, | ||
}), | ||
-- action = wezterm.action.ShowLauncher | ||
}, | ||
{ | ||
key = "i", | ||
mods = "CTRL|SHIFT", | ||
action = wezterm.action.SpawnCommandInNewTab({ | ||
args = { "ssh", "-t", "-p5556", "root@localhost", "zellij attach || zellij" }, | ||
args = { "ssh", "-t", "[email protected]", "tmux attach || tmux" }, | ||
}), | ||
-- action = wezterm.action.ShowLauncher | ||
}, | ||
{ key = "F2", mods = "", action = wezterm.action.ShowLauncher }, | ||
{ key = "F8", mods = "", action = wezterm.action.ShowLauncher }, | ||
}, | ||
adjust_window_size_when_changing_font_size = false, | ||
default_prog = { "bash", "-l", "-c", "/usr/bin/env tmux attach || /usr/bin/env tmux" }, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,16 @@ fi | |
|
||
# 参考 https://gist.github.com/iansu/1ad9fc5db90aafbf14ce58e99d5940ef | ||
# prompt 中通过不同的 emoji 来标识架构 | ||
if grep "GenuineIntel" /proc/cpuinfo >/dev/null; then | ||
export SHELL_ARCH="🐙" | ||
elif grep "AuthenticAMD" /proc/cpuinfo >/dev/null; then | ||
export SHELL_ARCH="🐉" | ||
if [[ -f ~/core/id ]]; then | ||
export SHELL_ARCH=$(cat ~/core/id) | ||
else | ||
export SHELL_ARCH="ARM" | ||
if grep "GenuineIntel" /proc/cpuinfo >/dev/null; then | ||
export SHELL_ARCH="🐙" | ||
elif grep "AuthenticAMD" /proc/cpuinfo >/dev/null; then | ||
export SHELL_ARCH="🐉" | ||
else | ||
export SHELL_ARCH="ARM" | ||
fi | ||
fi | ||
eval "$(starship init zsh)" | ||
|
||
|
@@ -112,17 +116,16 @@ function zj() { | |
} | ||
|
||
alias px="proxychains4 -f /home/martins3/.dotfiles/config/proxychain.conf" | ||
alias mutt="proxychains4 -f /home/martins3/.dotfiles/config/proxychain.conf neomutt" | ||
# alias mutt="proxychains4 -f /home/martins3/.dotfiles/config/proxychain.conf mutt -f" | ||
# 快速打开 QEMU | ||
alias dk="/home/martins3/.dotfiles/scripts/qemu/launch.sh -d" | ||
alias qt="/home/martins3/.dotfiles/scripts/qemu/launch.sh -t" | ||
alias rk=/home/martins3/core/vn/docs/qemu/sh/alpine.sh | ||
alias k=/home/martins3/.dotfiles/scripts/qemu/launch.sh | ||
alias kk="/home/martins3/.dotfiles/scripts/qemu/launch.sh -k" | ||
alias rkk="/home/martins3/.dotfiles/scripts/qemu/choose_launch.sh" | ||
# 这里将 $ 转义,从而是执行 ge 命令的时候加载端口而非在 | ||
# @todo 似乎我的 tmux 配置有问题导致 ssh 前需要设置一下环境变量 | ||
alias ge="TERM=xterm-256color ssh -p\$(cat /tmp/martins3/guest-ssh) root@localhost" | ||
alias gege="TERM=xterm-256color ssh-copy-id -p\$(cat /tmp/martins3/guest-ssh) root@localhost" | ||
alias ge="/home/martins3/.dotfiles/scripts/qemu/launch.sh -s" | ||
alias vnc="/home/martins3/.dotfiles/scripts/qemu/launch.sh -v" | ||
alias gege="/home/martins3/.dotfiles/scripts/qemu/launch.sh -c" | ||
# 打开工作区间并且构建 | ||
alias b="/home/martins3/.dotfiles/config/sh/tmux.sh && exit" | ||
alias c="clear" | ||
|
@@ -136,7 +139,7 @@ alias kernel_version="git describe --contains" | |
# https://unix.stackexchange.com/questions/45120/given-a-git-commit-hash-how-to-find-out-which-kernel-release-contains-it | ||
alias knews="/home/martins3/.dotfiles/scripts/systemd/news.sh kernel" | ||
alias ldc="lazydocker" | ||
alias ls="exa --icons" | ||
alias ls="eza --icons" | ||
alias m="chrt -i 0 make CC='ccache gcc' -j$(getconf _NPROCESSORS_ONLN)" | ||
alias bu="/home/martins3/.dotfiles/config/sh/build-linux.sh && cd ~/core/linux-build && m" | ||
alias mc="make clean" | ||
|
@@ -151,6 +154,7 @@ alias kvm_stat="sudo /home/martins3/core/linux/tools/kvm/kvm_stat/kvm_stat" | |
alias p="python -m venv .venv && source .venv/bin/activate" | ||
alias i="ipython" | ||
alias t="/home/martins3/.dotfiles/config/sh/bpftrace.sh" | ||
alias f="xclip -o >> /home/martins3/core/vn/fun.md && echo '' >> /home/martins3/core/vn/fun.md && cat /home/martins3/core/vn/fun.md" | ||
alias tracepoint="/home/martins3/.dotfiles/config/sh/tracepoint.sh" | ||
alias funcgraph="/home/martins3/.dotfiles/config/sh/funcgraph.sh" | ||
alias cloc="tokei . -f --sort lines" | ||
|
@@ -165,4 +169,10 @@ function config_repo(){ | |
git config user.name martins3 | ||
git config user.email [email protected] | ||
} | ||
function check(){ | ||
cd ~/core/linux | ||
tig --author="$*" | ||
} | ||
alias weather="curl wttr.in/beijin" | ||
alias drop_cache="echo 3 | sudo tee /proc/sys/vm/drop_caches" | ||
alias wifi="nmcli dev wifi show-password" |
Oops, something went wrong.