This commit is contained in:
Luk 2024-04-16 12:16:34 +08:00
parent 5753b72fa3
commit d612f10ed9
6 changed files with 54 additions and 17 deletions

View File

@ -20,7 +20,7 @@ then
# 用 dpkg --print-architecture 更直接
ARCH=`dpkg --print-architecture`
else
if [ "$(uname -m)" = "aarch64" ]
if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ] # on MacBook Air M2, $(uname -m) returns 'arm64'
then
ARCH=arm64
elif [ "$(uname -m)" = "armv7l" ]

9
mac-accelerate-backup.sh Normal file
View File

@ -0,0 +1,9 @@
# https://blog.csdn.net/fuxin123123/article/details/122288466
# Mac TimeMachine 全速备份
# 如果你的 Mac 是第一次备份,一般都很慢,可以调节参数的方式将其调节为全速进行备份,记得备份完后将其调整回来,否则可能会导致你的电脑在正常使用的时候由于同时在备份导致卡顿。
# 打开终端,执行如下命令开启全速备份:
# 测试发现,对通过 Finder 备份 iPhone 也有效
sudo sysctl debug.lowpri_throttle_enabled=0
# 关闭全速备份:
sudo sysctl debug.lowpri_throttle_enabled=1

View File

@ -1,6 +1,6 @@
defaults write com.apple.dock springboard-rows -int 9
defaults write com.apple.dock springboard-columns -int 12
defaults write com.apple.dock springboard-columns -int 15
defaults write com.apple.dock ResetLaunchPad -bool true

View File

@ -1,5 +1,21 @@
# install: https://docs.brew.sh/Installation
# 用 *.pkg 安装的效果和命令行其实一样
echo "Installing Homebrew on MacOS"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# default brew path: /opt/homebrew for Apple Silicon, /usr/local/Homebrew for macOS Intel and /home/linuxbrew/.linuxbrew for Linux
# add brew to path:
# (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/luk/.bash_profile
# eval "$(/opt/homebrew/bin/brew shellenv)"
#
# export HOMEBREW_PREFIX="/opt/homebrew";
# export HOMEBREW_CELLAR="/opt/homebrew/Cellar";
# export HOMEBREW_REPOSITORY="/opt/homebrew";
# export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}";
# export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:";
# export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}";
#
# uninstall: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
# uninstall: https://github.com/homebrew/install#uninstall-homebrew
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
# install emacs: brew cask install emacs

View File

@ -77,7 +77,7 @@ umask 022 # rwxr-xr-x
# PROMPT_COMMAND is expanded only when used.
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;<${USER}@${HOSTNAME}::${PWD}>B\007"'
PROMPT_COMMAND='echo -ne "\033]0;<${USER}@${HOSTNAME}:${PWD}>B\007"'
;;
dumb*)
;;
@ -130,6 +130,17 @@ xterm*|rxvt*)
esac
############## above settings copied from amazon's debian ####################
if [ "$(uname)" = "Darwin" ]
then
if [ "$(uname -m)" = "arm64" ] && [ -f /opt/homebrew/bin/brew ]
then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [ "$(uname -m)" = "x86_64" ] && [ -f /usr/local/homebrew/bin/brew ]
then
eval "$(/usr/local/homebrew/bin/brew shellenv)"
fi
fi
# nvm settings
if [ -d $HOME/.nvm ]
then
@ -139,6 +150,12 @@ then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fi
# fnm settings
# if [ $(which fnm) ]
# then
# eval "$(fnm env --use-on-cd)"
# fi
# acme.sh settings
if [ -f $HOME/.acme.sh/acme.sh.env ]
then
@ -150,15 +167,10 @@ fi
export USERPROFILE=$HOME
# # add sysconfig to path
# tp1=/faronear/sysconfig
# tp2=~/sysconfig
# if [ -d $tp1 ]
# then
# export PATH=$tp1:$PATH
# elif [ -d $tp2 ]
# then
# export PATH=$tp2:$PATH
# fi
if [ -e ~/sysconfig ]
then
export PATH=~/sysconfig:$PATH
fi
if [ -f ~/.bashrc_custom ]
then

View File

@ -9,9 +9,9 @@ fi
# function proxy() {
if [ "$proxySwitch" == "s" ] || [ "$proxySwitch" == "1" ]; then
export all_proxy=socks5://127.0.0.1:1086
export http_proxy=socks5://127.0.0.1:1086
export https_proxy=socks5://127.0.0.1:1086
export all_proxy=socks5://127.0.0.1:7898
export http_proxy=socks5://127.0.0.1:7898
export https_proxy=socks5://127.0.0.1:7898
echo -e "--- 已开启网络代理"
elif [ "$proxySwitch" == "t" ] || [ "$proxySwitch" == "0" ]; then
unset all_proxy