blog icon indicating copy to clipboard operation
blog copied to clipboard

Macbook: M1 - setup new a device

Open hhstore opened this issue 2 years ago • 13 comments

related:

  • [x] #36 : 初始化一台新 VPS
  • [x] #247 : rust setup
  • [x] #244 : java setup
  • [x] #201 : 搭建 nodejs(前端) 开发环境
  • [x] #17 : 搭建 Python 开发环境
  • [x] #216 : 搭建 Flutter 开发环境
  • [x] #334

hhstore avatar Jan 13 '22 10:01 hhstore

macbook pro 新机器重新配置:

  • 新机器 2021款 MacBook Pro 14 / M1 Max / 32G Mem/ 1T SSD
  • 不准备使用 Time Machine 恢复. 旧的备份, 是7-8年前的.
  • 过于老旧, 是时候和旧的文件说再见.
  • 新的开始.
  • 回首第一台 Mac (2014款 mbp15), 7年过去了, 至今未坏.
  • 这台新机器, 应该会陪伴我度过下一个10年吧.

so, 写个完整版的Mac配置教程, 送给所有Mac新用户.

Mac 定制化步骤:

1. 配套硬件:

  • type-c hub 购买
  • 4k显示器
  • 4k显示器线材
  • 移动硬盘
  • 鼠标: 罗技 G Pro 无线版
  • 键盘: Niz 87T 静电容键盘

2. 软件安装:

for 普通用户:

免费软件

付费软件

for 开发者:

免费软件

付费软件

3. 配置优化:

hhstore avatar Jan 13 '22 10:01 hhstore

软件安装:

通用软件:

免费软件:

Apple 应用商店:

开源软件:

下载软件:

付费软件:

开发者:

  • xcode

hhstore avatar Jan 13 '22 10:01 hhstore

开发者:

first:

  • 安装 xcode 工具(Command Line Tools):
    • https://yuye.fun/post/11e9f5bc.html
    • https://mac.install.guide/commandlinetools/4.html
    • https://www.freecodecamp.org/news/install-xcode-command-line-tools/

xcode-select --install 

xcode-select -p





/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"



  • 使用 brew 安装的列表: https://devhints.io/homebrew
  • 安装 git:

brew install git
brew install wget
brew install fish


# 进入用户目录
cd ~


# 安装
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"


# zsh theme:
wget https://raw.githubusercontent.com/skylerlee/zeta-zsh-theme/master/zeta.zsh-theme

#
cp zeta.zsh-theme ~/.oh-my-zsh/themes

# vim ~/.zshrc
ZSH_THEME="zeta"

# 自带:
ZSH_THEME="candy"

# 登出账号
exit


  • xcode

  • Android studio : https://developer.android.com/studio

  • Goland

  • Pycharm

  • webStorm

  • 搭建 python 开发环境:

hhstore avatar Jan 13 '22 11:01 hhstore

免费软件:

付费软件:

chat app:

hhstore avatar Jan 13 '22 11:01 hhstore

ref:

  • https://github.com/jaywcjlove/awesome-mac

hhstore avatar Jan 13 '22 11:01 hhstore

dev:

  • vscode

  • 生成新的 ssh-key: https://github.com/hhstore/blog/issues/74

  • https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

ssh-keygen -t ed25519 -C "[email protected]"

安装 go-task:

  • https://taskfile.dev/#/installation

brew install go-task/tap/go-task

docker:

  • https://www.docker.com/products/docker-desktop

shell : fish 定制:

  • https://github.com/fish-shell/fish-shell
  • https://github.com/oh-my-fish/oh-my-fish
  • http://www.ruanyifeng.com/blog/2017/05/fish_shell.html
brew install fish

参考配置:

  • https://github.com/nvie/dotfiles
  • https://github.com/caarlos0/dotfiles.fish

hhstore avatar Jan 13 '22 11:01 hhstore

fish env 设置:

  • https://fishshell.com/docs/current/index.html#configuration
  • https://fishshell.com/docs/current/language.html?highlight=env

# Don't shorten the working directory in the prompt
set -g fish_prompt_pwd_dir_length 0

# Set my preferred cursor style:
function setcursors
   set -g fish_cursor_default block
   set -g fish_cursor_insert line
   set -g fish_cursor_visual underscore
end

# Set my language
set -gx LANG de_DE.UTF-8

bugfix:

  • iterm2 对 fish 检查比较严格.
  • 需要把 env.fish 放入 conf.d/ 文件夹内.
  • 避免 PATH 环境变量设置无效, 解析不到.

hhstore avatar Jan 13 '22 12:01 hhstore

解决显示器睡眠唤醒问题:

  • m1 mac 使用 type-c 连接显示器有问题.建议使用HDMI线材 or 雷电4 线材.
  • 命令行, 关闭如下选项.
# 查看:
pmset -g custom

# 关闭:
sudo pmset -a powernap 0


hhstore avatar Jan 13 '22 12:01 hhstore

配置优化:

  1. 显示隐藏文件夹:
  • https://sspai.com/post/26273


defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder


  1. 多桌面-固定窗口顺序
  • http://blog.itpub.net/69984519/viewspace-2725114/
  • 打开 系统偏好设置,点击 调度中心, 取消勾选 根据最近的使用情况自动重新排列空间

image

hhstore avatar Jan 18 '22 14:01 hhstore

针对中国区用户的优化设置:

homebrew mirror:

  • https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"



nodejs NPM mirror:

  • https://npmmirror.com/

npm config set registry https://registry.npmmirror.com

npm config get registry

python + pip mirror:


# 临时使用: 
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

# 更新: 
pip install pip -U
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U

# 永久设置: 
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple




hhstore avatar Jan 18 '22 14:01 hhstore

M1 安装虚拟机 VMware:

  • https://zhuanlan.zhihu.com/p/490582217
  • https://zhuanlan.zhihu.com/p/452412091
  • https://sspai.com/post/69893
  • https://macwk.com/soft/vmware-fusion

注册码:


安装步骤:
arm m1 用户需注意,不支持安装 windows arm 系统,仅支持安装 linux arm 系统

1.	双击「VMware Fusion」打开安装程序,输入电脑密码,点击「好」,然后点击「同意」
2.	出现激活界面,将下面的许可证密钥复制粘贴到对应位置,然后点击「继续」
3.	输入电脑密码,点击「好」
4.	激活成功,尽情享用吧!

许可证密钥一:
ZF3R0-FHED2-M80TY-8QYGC-NPKYF

许可证密钥二:
YF390-0HF8P-M81RQ-2DXQE-M2UT6

许可证密钥三:
ZF71R-DMX85-08DQY-8YMNC-PPHV8



安装 Ubuntu Arm 版本:

image

安装 debian arm 版本:

  • 可能 debian 更稳定.
  • https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/
  • https://www.debian.org/CD/http-ftp/#mirrors
  • mirror 源下载: http://mirrors.163.com/debian-cd/

hhstore avatar Jan 18 '22 14:01 hhstore

1

hhstore avatar Jan 18 '22 14:01 hhstore

app 清单:

app 损坏修复:

  • https://xclient.info/a/4f212972-733a-5d3d-b3a5-dca2557cf2db.html


sudo xattr -d com.apple.quarantine /Applications/Bartender\ 4.app/

sudo xattr -d com.apple.quarantine /Applications/PopClip.app/

sudo xattr -d com.apple.quarantine /Applications/Hazel.app/


开发工具:

  • ✅ https://xclient.info/s/c/dev/
  • https://xclient.info/s/sublime-text.html

hhstore avatar Dec 24 '22 13:12 hhstore