====== Mac 技巧 ======
收录一些在Mac和Linux下的使用技巧。
购买:2022年7月14日 从mediamarkt订购
===== 开机启动命令 =====
1. 编写bash脚本,并赋予执行权限, ''%%chmod 777 myscripg.sh%%''\\
2. 右键文件,选择“显示简介”,将打开方式选择为终端打开 🖥 。\\
3. 在系统偏好设置->用户与群组->登录项的登录项中添加启动文件。
===== 扩展屏幕 =====
用Windows Notebook作为Mac的扩展屏,效果还是蛮好的。下载一个软件 [[https://wwr.lanzoui.com/lanmeipc|Airplay-for-win]] ((a>[[https://blog.csdn.net/qq_41664096/article/details/106625451|Windows 作为Mac扩展屏]]))
远程访问Ubuntu服务器桌面 [[it:server:ubuntu#远程桌面|远程桌面]]
[[https://zhuanlan.zhihu.com/p/113059310|如何在旧款MacBook或iPad中开启随航功能]] / [[https://github.com/ben-z/free-sidecar|free-sidecar github]]
Simple Server
python3 -m http.server 9000
===== 快捷键 =====
**程序调度**
* 访达窗口:系统偏好设置->快捷键->聚焦 ''%%⌘ ⌥ Y%%'' (原先⌘ ⌥ space)
* 启动台:系统偏好设置->快捷键->启动台与程序坞 ''%%⌘ ⌥ A%%''
* 打开桌面:系统偏好设置->快捷键->调度中心 ''%%⌥ + 3%%'' (默认F11) 桌面的图标会保留
* 显示程序坞:系统偏好设置->快捷键->启动台与程序坞 ''%%⌘ ⌃ <%%'' (自动隐藏/常驻之间切换)
* 显示图标:''%%⌘ + ⌃ + space%%''
* 显示/隐藏文件 ''%%⌘ + ⇧ + .%%''
* 上一个历史记录 ''%%⌘ + <-%%''
**屏幕录制**
* 截屏:⌘ + ⇧ + 4 (全屏截取 ⌘ + ⇧ + 3)
* 录制屏幕:⌘ + ⇧ + 5
**连接网络磁盘**
打开访达窗口,⌘ + K 调出连接窗口,输入 ''%%smb://192.168.0.157/work%%''
==== 输入法 ====
- 删除整行:⌘ + del
- 删除光标后的文本:⌃ + K
- 删除光标前的文本:⌘ + ⌫
- 删除光标前的文本:Alt + ⌫
- 删除光标后文本:Entf / Alt + Entf
===== 其它 =====
拼接 MP3 (合并文件)''%%cat doc1.mp3 doc2.mp3 doc2.mp3 > doc.mp3%%''
[[https://zhuanlan.zhihu.com/p/354385629|MacBook M1 查询硬盘写入教程]] [[https://juejin.cn/post/7006854608744087588|文章2]]
===== DNS 域名服务器 =====
cloudflare 的域名服务器地址为 1.1.1.1 和 1.0.0.1
允许任何来源 ''%%sudo spctl --master-disable%%''
===== 磁盘读取查询 =====
brew install smartmontools
smartctl -a disk0
[[https://checkcoverage.apple.com/?locale=de_DE|保修查询]]
{{ag> mac}}
====== Linux 技巧 ======
===== 时区 =====
当前时间: ''%%ls -l /etc/localtime%%''\\
当前时区: ''%%cat /etc/timezone%%''\\
时区列表: ''%%timedatectl list-timezones%%''\\
设定时区: ''%%sudo timedatectl set-timezone Europe/Berlin%%''
mac : ''%%sudo systemsetup -gettimezone%%''
Time Zone: Europe/Berlin
===== VIM 编辑器 =====
删除一行:''%%dd%%'' (''%%5dd%%'' 删除头5行) \\
删除单词:''%%dw%%'' \\
移到行末:''%%$%%'' (''%%0%%'' 行首)
===== MAIL 配置 =====
安装 ''%%sudo apt-get install -y mailutils%%'' 以及postfix配置 (([[https://www.arubacloud.com/tutorial/how-to-configure-a-smtp-mail-server-with-postfix-on-ubuntu-20-04.aspx|How to configure a SMTP mail server with Postfix on Ubuntu 20.04]]))
(([[https://ubuntu.com/server/docs/mail-postfix|Postfix]]))
详情参阅 [[https://www.commandlinux.com/man-page/man1/Mail.1.html|MAIL文档]] 以及 [[https://www.cnblogs.com/xiaoshi1991/archive/2012/09/20/2695061.html|mail 中文说明]]。\\
''%%mail user%%'' ..... 退出 (连续两次 ''%%Ctrl+C%%'' 不保存退出)
如果出现问题,如:\\
send-mail: fatal: open /etc/postfix/main.cf: No such file or directory\\
Can't send mail: sendmail process failed with error code 75
apt-get install --reinstall postfix
dpkg-reconfigure postfix
===== 统计Internet流量 =====
brew install vnstat
brew services start vnstat
运行 ''%%vnstat --help%%'' 命令查看统计数据
vnstat -d
{{tag>ubuntu}}