# macOS应用

brew (opens new window) - macOS最好用的软件包管理器,推荐代理或镜像加速 (opens new window)

# 非开源

Typora (opens new window) - 体验很棒的 markdown笔记App,现已收费,不过你可以下载 Beta Releases

Sublime Text - 打开速度最快的文本编辑器

Magnet - 快捷调整窗口大小

SourceTree (opens new window) - Git图形界面客户端,该有的基本都有

DaisyDisk (opens new window) - 可视化查看硬盘空间大小的App

Clearview - 查看epub、亚马逊电子书

Pixelmator Pro (opens new window) - 去水印、抠图、加滤镜...

MacZip (opens new window) - 超好用的解压工具,可预览,原名eZip

SuspiciousPackage (opens new window) - 查看macOS上pkg格式安装包里面的文件,可以知道往电脑哪里目录写入文件

# 开源

V2rayU (opens new window) - 代理软件

在终端打开(在终端cd 到当前路径) https://github.com/Ji4n1ng/OpenInTerminal/releases

图片压缩:https://github.com/meowtec/Imagine/releases

截图就能翻译,只需按下快捷键、框选文字,简单到令人发指 https://github.com/ripperhe/Bob/releases

截图就可以上传图片到图床(配合笔记类App使用): https://github.com/gee1k/uPic/releases

JSON导出为各种编程语言的类 https://github.com/Ahmed-Ali/JSONExport

剪贴板管理器(Windows、Linux也支持,体验一般) https://github.com/hluk/CopyQ/releases

下载及嗅探工具 https://github.com/persepolisdm/persepolis/releases

提取ipa图片Assets素材的工具 https://github.com/insidegui/AssetCatalogTinkerer/releases

sqlite studio -- SQLite客户端,macOS、Windows、Linux都有 https://github.com/pawelsalawa/sqlitestudio/releases

网络代理 https://github.com/yichengchen/clashX

限制最大充电百分比的 macOS 工具 https://github.com/davidwernhart/AlDente

Wechat Chat History Exporter 微信聊天记录导出程序 https://github.com/BlueMatthew/WechatExporter

# Web 应用

字符画流程图: https://textik.com/ http://asciiflow.com/ http://stable.ascii-flow.appspot.com/

Google的图片在线压缩:https://squoosh.app/index.html

获取IP地址:https://www.v2ex.com/t/695489

# 浏览器插件

# 油猴脚本

在Google搜索结果中轻松隐藏不需要的域名:https://greasyfork.org/zh-CN/scripts/1682-google-hit-hider-by-domain-search-filter-block-sites

# 命令行工具

# 安装ohmyzsh终端增强工具 https://github.com/ohmyzsh/ohmyzsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# 安装homebrew https://brew.sh/
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

$ brew install autojump



# Oh My Zsh自动提示:https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
vim ~/.zshrc
# 修改`.zshrc`文件的 plugins=(git) ==> plugins=(git zsh-autosuggestions)

# rvm https://github.com/rvm/rvm
brew install gpg
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable

# 有时,我们有一段加密文本,但是不知道它使用什么加密方法。这个命令行工具,会根据人工智能算法,自动判断加密方法,能不能解密。
https://github.com/Ciphey/Ciphey

# 各种预览插件 https://github.com/sindresorhus/quick-look-plugins
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize suspicious-package quicklookase qlvideo




# 磁盘信息查看 无权限在前面加sudo
brew install smartmontools
smartctl -a /dev/disk0
smartctl -a /dev/disk0 | egrep "Data|Hours"
#下面是输出 2021.11.29
Maximum Data Transfer Size:         256 Pages
Data Units Read:                    433,393,865 [221 TB]
Data Units Written:                 411,616,331 [210 TB]
Power On Hours:                     1,399
Media and Data Integrity Errors:    0

在任意输入框中按option+shift+K组合键可输入

文本编辑时按 Fn + Delete 键可向后删除内容

精准调节音量. 如果你想要Mac音量比正常的一格还低一些,不妨试试调节音量的同时按住Option + Shift键,音量将以正常的1/4格调整

禁用Creative Cloud自启

launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist

恢复

launchctl load -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist

Mac查看电池健康情况、电池损耗的方法

ioreg -rn AppleSmartBattery | grep -i capacity

# 开发环境

# NodeJS

我抛弃了nvm,改用n,因为nvm没开一个终端tab都要卡顿1秒,实在难受

n - Node.js 多版本安装及切换工具 github.com/tj/n (opens new window)

# 1.安装
brew install n
# 2.配置。创建n所需文件夹并获取`/usr/local/n`目录权限
sudo mkdir -p /usr/local/n
sudo chown -R $(whoami) /usr/local/n

nvm - 另一个node切换工具,不推荐

# nvm https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

# Ruby

#删除旧的ruby第三方应用
gem cleanup

# Terminal终端美化

# ohmyzsh 插件

z.lua github 主页 (opens new window) z.lua作者在知乎的介绍 (opens new window)

#安装
git clone https://github.com/skywind3000/z.lua $ZSH_CUSTOM/plugins/z.lua
vim ~/.zshrc
# 增加一个 plugins=(git z.lua)
source ~/.zshrc

# 使用
z foo       # 跳转到包含 foo 并且权重(Frecent)最高的路径
z foo bar   # 跳转到同时包含 foo 和 bar 并且权重最高的路径
z -r foo    # 跳转到包含 foo 并且访问次数最高的路径
z -t foo    # 跳转到包含 foo 并且最近访问过的路径
z -l foo    # 不跳转,只是列出所有匹配 foo 的路径
z -c foo    # 跳转到包含 foo 并且是当前路径的子路径的权重最高的路径
z -e foo    # 不跳转,只是打印出匹配 foo 并且权重最高的路径
z -i foo    # 进入交互式选择模式,让你自己挑选去哪里(多个结果的话)
z -I foo    # 进入交互式选择模式,但是使用 fzf 来选择
z -b foo    # 跳转到父目录中名称以 foo 开头的那一级

# 终端Shell技巧

Ctrl+w 删除光标前一个单词(一个单词一个单词地删) Ctrl+u 删除这一行

# macOS 小技巧

# 显示or不显示隐藏文件

Shift+Cmd+.

# 允许安装位置来源的软件

sudo spctl --master-disable

# 查看CPU Model

sysctl -n machdep.cpu.brand_string

# 查看你的443端口被那些程序使用,以及他们的pid

sudo lsof -i:443 或者:ps aux | grep 5037

# base64加密解密

# 加密
echo "ILoveYou" | base64
SUxvdmVZb3UK

#解密
echo "SUxvdmVZb3UK" | base64 -D
ILoveYou

# 软件打不开系列问题

# “CleanMyMac 3.app”已损坏,打不开。 您应该将它移到废纸篓。

在系统偏好设置-> 安全性与隐私中显示任何来源

sudo spctl --master-disable

# “微信.app”已被阻止,因为它可能暴露您的隐私并降低Mac的安全性。您应该将它移到废纸篓。

原因:使用了微信小助手插件

解决方法:打开终端运行如下命令:

codesign --sign - --force --deep /Applications/WeChat.app

# 禁止Adobe Creative Cloud等自启

launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
# 或者
launchctl remove net.yanue.V2rayU.Launcher

launchctl 管理OS X的启动脚本,控制启动计算机时需要开启的服务。也可以设置定时执行特定任务的脚本

来自:https://apple.stackexchange.com/a/138945

# 应用路径

# 搜狗输入法
~/Library/Application Support/Sogou
# Chrome插件位置
/Users/pan/Library/Application Support/Google/Chrome/Default/Extensions
#查看python3真实位置,是homebrew安装的还是系统的
realp3="$(which python3)" && ls -al $realp3

# 卸载软件后残留的守护进程(定时任务):

Service could not initialize: Unable to set current working directory. error = 2: No such file or directory, path = /Applications/SunloginClient.app/Contents/MacOS: 20F71: xpcproxy + 23787 方法:

# 列出守护进程(定时任务)
sudo launchctl list

# 卸载向日葵服务
sudo launchctl unload /Library/LaunchDaemons/com.oray.sunlogin.helper.plist
sudo launchctl unload /Library/LaunchDaemons/com.oray.sunlogin.plist

#完全禁用/启用 Spotlight 索引 https://www.technipages.com/macos-sierra-enable-disable-spotlight
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

# 阻止Spotlight索引指定名字的文件夹

# 先cd到你想要排除的路径,将所有子目录名字叫node_modules的不加到索引
# https://github.com/yarnpkg/yarn/issues/6453
find . -type d -path './.*' -prune -o -path './Pictures*' -prune -o -path './Library*' -prune -o -path '*node_modules/*' -prune -o -type d -name 'node_modules' -exec touch '{}/.metadata_never_index' \; -print

# 重新索引
sudo mdutil -i on /

# 文件夹后面带个.noindex就可以防止Spotlight搜到

# Typora 修改内容样式

官方文档:http://theme.typora.io/doc/Write-Custom-Theme/

样式路径~/Library/Application Support/abnerworks.Typora/themes

正文字体大小

html {
    font-size: 1px;
}

短代码块
#write code, tt {
    margin: 0 2px;
    padding: 2px 4px;
    border-radius: 2px;
    font-family: Menlo, Source Sans Pro, Monaco, courier, monospace !important;
    font-weight: bold;
    font-size: 0.85rem;
    color: #9999ff;
    background-color: #000;
    /*background-color: hsla(0, 0%, 0%, 0.2);*/
}
加粗样式改成自己喜欢的颜色
#write strong {
    color: #ff0000;
    padding: 0px 1px 0 1px;
}

.cm-header, .cm-strong {
    font-weight: 700
}
#write mark {
    background-color: #EBFFEB;
    border-radius: 2px;
    padding: 2px 4px;
    margin: 0 2px;
    color: #222;
    font-weight: 500;
}

# 获取IP位置及经纬度

curl ipinfo.io

# brew


adns			libevent		openssl@1.1
annie			libffi			opus
aom			libgcrypt		p11-kit
autoconf		libgpg-error		pcre
autojump		libheif			pinentry
automake		libidn2			pixman
cairo			libimobiledevice	pkg-config
chisel			libksba			postgresql
cmake			libogg			python
coreutils		libomp			python@2
doxygen			libplist		rclone
ffmpeg			libpng			readline
flac			libsamplerate		rtmpdump
fontconfig		libsndfile		rubberband
freetype		libsoxr			scrcpy
frei0r			libtasn1		sdl2
fribidi			libtiff			shared-mime-info
gdbm			libtool			shellcheck
gettext			libunistring		snappy
giflib			libusb			speex
gifsicle		libusbmuxd		sphinx-doc
glib			libvidstab		sqlite
gmp			libvorbis		swig
gnupg			libvpx			tesseract
gnutls			libyaml			theora
graphite2		little-cms2		tmux
harfbuzz		lua			tree
highlight		lua@5.1			uchardet
icu4c			lzo			unbound
ilmbase			mongodb			usbmuxd
imagemagick		mono			vapoursynth
jpeg			mpv			webp
krb5			mujs			wget
lame			ncurses			x264
ldid			nettle			x265
leptonica		ninja			xvid
libarchive		npth			xz
libass			opencore-amr		yasm
libassuan		openexr			youtube-dl
libbluray		openjpeg		zimg
libde265		openssl			zlib

# 硬件知识

笔记本电池最佳电量是50%左右,一直插电的情况下,每个月至少放点一两次,有助于电池健康

要怎么充电才能不伤电池?- Mac云课堂 (opens new window)

上次更新: 3/13/2022, 12:02:34 AM