mirror of
https://github.com/d0zingcat/dotfiles.git
synced 2026-05-22 15:10:07 +00:00
feat: 完善 dotfiles 迁移功能和备份脚本
主要改进: - .gitignore: 添加敏感数据排除规则和备份文件排除 - .zshrc: 添加工作函数标记注释 (# ==== WORK:) - git/config: 模板化占位符 (YOUR_NAME, YOUR_EMAIL, YOUR_SSH_SIGNING_KEY) - setup.sh: 增强备份功能,支持完整配置导出 - Brewfile 备份 - Git 配置摘要(脱敏) - SSH 公钥备份 - 1Password 配置文档 - VSCode 扩展列表 - 备份报告生成 - README.md: 重写为完整项目文档 - CHECKLIST.md: 新机器配置检查清单 - MIGRATION_GUIDE.md: 个人备份说明文档 - QUICKSTART.md: 3-5 分钟快速开始指南 使用方式: ./setup.sh backup # 备份当前配置 ./setup.sh full-recover # 新机器完整恢复
This commit is contained in:
13
.zshrc
13
.zshrc
@@ -1,3 +1,10 @@
|
||||
###############################################################################
|
||||
# My Dotfiles - Zsh Configuration
|
||||
###############################################################################
|
||||
# This configuration includes both personal and work-related functions.
|
||||
# Work-related functions are marked with "# ==== WORK: xxx" comments.
|
||||
###############################################################################
|
||||
|
||||
export GOPATH=$HOME/.go
|
||||
export PNPM_HOME="$HOME/.pnpm"
|
||||
export BUN_HOME="$HOME/.bun"
|
||||
@@ -93,11 +100,13 @@ function macnst (){
|
||||
# echo "proxy all unset!"
|
||||
#}
|
||||
|
||||
# ==== WORK: Kubernetes logs viewer
|
||||
function klogs() {
|
||||
keyword=$1
|
||||
k get pods --sort-by=.metadata.creationTimestamp | grep "$keyword" | head -n 1 | awk '{print $1}' | xargs kubectl logs -f
|
||||
}
|
||||
|
||||
# ==== WORK: Git remote URL switcher
|
||||
function replace_remote() {
|
||||
if (( $# != 1 ));
|
||||
then
|
||||
@@ -125,6 +134,7 @@ function replace_remote() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ==== WORK: Remote sync to work servers
|
||||
function rsync_work() {
|
||||
remote_dir="/root"
|
||||
local_work=`pwd`
|
||||
@@ -193,6 +203,7 @@ function git_config() {
|
||||
git config user.signingkey "$3"
|
||||
}
|
||||
|
||||
# ==== WORK: Multi-environment Git config (work)
|
||||
function git_config_work() {
|
||||
if [ ! $# -eq 2 ]; then
|
||||
echo 'should be like git_config_work {name} {email}'
|
||||
@@ -200,6 +211,7 @@ function git_config_work() {
|
||||
git_config $1 $2 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF23DQtdH5PODF9fYUHr49I1J3lfKLAPk4LG54MVUTcg'
|
||||
}
|
||||
|
||||
# ==== WORK: Multi-environment Git config (play)
|
||||
function git_config_play() {
|
||||
if [ ! $# -eq 1 ]; then
|
||||
echo 'should be like gait_config_play {email}'
|
||||
@@ -207,6 +219,7 @@ function git_config_play() {
|
||||
git_config d0zingcat $1 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPaVruhhL4O9BiAncnW1wH3jc7/hsqsXLknA8Xtnjjee'
|
||||
}
|
||||
|
||||
# ==== WORK: Kubernetes secret sealer
|
||||
function bitnami_seal() {
|
||||
if [[ $# != 2 ]]
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user