外接键盘键位的映射

想念qk100的每一天

安装karabiner-elements

command、control、option的映射

改变映射

shift映射成ctrl+space
{
"title": "Custom Modifications",
"rules": [
{
"description": "Change shift to ctrl",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_control"
}
]
}
]
}
]
}
```json
{
"title": "Custom Modifications",
"rules": [
{
"description": "Change left_shift alone to ctrl-space, keep shift functionality",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": ["any"]
}
},
"to_if_alone": [
{
"key_code": "spacebar",
"modifiers": ["left_control"]
}
],
"to": [
{
"key_code": "left_shift"
}
]
}
]
}
]
}

安装应用已损坏

sudo xattr -r -d com.apple.quarantine /绝对路径

fisher

有毒

curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher

令人窒息

好像是Ubuntu的原因 fish版本的原因

ubuntu fish

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt install fish

Debianfish安装地址

fisher install IlanCosman/tide@v5

docker

ctfd(艰难)

最后还是docker-compose救了我

frps/frpc 好难aaaaa

出题

docker buildx build --platform linux/amd64 -t spirit001 . amd!!!

docker tag spirit111:latest dionysus13931/spirit111:latest标记

docker push dionysus13931/spirit111:latest推送

docker build -t dionysus19391/spirit001:latest . && docker push dionysus19391/spirit001:latest

抓本地包

Firefox默认不允许抓本地包,打开 about:config 页面,搜索 network.proxy.allow_hijacking_localhost 双击变为true即可

密钥登录远程服务器

  • ssh-keygen
  • cat /ssh/ssh-key-for-yun.pub
  • 登录远程服务器
  • mkdir -p ~/.ssh
  • echo "YOUR_PUBLIC_KEY_CONTENT" >> ~/.ssh/authorized_keys
  • chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys

新mac

先装固定的软件,就不多说了,接下来是shell

git clone https://gitlab.com/phoneybadger/pokemon-colorscripts.git
cd pokemon-colorscripts
sudo ./install.sh

就用默认的zsh就行了吧,不折腾了,终端用wezterm
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
先安装zinit

安装完,代理弄好,直接cv文件

#.zshrc_mac

copydir ()
{
pwd | pbcopy
}
------------------------------------------------------------------
#.zshrc

# 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.
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


pokemon-colorscripts --no-title -r 1,3,6

#######################################################################
# General settings #
#######################################################################
# Enable autocompletion
autoload -Uz compinit

# case insensitive completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'

#set the PERMISSIONS for newly-created files
umask 077

#######################################################################
# zinit configurations #
#######################################################################
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

# git.zsh is required by some omz plugins
# zinit ice wait lucid
# zinit snippet OMZ::lib/git.zsh

# Install a OMZ plugin with multiple files
# zinit ice svn lucid
# zinit snippet OMZ::plugins/pip

zinit ice as"completion"
#zinit snippet OMZ::plugins/docker/_docker

# pure theme
# zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh'
# zinit light sindresorhus/pure
zinit ice depth=1; zinit light romkatv/powerlevel10k
# spaceship theme
# zinit ice depth'1'
# zinit light denysdovhan/spaceship-prompt

# zinit light skywind3000/z.lua

zinit light softmoth/zsh-vim-mode

zinit ice wait lucid atload'_zsh_autosuggest_start'
zinit light zsh-users/zsh-autosuggestions

zinit ice wait lucid
zinit load zdharma-continuum/fast-syntax-highlighting

zinit load MichaelAquilina/zsh-auto-notify

#######################################################################
# Plugin settings #
#######################################################################

# tweak the pure theme
zstyle :prompt:pure:path color "green"

# tweak spaceship theme
SPACESHIP_USER_SHOW=needed
SPACESHIP_VI_MODE_SHOW=false

# cursor configurations for zsh-vim-mode
MODE_CURSOR_VICMD="green block"
MODE_CURSOR_VIINS="#20d08a blinking bar"
MODE_CURSOR_SEARCH="#ff00ff blinking underline"

# mode configuration for zsh-vim-mode, shown on the right (RPS1 stuff)
MODE_INDICATOR_VIINS='%F{15}<%F{8}INSERT<%f'
MODE_INDICATOR_VICMD='%F{10}<%F{2}NORMAL<%f'
MODE_INDICATOR_REPLACE='%F{9}<%F{1}REPLACE<%f'
MODE_INDICATOR_SEARCH='%F{13}<%F{5}SEARCH<%f'
MODE_INDICATOR_VISUAL='%F{12}<%F{4}VISUAL<%f'
MODE_INDICATOR_VLINE='%F{12}<%F{4}V-LINE<%f'

# Make it work with your existing RPS1 if it is set. Note the single quotes
setopt PROMPT_SUBST
RPS1='${MODE_INDICATOR_PROMPT} ${vcs_info_msg_0_}'

# configuration for zsh-auto-notify
export AUTO_NOTIFY_THRESHOLD=20

#######################################################################
# Environment variables #
#######################################################################

# -M: verbose mode
# -N: show line number
# -s: squeeze blank lines to single blank line
export LESS='-RMs'
export PAGER=less
export VISUAL=vi
export LC_COLLATE='C'
export LC_ALL="en_US.UTF-8"
export LANG=en_US.UTF-8
export KEYTIMEOUT=30

# use nvim as man pager
if [[ "$(command -v nvim)" ]]; then
export EDITOR='nvim'
export MANPAGER='nvim +Man!'
export MANWIDTH=999
fi

setopt noclobber # Do not overwrite existing files by default
setopt autocd # cd to a directory if only name is provided
setopt correct_all # correct misspelled command
setopt no_case_glob # case-insensitive globbing

export HISTFILE=~/.histfile
export HISTSIZE=1000000
export SAVEHIST=1000000

setopt HIST_IGNORE_ALL_DUPS # do not put duplicated command into history list
setopt HIST_SAVE_NO_DUPS # do not save duplicated command
setopt HIST_REDUCE_BLANKS # remove unnecessary blanks
setopt INC_APPEND_HISTORY_TIME # append command to history file immediately after execution
setopt EXTENDED_HISTORY # record command start time

# let comments work in interactive shell
setopt INTERACTIVE_COMMENTS

#######################################################################
# custom alias #
#######################################################################
alias zshconfig="nvim ~/.zshrc"
alias grep="grep -E -n --color=auto"
alias ls='ls -F --color=auto'
alias less="less -m"
alias hexdump='hexdump -C'
alias ll="ls -l --color=auto"
alias ldot='ls -d .??*'
alias cp='nocorrect cp -i'
alias mv='nocorrect mv -i'
alias cls="clear"
alias ls='exa'
alias history="fc -l 1"
# below alias taken from https://github.com/zimfw/history/blob/master/init.zsh
alias history-stat="fc -ln 0 | awk '{print \$1}' | sort | uniq -c | sort -nr | head"

#######################################################################
# key binding settings #
#######################################################################
# Use vim key binding instead of the default emacs key binding
# bindkey -v

# For terminal which can not understand home and end key on zsh shell
# https://anjia0532.github.io/2017/09/10/zsh-home-end-keypad-not-work/
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line

#######################################################################
# custom functions #
#######################################################################

mkcd ()
{
mkdir -p -- "$1" &&
cd -P -- "$1"
}

# Note that we need to use compinit command after we add new completions to
# some command or update the completion behavior. Instead of running the
# command multiple times, running it at the end of the zshrc seems okay.
compinit

if [[ $(uname) == "Darwin" ]]; then
source .zshrc_mac
else
source .zshrc_linux
fi

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

echo "typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet" >> .p10k.zsh
brew install zsh-autosuggestions
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh

差不多了先睡了

brew install fzf
brew install zsh-history-substring-search
echo 'source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc

存一下

Ctrl + A:移动到行首
Ctrl + E:移动到行尾
Ctrl + B:向左移动一个字符
Ctrl + F:向右移动一个字符
Ctrl + P:向上移动一行
Ctrl + N:向下移动一行
Ctrl + D:删除光标后面的字符
Ctrl + H:删除光标前面的字符
Ctrl + K:删除光标后面的所有字符
Ctrl + U:删除光标前面的所有字符
Ctrl + W:删除光标前面的一个单词
Ctrl + T:交换光标前后两个字符
Ctrl + O:插入一个新行,光标在当前行的下一行
Ctrl + L:清屏并将光标移动到屏幕顶部