MacOS Big Sur 配置及使用记录

admin 2021年11月29日16:47:49评论240 views字数 6057阅读20分11秒阅读模式

作为近几年以来变化最大的 macOS 更新,macOS Big Sur 对内置应用的图标、应用的设计语言、桌面的程序坞和菜单栏等方面都进行了重新设计,拟物化的风格深得人心。

虽说 “BugSur” 的名号不是白来的,但是在我近半年的使用体验来看,暂时没有遇到过实在无法解决的问题,所以还是很推荐有 “余力” 的 Mac 升级 BigSur 的,拥抱新事物总会有令人开心的地方 ~

本文会不断记录使用过程中遇到的各种问题,以及能提升幸福感的 macOS 配置。

Mac 配置

image-20210511124753664


系统快捷键

剪切、拷贝、粘贴和其他常用快捷键
Command + X 剪切所选项并拷贝到剪贴板
Command + C 将所选项拷贝到剪贴板。这同样适用于“访达”中的文件
Command + V 将剪贴板的内容粘贴到当前文稿或 App 中。这同样适用于“访达”中的文件
Command + Z 撤销上一个命令。随后您可以按 Shift + Command + Z 来重做,从而反向执行撤销命令。在某些 App 中,您可以撤销和重做多个命令
Command + A 全选各项
Command + F 查找文稿中的项目或打开“查找”窗口
Command + G 再次查找:查找之前所找到项目出现的下一个位置。要查找出现的上一个位置,请按 Shift + Command + G
Command + H 隐藏最前面的 App 的窗口。要查看最前面的 App 但隐藏所有其他 App,请按 Option + Command + H
Command + M 将最前面的窗口最小化至“程序坞”。要最小化最前面的 App 的所有窗口,请按 Option + Command + M
Command + O 打开所选项,或打开一个对话框以选择要打开的文件
Command + P 打印当前文稿
Command + S 存储当前文稿
Command + T 打开新标签页
Command + W 关闭最前面的窗口。要关闭 App 的所有窗口,请按下 Option + Command + W
Option + Command + Esc 强制退出 App
Command + 空格键 显示或隐藏“聚焦”搜索栏。要从“访达”窗口执行“聚焦”搜索,请按 Command + Option + 空格键。
Control + Command + 空格键 显示字符检视器,您可以从中选择表情符号和其他符号
Control + Command + F 全屏使用 App(如果 App 支持)
空格键 使用快速查看来预览所选项
Command + Tab 在打开的 App 中切换到下一个最近使用的 App
Shift + Command + 5 在 macOS Mojave 或更高版本中,拍摄截屏或录制屏幕。也可以使用 Shift + Command + 3 或 Shift + Command + 4 来拍摄截屏。
Shift + Command + N 在“访达”中创建一个新文件夹
Command + , (逗号) 打开最前面的 App 的偏好设置

— 软件 —

核心生产力:https://macwk.com/

iTerm2

macOS 灵魂软件

配置效果:

image-20210511125327640

Zsh

zsh 是一款功能强大的 shell 软件,它可以兼容 bash,并且提供了很多高效的改进。它是Linux里最庞大的一种shell,它有84个内部命令,也提供了更为强大的功能:

  • 更好的自动补全
  • 更好的文件名展开
  • 丰富的插件
  • 强大的定制性

配置文件

1
vim .zshrc

插件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
78 # Which plugins would you like to load?
79 # Standard plugins can be found in $ZSH/plugins/
80 # Custom plugins may be added to $ZSH_CUSTOM/plugins/
81 # Example format: plugins=(rails git textmate ruby lighthouse)
82 # Add wisely, as too many plugins slow down shell startup.
83 plugins=(
84 git
85 zsh-autosuggestions
86 autojump
87 zsh-syntax-highlighting
88 )
89
90 [ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
91 source $ZSH/oh-my-zsh.sh

软链接

1
2
3
4
5
6
ln -s /Users/lintstar/opt/anaconda3 /usr/local/bin/anaconda
ln -s /Users/lintstar/Library/Python/3.8/bin/virtualenv /usr/local/bin

ln -s /Users/lintstar/Tools/attack/fscan/fscan /usr/local/bin
ln -s /Users/lintstar/Tools/subfinder/subfinder /usr/local/bin
ln -s /Users/lintstar/Tools/Attack/httpx/httpx /usr/local/bin

刷新 Zsh

1
source ~/.zshrc

oh my zsh

由于 zsh 配置过于复杂,一般情况下,我们不会使用该 shell,直到「oh my zsh」的出现。

Oh My Zsh 是一款社区驱动的命令行工具,正如它的主页上说的,Oh My Zsh 是一种生活方式。

它基于zsh命令行,提供了主题配置,插件机制,已经内置的便捷操作,给我们一种全新的方式使用命令行。

配置

在 .zshrc 中编辑

1
2
3
4
5
6
7
8
16 # Path to your oh-my-zsh installation.
17 export ZSH="/Users/lintstar/.oh-my-zsh"
18
19 # Set name of the theme to load --- if set to "random", it will
20 # load a random theme each time oh-my-zsh is loaded, in which case,
21 # to know which specific one was loaded, run: echo $RANDOM_THEME
22 # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
23 ZSH_THEME="myys"

myys 主题

主题位置

1
$ cd ~/.oh-my-zsh/themes

myys.zsh-theme

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
$ cat myys.zsh-theme
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# Mar 2013 Yad Smood

# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"

# Git info
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"

# HG info
local hg_info='$(ys_hg_prompt_info)'
ys_hg_prompt_info() {
# make sure this is a hg dir
if [ -d '.hg' ]; then
echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}"
echo -n $(hg branch 2>/dev/null)
if [ -n "$(hg status 2>/dev/null)" ]; then
echo -n "$YS_VCS_PROMPT_DIRTY"
else
echo -n "$YS_VCS_PROMPT_CLEAN"
fi
echo -n "$YS_VCS_PROMPT_SUFFIX"
fi
}

local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})"

# Prompt format:
#
# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] C:LAST_EXIT_CODE
# $ COMMAND
#
# For example:
#
# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] C:0
# $
PROMPT="
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
%(#,%{$bg[yellow]%}%{$fg[black]%}%n%{$reset_color%},%{$fg[cyan]%}%n) \
%{$fg[white]%}from \
%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\
${hg_info}\
${git_info}\
\
%{$fg[white]%}[%*] $exit_code
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"

超级右键

右键进入 iTerm2 的巴适懂得都懂

image-20210415012644180

Bob

翻译功能 Command+d 就不说了

重点是截图翻译可以用来当作文字识别使用

在一些不能复制粘贴的地方还是很方便的

image-20210511122258953

配置好 API 即可 (百度翻译体验很好而且免费~)

image-20210511121651216

HiddenBar

image-20210511122723692

在 | 和 > 中间可以用Command 拖入需要一直显示但是很占地方的菜单栏 例如 QQ 音乐

实际效果

image-20210511122657500

Image2icon

自己封装 APP 时候制作图标神器

image-20210511123425488

配合自动操作体验极好:

image-20210511123646022

Chrome

Suspicious Site Reporter

Chrome 官方插件 可以显示 https 还是 http 方便粘贴 URL

image-20210511113810266

Pycharm

插件

Chinese (Simplified )Language Pack/ 中文语言包

添加中文作为 IDE 界面语言。

Material Theme U

主题插件看个人喜好 ~

Ideavim

像 VIM 一样编辑代码。

Nyan Progress Bar

基于LJ的ide的nyan cat的retty进度条:

image-20210511115657423

Mac Pycharm 空间或内存不够

image-20210415030649132


—环境—

HomeBrew

Homebrew 是安装 Apple 不包含在 macOS 中的 UNIX 工具的最简单,最灵活的方法。它还可以将不需要 Linux 发行包打包的软件安装到主目录,而无需安装 sudo

HomeBrew 已经支持 BigSur!划重点

安装脚本

1
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

自检命令

1
/usr/local/bin/brew doctor
1
2
3
brew install smartmontools

smartctl -a disk0

https://zhuanlan.zhihu.com/p/111014448

卸载重新安装

1
brew uninstall --force node && brew install node

Download failed 问题

这个报错怎么查都解决不了,查了一万种方法,甚至重装了 brew

后面断掉公司网:

image-20210412043447403

!!!!!!!!!!!!

解决办法

  1. 更换网络尝试
  2. brew update 后再次尝试

Redis

1. 安装命令

1
$ brew install redis

2. 进入安装目录

1
$ cd /usr/local/Cellar/redis/4.0.6/bin

3. 启动、关闭redis

1
$ redis-server

以下命令即可关闭redis服务

1
redis 127.0.0.1:6379> SHUTDOWN

4. 连接redis服务

1
$ redis-cli -h  127.0.0.1(ip) -p 1234(端口号)

5. 键入授权登录密码

1
127.0.0.1:6379> AUTH 123456(密码)

6. 退出本次会话

1
127.0.0.1:6379> quit

Anaconda

常用命令

1
2
3
4
$ conda env list
# conda environments:
#
base * /Users/lintstar/opt/anaconda3

查看当前配置信息

1
conda info 

mac 安装了conda后,前面会有一个(base)

安装conda后,每次启动终端,都会自动启动conda的base环境,conda的环境可以用 conda env list 查看

解决办法:

1
conda config --set auto_activate_base false

参考链接

Metasploit

下载安装

最新版下载地址:https://osx.metasploit.com/metasploitframework-latest.pkg

image-20210526111056496

Zsh 软链接

1
vim ~/.zshrc

添加一条软链接记录

1
export PATH="$PATH:/opt/metasploit-framework/bin"

刷新 Zsh

1
zsh

使用

初始化数据库

1
2
cd /opt/metasploit-framework/bin
./msfdb init

运行 MSF

1
msfconsole

启动账号密码设置 msf/msf

可能出现某个模块加载失败:

image-20210526113619529

解决办法:

1
open /opt/metasploit-framework/embedded/framework/modules/auxiliary/gather

image-20210526113700779

修改后即可正常启动:

image-20210526113759574

卸载

1
2
cd /opt/metasploit-framework/bin
sudo ./msfremove

FROM : lintstar.top , Author: 离沫凌天๓

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年11月29日16:47:49
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   MacOS Big Sur 配置及使用记录https://cn-sec.com/archives/653319.html

发表评论

匿名网友 填写信息