IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    命令 · 看不见我的美 · 是你瞎了眼

    馬腊咯稽发表于 2021-10-28 00:00:00
    love 0

    创建可引导的 macOS 安装器

    1
    2
    
    # https://support.apple.com/zh-cn/HT201372
    sudo /Applications/Install\ macOS\ ${版本名称,比如:Monterey}.app/Contents/Resources/createinstallmedia --volume /Volumes/${U 盘名称,比如:MyVolume}
    

    bash 与 zsh 的相互切换

    1
    2
    3
    4
    
    # 切换到 bash
    chsh -s /bin/bash
    # 切换到 zsh
    chsh -s /bin/zsh
    

    本地安装了哪些 brew 包

    1
    
    brew list
    

    本地安装了哪些 npm 包

    1
    
    npm list -g --depth=0
    

    不检查 Monterey 更新

    1
    2
    3
    4
    5
    6
    
    # 重置忽略的更新
    sudo softwareupdate --reset-ignored
    # 忽略软件的更新
    sudo softwareupdate --ignore "macOS Monterey"
    # 清除菜单小红点
    defaults write com.apple.systempreferences AttentionPrefBundleIDs 0
    

    启用 M1 限定主题

    1
    2
    3
    
    defaults write -g NSColorSimulateHardwareAccent -bool YES
    # 3-Yellow、4-Green、5-Blue、6-Pink、7-Purple、8-Orange
    defaults write -g NSColorSimulatedHardwareEnclosureNumber -int 3
    

    获取项目目录结构

    1
    
    tree -I "node_modules"
    

    获取管理员权限

     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
    
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="获取管理员权限"
    "Icon"="C:\\Windows\\System32\\imageres.dll,102"
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    
    [HKEY_CLASSES_ROOT\exefile\shell\runas2]
    @="获取管理员权限"
    "Icon"="C:\\Windows\\System32\\imageres.dll,102"
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    
    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="获取管理员权限"
    "Icon"="C:\\Windows\\System32\\imageres.dll,102"
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    

    系统完整性保护

    1
    2
    3
    4
    5
    6
    
    # 查看 SIP
    csrutil status
    # 打开 SIP
    csrutil enable
    # 关闭 SIP
    csrutil disable
    

    安装 hugo@0.56

    1
    2
    3
    4
    5
    6
    
    # 1. brew tap <org>/<repo> https://github.com/<org>/<repo>
    brew tap gohugoio/hugo https://github.com/gohugoio/hugo
    # 2. brew extract --version <version> <module name> <org>/<repo>
    brew extract --version 0.56.0 hugo gohugoio/hugo
    # 3. brew install <module name>@<version>
    brew install hugo@0.56.0
    

    允许“任何来源”

    1
    
    sudo spctl --master-disable
    

    重置“黑暗模式”

    1
    2
    
    defaults write -g NSRequiresAquaSystemAppearance -bool Yes
    defaults delete -g NSRequiresAquaSystemAppearance
    

    移除文件属性

    1
    
    xattr -c -r ${文件路径}
    

    常用 git 命令

     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
    
    git add --all
    git add .
    
    git branch -d/D development
    git branch development
    
    git checkout -b/B development
    git checkout -f development
    git checkout -- index.md
    git checkout 3de4537
    
    git cherry-pick 3de4537
    
    git commit -am "用户子系统开发" --no-verify
    git commit -m "修复登录失败"
    git commit --amend --no-edit
    git commit --amend
    
    git fetch origin development
    git fetch origin --prune
    
    git log --graph --pretty=oneline --abbrev-commit
    git log --pretty=format:"%h - %an, %ar : %s"
    git log --pretty=oneline
    git log --pretty=short
    git log --stat
    git log -p
    
    git pull --merge
    git pull --rebase
    git pull --rebase --autostash
    
    git push origin --delete development
    git push --set-upstream origin development
    git push -f
    
    git rebase origin/development --no-reapply-cherry-picks
    git rebase origin/development --reapply-cherry-picks
    git rebase origin/development --autostash
    git rebase origin/development
    git rebase -i 3de4537
    git rebase -i --root
    
    git remote add origin https://github.com/source.git
    git remote prune origin
    git remote show origin
    git remote -v
    
    git reset --hard HEAD^
    git reset --mixed HEAD^
    git reset --soft HEAD^
    
    git revert 3de4537
    
    git stash apply
    git stash clear
    git stash list
    git stash pop
    git stash
    
    git status
    # 附注标签
    git tag -a v1.4 -m "version 1.4"
    # 轻量标签
    git tag v1.4
    # 在之前 commit 处打标签
    git tag -a v1.2 9fceb02
    # 删除远程标签
    git push origin :refs/tags/v1.4
    git push origin --delete v1.4
    # 删除本地标签
    git tag -d v1.4
    
    git tag -l "v1.8*"
    git tag --list
    
    git show v1.4
    

    软件已损坏

    1
    
    sudo xattr -d com.apple.quarantine /Applications/${软件}.app
    

    代理终端

    1
    
    export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
    

    解压 pkg

    1
    2
    
    # 将 Edge.pkg 解压到同目录 Edge 文件夹下
    pkgutil --expand Edge.pkg ./Edge
    


沪ICP备19023445号-2号
友情链接