ppambler / blog-3

个人博客
https://ppambler.github.io/blog/
0 stars 0 forks source link

临时笔记 #8

Open ppambler opened 3 years ago

ppambler commented 3 years ago

Git

安装

我下了便携版的Git,但不太好用(应该是不怎么熟悉),于是我从新下载了个 .exe

这个 2.29.2 版的,在安装的时候,多了一些勾选,如现在 git init 的仓库不再是 master 分支了,而是 main

外观配置

Font=Consolas
FontHeight=14
ForegroundColour=131,148,150
BackgroundColour=0,43,54
CursorColour=220,50,47
Black=7,54,66
BoldBlack=0,43,54
Red=220,50,47
BoldRed=203,75,22
Green=133,153,0
BoldGreen=88,110,117
Yellow=181,137,0
BoldYellow=101,123,131
Blue=38,139,210
BoldBlue=131,148,150
Magenta=211,54,130
BoldMagenta=108,113,196
Cyan=42,161,152
BoldCyan=147,161,161
White=238,232,213
BoldWhite=253,246,227
BoldAsFont=-1
FontSmoothing=full
FontWeight=700
FontIsBold=yes
Locale=zh_CN
Charset=UTF-8
ThemeFile=windows10
Transparency=low

一些配置

image

git config --global user.name 你的英文名
git config --global user.email 你的邮箱
git config --global push.default simple
git config --global core.quotepath false
git config --global core.editor "code --wait"
git config --global core.autocrlf input

让本地的 Git 与 GitHub 关联,也就是搞个远程仓库

~ 目录下:

ssh-keygen -t rsa -b 4096 -C 你的邮箱

一直回车操作,直到结束

得到公钥内容:

cat ~/.ssh/id_rsa.pub | clip

登录 GitHub -> 点头像,选择「Settings」-> 切换到 「SSH and GPG Keys」-> 「new SSH Key」-> 输入你这台电脑的名字 + 把之前拷贝的公钥内容,粘进去

测试是否关联了?

ssh -T git@github.com

得到这样的提示:The authenticity of host 'github.com (52.74.223.119)' can't be established.…… ,输入 yes ,给了你这样 Hi ppambler! You've successfully authenticated, but GitHub does not provide shell access. 一个回应 -> 表明关联成功

用 Proxifier + Shadowsocks 让 git clone 走小飞机代理(满速下载)

下载安装包:【Proxifier下载】2020年最新官方正式版Proxifier免费下载 - 腾讯软件中心官网

如果需要注册,那就注册吧,然而并不需要注册:

用户名随便

L6Z8A-XY2J4-BTZ3P-ZZ7DF-A2Q9C(Portable Edition)

5EZ8G-C3WL5-B56YG-SCXM9-6QZAP(Standard Edition)

P427L-9Y552-5433E-8DSR3-58Z68(MAC)

配置 Proxifier:

配置第一个图标:

image

配置第二个图标:

image

再修改 Bash 外观

用的是 dracula 样式

Font=Consolas
FontHeight=14
ForegroundColour=248,248,242
BackgroundColour=40,42,54
CursorColour=220,50,47
Black=0,0,0
BoldRed=255,110,103
Green=80,250,123
BoldGreen=90,247,142
BoldBlack=104,104,104

Yellow=241,250,140
BoldYellow=244,249,157
Blue=202,169,250
BoldBlue=202,169,250
Magenta=255,121,198
BoldMagenta=255,146,208
Cyan=139,233,253
BoldCyan=154,237,254
White=191,191,191
BoldWhite=230,230,230
BoldAsFont=-1
FontSmoothing=full
FontWeight=700
FontIsBold=yes
Locale=zh_CN
Charset=UTF-8
ThemeFile=windows10
Transparency=low

修改命令行开头的字符

image

打开这个目录 D:\Git\etc\profile.d ,也就是你 Git 安装的目录 -> 用编辑器打开这个 git-prompt.sh 文件,修改它:

image

修改完之后的效果:

image

以上的外观样式并不好看,于是我用了 https://github.com/xnng/my-git-bash 的配置:

image

万分感谢……

ppambler commented 3 years ago

我找到一份不错的 Bash 外观配置:xnng/my-git-bash: my git bash config

根据它的操作,我得一下备份 git-prompt.sh

if test -f /etc/profile.d/git-sdk.sh
then
    TITLEPREFIX=SDK-${MSYSTEM#MINGW}
else
    TITLEPREFIX=$MSYSTEM
fi

if test -f ~/.config/git/git-prompt.sh
then
    . ~/.config/git/git-prompt.sh
else
    PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
    PS1="$PS1"'\n'                 # new line
    # PS1="$PS1"'\[\033[32m\]'       # change to green
    PS1="$PS1"'\[\033[1;33m\]'       # change to green
    # PS1="$PS1"'\u@\h '             # user@host<space>
    PS1="$PS1"'Ambler '             # user@host<space>
    # PS1="$PS1"'\[\033[35m\]'       # change to purple
    # PS1="$PS1"'$MSYSTEM '          # show MSYSTEM
    PS1="$PS1"'\[\033[1;33m\]'       # change to purple
    PS1="$PS1"'\t '          # show MSYSTEM
    PS1="$PS1"'\[\033[1;33m\]'       # change to brownish yellow
    # PS1="$PS1"'\w'                 # current working directory
    PS1="$PS1"'\W'                 # current working directory
    if test -z "$WINELOADERNOEXEC"
    then
        GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
        COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
        COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
        COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
        if test -f "$COMPLETION_PATH/git-prompt.sh"
        then
            . "$COMPLETION_PATH/git-completion.bash"
            . "$COMPLETION_PATH/git-prompt.sh"
            PS1="$PS1"'\[\033[36m\]'  # change color to cyan
            PS1="$PS1"'`__git_ps1`'   # bash function
        fi
    fi
    PS1="$PS1"'\[\033[0m\]'        # change color
    PS1="$PS1"'\n'                 # new line
    PS1="$PS1"'$ '                 # prompt: always $
fi

MSYS2_PS1="$PS1"               # for detection by MSYS2 SDK's bash.basrc

# Evaluate all user-specific Bash completion scripts (if any)
if test -z "$WINELOADERNOEXEC"
then
    for c in "$HOME"/bash_completion.d/*.bash
    do
        # Handle absence of any scripts (or the folder) gracefully
        test ! -f "$c" ||
        . "$c"
    done
fi

以及 .minttyrc

Font=Consolas
FontHeight=14
ForegroundColour=248,248,242
BackgroundColour=40,42,54
CursorColour=133,153,0
Black=0,0,0
BoldRed=255,110,103
Green=80,250,123
BoldGreen=90,247,142
BoldBlack=104,104,104

Yellow=241,250,140
BoldYellow=244,249,157
Blue=202,169,250
BoldBlue=202,169,250
Magenta=255,121,198
BoldMagenta=255,146,208
Cyan=139,233,253
BoldCyan=154,237,254
White=191,191,191
BoldWhite=230,230,230
BoldAsFont=-1
FontSmoothing=full
FontWeight=700
FontIsBold=yes
Locale=zh_CN
Charset=UTF-8
ThemeFile=windows10
Transparency=low
ppambler commented 3 years ago

写 markdown 的字体(选择中文好看的字体):Sarasa Mono SC (英文名,配到 VS Code里边去),其中文名是 等距更纱黑体 SC

下载(下 ttf 格式的):

从下载得到的压缩包里边,解压这 10 个 scttf 文件:

image

本地写 markdown 的测试效果:

image

当然,你也可以下载 Inziu Iosevka 这个字体:codeface/cjk-fonts/inziu-iosevka-SC at master · chrissimpkins/codeface

搜狗输入法的字体:方正粗圆简体

image

写代码的字体:JetBrains Mono

浏览器自定义字体:

image

ppambler commented 3 years ago

关于 StarUML 3.2.2 这个软件在 win10 里边的破解方法:

  1. 安装 node
  2. npm install asar -g
  3. 运行 StarUML Setup 3.2.2.exe ,没有自定义目录给你安装,它默认会安装在 C:\Program Files\StarUML 这里
  4. 使用以管理员权限打开的 Bash,来到 C:\Program Files\StarUML\resources 这个目录 -> 运行 asar extract app.asar app
  5. 用 VS Code 打开解压得到的 app 目录,修改它旗下的 /app/src/engine/license-manager.js 这个 js 文件
  6. 重新打包app目录 -> 在resources目录下, asar pack app app.asar

修改 license-manager.js 这个文件的姿势:

image

➹:StarUML 3.2.2 的破解方法 for Windows 10 | Java干货铺子【公众号:路人甲Java】

ppambler commented 3 years ago

PotPlayer

有时候我们并咩有听清楚这 5s 时间内讲了什么,于是我们回退一下,但这一回退却是 10s 前的内容,而我们想要的是刚刚听到的那一句话的内容,所以可有:

PotPlayer 设置左右快进的时间(默认是 10 s):

image

➹:potplayer设置前进后退时间_Mr_Cat123的wudl博客-CSDN博客_potplayer 后退

ppambler commented 3 years ago

Snipaste:

Chrome浏览器的快捷键 与 Snipaste 默认绑定的 F1 冲突了,原先,我聚焦到某个网页,按下 F1 是可以直接截图的,可现在不行了,直接打开了「浏览器的帮助页」

如何回到原先的那种操作?

image

必须设置为开机自启动才能勾选「以管理身份」……

➹:有没有哪位大神有屏蔽chrome浏览器所有快捷键的插件? - 知乎

➹:Windows 自动化效率神器:AutoHotkey 使用教程和脚本推荐 - 知乎

➹:AutoHotkey - 知乎

➹:如何设置软件全局快捷键,冲突的话那边能看? - 知乎

➹:1.1第一个Autohotkey程序-快捷键打开(www.autoahk.com)网址-AutoAHK编辑器教程(新建脚本、运行脚本) - AutoAHK

➹:【指南】让重复工作一键完成 - 知乎

➹:让你在 Windows 上也能实现高效操作:AutoHotkey - 少数派

➹:AutoHotkey和Quicker各有什么优势和弊端? - 威廉的回答 - 知乎

➹:【AHK積木】#01 我做了可以用拼圖寫自動化程式的網站! - Autohotkey - YouTube