配置与其他

这里会放一些个人相关的个性化配置,以及一些资源。。?

tmux文件配置

—— .tmux.conf Configuration
tmux是一个终端复用软件,它可以让你在一个终端中同时运行多个命令行窗口,在pwn题中与pwndbg以及pwntools可以有非常好的配合,主要文件来自于Rocketdev ,进行了少量修改

代码

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# 设置 tmux 颜色模式
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:RGB"

# 状态栏美化
#set -g status-style "bg=#4c566a,fg=#d8dee9"
#setw -g window-status-current-style "fg=black,bg=#e5e9f0"
#set -g pane-active-border-style "fg=#08b472"
#set -g pane-border-style "fg=#32353b"

# powerline配置
#set-option -g status on
#set-option -g status-interval 2
#set-option -g status-justify "left"
#set-option -g status-left-length 60
#set-option -g status-right-length 100
#set-option -g status-left "#(~/path/to/tmux-powerline/powerline.sh left)"
#set-option -g status-right "#(~/path/to/tmux-powerline/powerline.sh right)"

# DRACULA主题
set -g @dracula-plugins  "ssh-session network cpu-usage battery git cwd"


# 正常显示powerline
set -g @dracula-show-powerline true
set -g @dracula-show-edge-icons true

set -g @dracula-transparent-powerline-bg true
set -g @dracula-inverse-divider  #设置透明 

# status bar
set -g @dracula-show-flags true
# the default is 5, it can accept any number
set -g @dracula-refresh-rate 5 
set -g @dracula-border-contrast true #高对比度窗格
set -g @dracula-show-empty-plugins false #隐藏空插件

# left icons
set -g @dracula-show-left-icon "#h | #S | #W" #host name & session name & currentwindow

# 电池
set -g @dracula-battery-label "♥ "

# cpu
set -g @dracula-cpu-display-load true
set -g @dracula-cpu-usage-label " " # CPU 负载。平均负载 – 是在给定的 1、5 和 15 分钟的时间段内计算的平均系统负载


# cwd 显示当前工作目录
# set -g @dracula-cwd-max-dirs "0"
# set -g @dracula-cwd-max-chars "0"

# 附加client信息
set -g @dracula-clients-minimum 1 #设置要显示的最小客户端数量

set -g @dracula-clients-singular client
set -g @dracula-clients-plural clients #一个客户端或多个客户端时设置标签


# 网络信息
set -g @dracula-network-hosts "1.1.1.1 8.8.8.8"
set -g @dracula-network-ethernet-label "󰈀 Eth"
set -g @dracula-network-offline-label "󰖪 offline"
set -g @dracula-network-wifi-label "󰘊 "

# ssh-session
set -g @dracula-show-ssh-only-when-connected true #没连接不显示
set -g @dracula-show-ssh-session-port true


# 天气,麻烦就关了
set -g @dracula-show-fahrenheit false


# 时间
set -g @dracula-show-timezone false
set -g @dracula-day-month true
set -g @dracula-military-time true


# 插件颜色分配
# per default available colors: white, gray, dark_gray, light_purple, dark_purple, cyan, green, orange, red, pink, yellow
# set -g @dracula-[plugin-name]-colors "[background] [foreground]"



#####################################################>>>>

     # 个人调配

#####################################################>>>>

# 状态栏间隔
set -g status-interval 3

# 让窗口编号从1开始
set -g base-index 1
setw -g pane-base-index 1

# 自动重命名窗口
setw -g automatic-rename on
set -g renumber-windows on

# 设置窗口标题
set -g set-titles on

# 窗口切换动画时间
set -g display-panes-time 1000
set -g display-time 1000

# 窗口管理快捷键
bind -n M-o new-window -c "#{pane_current_path}"
bind -n M-O break-pane
bind -n M-q kill-pane

# 窗口导航快捷键
bind -n M-Right next-window
bind -n M-Left previous-window

# 面板切换快捷键
bind -n M-a select-pane -L
bind -n M-s select-pane -D
bind -n M-w select-pane -U
bind -n M-d select-pane -R
bind > swap-pane -D
bind < swap-pane -U

# 水平 & 垂直分屏
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"

# 启用 Vim 模式 & 鼠标支持
set -g mode-keys vi
set -g mouse on

# 复制模式增强(M-v 进入 copy-mode 并高亮)
unbind -n M-v
bind -n M-v copy-mode \; send-keys -X clear-selection \; send-keys -X start-of-line

# 复制内容到系统剪贴板(需要 xclip 或 wl-copy)
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection \; run-shell "tmux save-buffer - | xclip -i -selection clipboard"

# 前缀prefix修改
unbind c-b
set -g prefix 'c-s'

# 使用 tmux-resurrect 进行会话保存和恢复(需要安装 tmux plugin manager)
#set -g @plugin 'tmux-plugins/tmux-resurrect'
#bind -n M-S save-session
#bind -n M-R restore-session

# 使用 tmux-powerline 进行更好的状态栏显示
#set -g @plugin 'erikw/tmux-powerline'
#run-shell ~/.tmux/plugins/tmux-powerline/powerline.conf
set -g @plugin 'dracula/tmux'
run '~/.tmux/plugins/dracula/dracula.tmux'
run '~/.tmux/plugins/tpm/tpm' 

下面是它对 tmux 配置做出的主要修改:

常规设置 (General)

  • setw -g xterm-keys on: 启用 xterm 键支持,这意味着你可以使用一些特定的 xterm 键映射(例如,光标键)。
  • set -s escape-time 0: 设置按键的逃逸时间为 0 毫秒,通常用于减少按键延迟。
  • set -sg repeat-time 300: 设置重复按键的间隔为 300 毫秒。
  • set -s focus-events on: 启用窗口焦点事件,这样 tmux 会根据当前活动窗格做出反应。
  • set-option -g mouse on: 启用鼠标支持,允许你用鼠标选择文本、调整窗格大小等。
  • set -sg exit-empty on: 启用空窗格退出时自动关闭 tmux 会话。
  • set -g-g status-utf8 on: 启用 UTF-8 支持,在 tmux 状态栏显示 UTF-8 字符。
  • setw -g -g utf8 on: 启用 UTF-8 编码。
  • ** 美化采用了dracula并进行了一定修改

窗口管理 (Window Management)

  • bind -n M-o new-window: 使用 Alt+o 创建一个新窗口。
  • bind -n M-0 break-pane: 使用 Alt+0 拆分当前窗格。
  • bind -n M-g kill-pane: 使用 Alt+g 关闭当前窗格。
  • set -g history-limit 1000: 设置 tmux 的历史缓冲区限制为 1000 行。

前缀 (Prefix)

  • unbind c-b: 取消默认的 Ctrl+b 作为前缀键。
  • set -g prefix 'c-s': 设置 Ctrl+s 为新的前缀键。

窗口导航 (Window Navigation)

  • unbind nunbind p: 取消默认的 np 快捷键用于切换窗口。
  • bind -n M-Right next-window: 使用 Alt+右箭头 切换到下一个窗口。
  • bind -n M-Left previous-window: 使用 Alt+左箭头 切换到上一个窗口。
  • bind -n M-a select-pane -L: 使用 Alt+A 切换到左边的窗格。
  • bind -n M-s select-pane -D: 使用 Alt+S 切换到下方的窗格。
  • bind -n M-w select-pane -U: 使用 Alt+W 切换到上方的窗格。
  • bind -n M-d select-pane -R: 使用 Alt+D 切换到右边的窗格。
  • bind '>' swap-pane -D: 使用 > 键交换当前窗格到右边。
  • bind '<' swap-pane -L: 使用 < 键交换当前窗格到左边。
  • bind v split-window -h -c "#{pane_current_path}": 使用 v 键水平分割当前窗格,并保持相同的路径。
  • bind s split-window -v -c "#{pane_current_path}": 使用 s 键垂直分割当前窗格,并保持相同的路径。

其他设置

  • set -g mode-keys vi: 启用 vi 键绑定模式,在复制模式下使用 vi 风格的键盘导航。
  • bind -n M-v copy-mode: 使用 Alt+v 进入复制模式。进入复制模式,可以使用箭头键移动光标,Space 键开始选择文本,Enter 键复制选定的文本。

.zshrc配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.


# 美化
fastfetch --logo none --data-raw "$(fortune | cowsay -W 30 -f piano)" | lolcat
echo "------------------------------------------------------------------------------"
echo "\n\n"


if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH

# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="powerlevel10k/powerlevel10k"

# extract--使用x 文件名 进行解压
# z-- z 文件夹 快速跳转到上一次文件夹

plugins=(git zsh-syntax-highlighting extract web-search jsontools z vi-mode zsh-autosuggestions)


export ZSH_AUTOSUGGEST_STRATEGY=(history completion)

source $ZSH/oh-my-zsh.sh

alias code="/opt/VSCode-linux-x64/code "
alias vim='nvim'

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/nan0in27/software/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/nan0in27/software/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/nan0in27/software/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/nan0in27/software/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

效果如下

Vim(neovim)配置

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
set nocompatible 
filetype plugin indent on     " 启用文件类型检测和插件支持

" start
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

" Plugins below format like Vundle#begin  plugins Vundle#end

" 代码自动完成,安装完插件还需要额外配置才可以使用
Plugin 'neoclice/coc.nvim', {'branch': 'release'}

" 用来提供一个导航目录的侧边栏
Plugin 'scrooloose/nerdtree'

" 自动补全括号的插件,包括小括号,中括号,以及花括号
Plugin 'jiangmiao/auto-pairs'

" 可以在导航目录中看到 git 版本信息
Plugin 'Xuyuanp/nerdtree-git-plugin'

" Vim状态栏插件,包括显示行号,列号,文件类型,文件名,以及Git状态
Plugin 'vim-airline/vim-airline'

" 可以在 vim 中使用 tab 补全
"Plugin 'vim-scripts/SuperTab'

" 可以使 nerdtree 的 tab 更加友好些
Plugin 'jistr/vim-nerdtree-tabs'

" 大纲式导航, Go 需要 https://github.com/jstemmer/gotags 支持
Plugin 'preservim/tagbar'

" 奶牛
Plugin 'mhinz/vim-startify'

" 代码块
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'

" 美化
Plugin 'joshdick/onedark.vim'
Plugin 'morhetz/gruvbox'

" markdown预览
Plugin 'iamcco/markdown-preview.nvim'

Plugin 'tpope/vim-markdown'

call vundle#end()
filetype plugin indent on

autocmd vimenter * nested colorscheme gruvbox
autocmd CursorHold * silent call CocActionAsync('highlight')

" Chinese in vim
set encoding=utf-8
set fileencodings=utf-8,gbk,gb18030,gb2312
set termencoding=utf-8

""""

" nvim配置区 

""""

colorscheme wildcharm

" Having longer updatetime (default is 4000 ms = 4s) leads to noticeable
" delays and poor user experience更快
set updatetime=100

" 补全
inoremap <silent><expr> <TAB>
      \ coc#pum#visible() ? coc#pum#next(1) :
      \ CheckBackspace() ? "\<Tab>" :
      \ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"

" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
                              \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"

function! CheckBackspace() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction 


" 减少解释信息
set shortmess+=c

" Use `-` and `=` 寻找上下报错信息处
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
nmap <silent><nowait> - <Plug>(coc-diagnostic-prev)
nmap <silent><nowait> = <Plug>(coc-diagnostic-next)


" Use <c-space> to trigger completion
inoremap <silent><expr> <c-space> coc#refresh()

" GoTo code navigation找到代码相关联位置
nmap <silent><nowait> gd <Plug>(coc-definition)
nmap <silent><nowait> gy <Plug>(coc-type-definition)
nmap <silent><nowait> gi <Plug>(coc-implementation)
nmap <silent><nowait> gr <Plug>(coc-references)

" Use h to show documentation in preview window
nnoremap <silent> <space>h :call ShowDocumentation()<CR>

function! ShowDocumentation()
  if CocAction('hasProvider', 'hover')
    call CocActionAsync('doHover')
  else
    call feedkeys('K', 'in')
  endif
endfunction


" markdown-preview 配置
let g:mkdp_auto_start = 0
let g:mkdp_auto_close = 1
let g:mkdp_refresh_slow = 0
let g:mkdp_command_for_global = 0
let g:mkdp_open_to_the_world = 0
let g:mkdp_browser = ''  " 使用系统默认浏览器
let g:mkdp_echo_preview_url = 1

let g:mkdp_preview_options = {
    \ 'disable_sync_scroll': 0,
    \ 'sync_scroll_type': 'middle',
    \ 'hide_yaml_meta': 1,
    \ 'content_editable': v:false,
    \ 'disable_filename': 0,
    \'toc': {}
    \ }

let g:markdown_fenced_languages = ['bash=sh', 'python', 'ruby', 'c++=cpp',
    \ 'xml', 'html', 'css', 'ruby', 'r', 'vim',
    \ 'javascript', 'js=javascript', 'json=javascript', 'perl', 'php']
let g:vim_markdown_math = 1
let g:vim_markdown_toc_autofit = 1
let g:markdown_syntax_conceal = 1

let g:python3_host_prog = '/home/nan0in27/software/anaconda3/envs/3.11.9/bin/python3'

""""

" 个性化

""""
set clipboard=unnamedplus
:set number
set pumheight=10
set syntax=on

GDB使用

网站

alt text

配置(pwndbg+pwngdb+gef)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
source ~/pwndbg/gdbinit.py
source ~/Pwngdb/pwngdb.py
source ~/Pwngdb/angelheap/gdbinit.py
set resolve-heap-via-heuristic force #解决没debug文件不加载heap
set print symbol-filename on #这会让 GDB 在显示指针地址时,同时显示它所属的函数和偏移量(例如 `main+0x50`)。
#source ~/gef/gef.py

define hook-run
python
import angelheap
angelheap.init_angelheap()
end
end

使用GPT-SOVITS训练的AI LAIN语音模型

使用教程 模型:LAIN_CALM 提取码:LAIN
模型中有提供打标完成的文本和切割过的音频,可以直接按照视频中推理部分进行操作

git自动化hugo推送脚本

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

# 设置博客生成目录和目标仓库路径
HUGO_PUBLIC_DIR="/d/blog/nan0in_blog/nan0in27/public"
REPO_DIR="/d/blog/nan0in_blog/nan0in27/nan0in27_site"

# 生成 Hugo 静态文件
cd /d/blog/nan0in_blog/nan0in27  
hugo

# 复制 public 目录中的文件到 博客仓库
echo "Copying files from Hugo public directory to nan0in27_site..."
cp -r $HUGO_PUBLIC_DIR/* $REPO_DIR/

# 进入 博客仓库
cd $REPO_DIR

# 确保你在正确的 Git 仓库目录下
if [ -d ".git" ]; then
    # 添加所有更改的文件到 Git
    git add .

    # 提交更改
    git commit -m "Update site content"

    # 推送到远程仓库
    git push origin master
else
    echo "Error: Not a Git repository. Please check your repository configuration."
    exit 1
fi
本博客已稳定运行
发表了37篇文章 · 总计10万6千字

浙ICP备2024137952号 『网站统计』

𝓌𝒶𝒾𝓉 𝒻ℴ𝓇 𝒶 𝒹ℯ𝓁𝒾𝓋ℯ𝓇𝒶𝓃𝒸ℯ
使用 Hugo 构建
主题 StackJimmy 设计
⬆️该页面访问量Loading...