-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_firstsetup
111 lines (92 loc) · 4.25 KB
/
.bash_firstsetup
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env bash
# personal private stuffs (-pre)
. ~/.bash_private_pre
# 系统设置 轻点点按 control/capslock互换 *三指拖移 dock删除无用 dock缩小+动画
# 设置hostname - https://knowledge.autodesk.com/search-result/caas/sfdcarticles/sfdcarticles/Setting-the-Mac-hostname-or-computer-name-from-the-terminal.html
scutil --set HostName $HOSTNAME
# zsh - https://ohmyz.sh/ - 复制命令运行
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# ~/.bashrc - 新建~/.bashrc ~/.bash_profile 并在后者和.zshrc引用前者
# 如 touch ~/.bashrc
# 如 echo '. ~/.bashrc' >> ~/.bash_profile
# 如 echo '. ~/.bashrc' >> ~/.zshrc
# homebrew - https://brew.sh - 复制命令运行
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install m-cli tree redis mongodb thefuck autojump
# m-cli
# 如版本不够新 则 curl -fsSL https://raw.githubusercontent.com/rgcr/m-cli/master/install.sh | sudo sh
m finder showhiddenfiles YES # 显示隐藏文件
m finder showpath YES # 显示完整路径
# 设置git用户
git config --global user.name $GIT_USERNAME
git config --global user.email $GIT_EMAIL
# 以 gitlab - account - private token 当密码做 git clone
# nvm
# brew install nvm
# Homebrew installation is not supported. If you have issues with homebrew-installed nvm, please brew uninstall it, and install it using the instructions below, before filing an issue.
# http://nvm.sh/
unset NVM_HOME
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
# 复制启动命令到 ~/.bashrc -- echo ... > ~/.bashrc
# 设置nvm镜像 - https://www.jianshu.com/p/bc56e70303f7
# nvm ls-remote returns N/A #3322
# https://github.com/nvm-sh/nvm/issues/3322
# export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
# export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/node
export chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver
export puppeteer_download_host=https://cdn.npm.taobao.org/dist
# 默认禁用puppeteer可执行文件下载 需要时再手动开启
# https://github.com/puppeteer/puppeteer/issues/244
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
brew cask install sogouinput alfred iterm2 spectacle google-chrome visual-studio-code sourcetree
brew cask install charles db-browser-for-sqlite youdaodict firefox wechatwebdevtools
# alfred spectacle 勾选开机启动
# sogou设置 简约黑 每页展示数5=>9
# chrome插件 viumium octotree react-devtools redux-devtools
# chrome插件 SwitchyOmega 划词翻译
# vscode插件 gitlens prettier eslint
# iterm Preferences - Profiles - General - Working Directory - Reuse previous seesion's directory
# sourcetree 分体暂存视图
# sourcetree git设置 合并时不使用快进 *追踪分支默认变基
# node20 LTS
export NVM_DEFAULT_NODE='20'
nvm install $NVM_DEFAULT_NODE
nvm alias default $NVM_DEFAULT_NODE
# npm 默认taobao镜像 最近npmjs官方太卡了
# npm config set registry https://registry.npm.taobao.org/
# npm config set registry https://registry.npmmirror.com/
npm install nrm
nrm use taobao
npm i -g whistle imagemin-cli fanyi jayin pm2 hotel
npm i -g typescript create-react-app
npm i -g yarn pnpm @antfu/ni
# whistle
# whistle https证书下载安装 并设置始终信任 配置系统代理8899
# whistle https 与ProxySwitchyOmega冲突 需关掉后者
# npm mirrows
# 添加公司内部源 或私有源
# nrm add company https://your.company.com/
# pm2 processes
pm2 startup # 执行给出的一段命令 注册自启动
pm2 start --name=whistle w2 -- run
# (cd xxx/aaa && pm2 start --name=aaa npm -- start)
# (cd xxx/bbb && pm2 start --name=bbb npm -- start)
pm2 save
# hotel processes
# cd xxx/aaa && hotel add 'npm start' -n aaa -p 8081
# cd xxx/bbb && hotel add 'npm run dev' -n bbb -p 8082
# deno
curl -fsSL https://deno.land/x/install/install.sh | sh
# jog bin
# chmox +x $PATH:$FRITXBASH_PATH/bin/jog
# Go 国内加速:Go 国内加速镜像
# https://learnku.com/go/wikis/38122
# 启用 Go Modules 功能
go env -w GO111MODULE=on
# 配置 GOPROXY 环境变量,以下三选一
# 1. 七牛 CDN
go env -w GOPROXY=https://goproxy.cn,direct
# 2. 阿里云
# go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
# 3. 官方
# go env -w GOPROXY=https://goproxy.io,direct