Skip to content
Tolshao
Go back

Mac设置

系统相关

系统安装工具

Mac两个bin目录

相同点

/usr/bin和/usr/local/bin都是用来存储终端命令二进制文件或者命令的软链接 这两个bin目录都是已经包含在环境变量里的目录,程序放在里面或者链接到里面命令就可以在终端里直接执行。

不同点

Mac的/usr/bin目录是不允许增删文件的,/usr/local/bin增删文件来实现在终端里直接运行,只需要有管理员权限。

Terminal——终端

sudo xattr -r -d com.apple.quarantine /Applications/Sketch.app/
vim .bash_profile

粘贴入下列代码

# proxy list
alias proxy='export all_proxy=socks5://127.0.0.1:1086'
alias unproxy='unset all_proxy'

control + c 键入wq保存退出 保存隐藏文件到环境变量

source .bash_profile

咳血上网

iTerm2

配置免密登录ssh

#!/usr/bin/expect

set ip [lindex $argv 0]
set user [lindex $argv 1]
set password [lindex $argv 2]

set timeout 10
spawn ssh $user@$ip
expect {
        "*yes/no" {send "yes\r";exp_continue}
        "*password:" {send "$password\r"}
}
interact

上述三个argv是变量传参的接口

在配置iterm2(iTerm2 -> Preferences -> Profiles)

hosts修改

shift+command+G 前往 /private/etc/

Mac系统插件推荐

Mac OS X 11中的/usr/bin 的“Operation not permitted”

https://www.jianshu.com/p/22b89f19afd6

设置mac PATH

在mac系统下打开终端,输入: touch .bash_profile open -e .bash_profile 这样会弹出一个“.bash_profile”文件. 打开文件后应该是空白的,在文件中添加: export PATH=${PATH}:????

其中????代表你电脑中adb文件的路径,本人的配置文件如下: export PATH=${PATH}:~/Library/Android/sdk/platform-tools 添加完后,保存并关闭文件,至此,adb配置完毕。

前往网上邻居

finder目录command+K One cloud: smb://192.168.31.200

mac除了magicmouse外,蓝牙鼠标发飘,延迟的问题

  1. 打开“系统偏好设定”,然后点击下面的“网络”图标,打开“网络”设定界面。在这里,一般会看到三个:wi-fi、蓝牙、Thunderbolt 网桥三个连接。
  2. 在“网络”窗口的左下角,会看到三个图标:“+”、“-”,最后一个是齿轮。点击这个齿轮,选择“设定服务顺序”
  3. 用鼠标点按住蓝牙PAN,往上拖到第一的位置,保存、应用。

Terminal commands

图片本地压缩工具:imageoptim aaa.jpg 开源软件安装:brew install example python库安装pip3 install example 最后更新配置的环境变量source .bash_profile

同理:http代理设置如下:

export http_proxy="http://localhost:1087"
export https_proxy="http://localhost:1087"

brew 源替换清华 git 太慢的解决办法

  1. https://www.ipaddress.com/查询网址对应ip
  2. 手动更改hosts
199.232.68.133 raw.githubusercontent.com
199.232.69.194 github.global.ssl.fastly.net
140.82.114.4 github.com
  1. 刷新dns缓存 sudo dscacheutil -flushcache

  2. git 代理设置 手动操作

git config --global http.proxy socks5://127.0.0.1:1086;
git config --global https.proxy socks5://127.0.0.1:1086
git config --global --unset http.proxy
git config --global --unset https.proxy
alias git_proxy='git config --global http.proxy socks5://127.0.0.1:1086; git config --global https.proxy socks5://127.0.0.1:1086'
alias ungit_proxy='git config --global --unset http.proxy; git config --global --unset https.proxy'

查看是否添加上: cat ~/.gitconfig

cd "$(brew --repo)"
# 查看远程仓库
git remote -v
# 删除远程
git remote rm origin 
# 添加阿里源 :
git remote add origin https://mirrors.aliyun.com/homebrew/brew.git
# 切换成阿里源: 
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
# 查看远程仓库 
git remote -v 
# 删除远程: 
git remote rm origin 
# 添加阿里源 :
git remote add origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 切换成阿里源: 
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote rm origin 
git remote add origin https://mirrors.ustc.edu.cn/homebrew-cask.git
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

在~/.zshrc文件最后,增加一行: source ~/.bash_profile

UEFI多系统引导工具

Finder

硬盘

ntfs原生挂载

terminal: sudo nano /etc/fstab LABEL=Elements\040SE none ntfs rw,auto,nobrowse \040代表空格 ctrl + x 保存,y确定

外接硬盘无法挂载

需要先进行检查修复

diskutil list
diskutil repairVolume /dev/disk4
diskutil mount /dev/disk4

Coding

Latex

  1. 文献不引用编译会报错,修正方法,clean过程文件,重新编译
  2. mac vs code 改编译器
  3. mac vs_code skim_pdf_viewer设置
  4. vscode-skim正向同步:命令行,sync from cursor,快捷键option+command+J
  5. vscode-skim反向同步:shift+command+click
  6. vscode-编译:command + shift + B
  7. xelatex编译慢的解决办法,重建字体缓存fc -cache -fv

Mac中输入latex公式,用mathtype编译

mac word 中键入latex公式 输入格式如下f(x)=a2+2f(x) = a^2+2 按下option(alt)+\,mathtype会编译,并且可以修改

其他插件-多数可见

pdf: PDF Expert、skim 远程控制: AnyDesk 文献管理: Mendeley Desktop 编程学习: Code Runner 翻墙: xx.net Markdown:MWeb,使用说明 safari 插件:polyglot,双击选中翻译

Python


1.从mac字体目录/System/Library/Fonts
添加SimHei字体(simhei.ttf文件)到
/usr/local/lib/python3.7/site-packages/matplotlib/mpl-data/fonts/ttf/xxx.ttf
2.rm -rf ~/.matplotlib/*.cache
注意rm -rf命令,确认路径没错在用设置matplotlib使用的字体资源
我是直接重命名的方式,避免出错。
3.
代码中添加
mpl.rcParams['font.sans-serif'] = u'SimHei'
[更改字体](https://blog.csdn.net/gmr2453929471/article/details/78655834)

黑苹果安装

Something interesting

US-fake信息

https://www.fakenamegenerator.com/index.php#

mac手柄ps3 controller

最后发现,先启动retroarch之后,手柄就可以在openemu等平台使用

mac——安卓刷机

android adb 黑域 adb devices adb -d shell sh /data/data/me.piebridge.brevent/brevent.sh

fastboot模式:adb reboot bootloader

mac_adb_安卓刷机

pixel_root教程

TWRP下载地址:第三方recovery root 管理器:magisk

安卓10root


Share this post on:

Previous Post
控制理论笔记
Next Post
Latex设置