macOS 免费好用的 GIF 录制工具

(推荐)GIF Brewery 3 功能强大、易用:
1,除了选择屏幕区域录制,还能选择某个 App 的窗口进行录制,厉害之处就是此窗口之上叠加的别的窗口并不会被录制进去。
2,视频转 Gif; 多个 Gif 合并;
3,可以缩放分辨率,裁剪画面;
4,可以筛选画面帧;
5,支持图层,可以叠加 Gif、图片和文字;
6,修改色彩数量;
7,当然基本的播放速度、每秒帧数、循环方式也可以设置。
8,还能编辑现有的 Gif(和视频转Gif是同一种操作方式)
9,也可以当个简单的录屏软件,可以保存为 .mp4 格式

macOS 如何双击即可运行 .sh 脚本文件

嗨,我是芦苇Z。这是 macOS 新手进阶系列。

使用 shell 脚本(.sh 的文件),可以帮助我们自动完成一些重复任务。虽然可以在终端中输入命令行执行脚本文件,但很多时候我们希望直接双击就能运行会更加方便。不过默认情况下,双击这些文件只会在文本编辑器中打开它们,而不是执行。本文将介绍如何让双击 .sh 文件就能直接运行。

Homebrew 更新自身和软件包

更新自身 brewcask: brew update

更新软件包
brew list,显示已安装的软件包
brew outdated,检查过时的软件包(是否有新版本)
brew upgrade,升级所有可以升级的软件包
brew upgrade xxx 升级指定的软件包
brew cleanup,清理不需要的版本极其安装包缓存

Homebrew 修改和复原仓库源

本文内容复制自 https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/ , 版权归原作者所有。

# 以下针对 mac OS 系统上的 Homebrew
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
git -C "$(brew --repo homebrew/cask-versions)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git

# 以下针对 Linux 系统上的 Linuxbrew
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/linuxbrew-core.git

# 更换后测试工作是否正常
brew update
# 以下针对 mac OS 系统上的 Homebrew
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://github.com/Homebrew/homebrew-cask-fonts.git
git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://github.com/Homebrew/homebrew-cask-drivers.git
git -C "$(brew --repo homebrew/cask-versions)" remote set-url origin https://github.com/Homebrew/homebrew-cask-versions.git

# 以下针对 Linux 系统上的 Linuxbrew
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/linuxbrew-core.git

# 更换后测试工作是否正常
brew update

参考

安装 Python virtualenv

virtualenv 是一款 Python 虚拟运行环境管理工具。

这里介绍使用 pip 来安装 virtualenv,

如果所安装的 Python 没有自带 pip,可以参考这篇文章pip 的安装

pip install virtualenv

若系统同时安装了 Python2 和 Python 3(非默认版本),想在 Pthon 3环境下使用 virtualenv,

macOS 常用快捷键一览

嗨,我是芦苇Z。本文是 macOS新手进阶系列。

我整理了一些 macOS 系统中实用的快捷键,挑选适合自己的用起来会让 Mac 操作更顺手,也更高效。

少量快捷键可能因系统版本不同而有所差异。

macOS 执行Shell脚本文件三种方式的差异

  • 在终端中,直接输入脚本文件的路径以执行脚本
    例如 ./a.sh
    是启动一个子 shell 来执行脚本,要求该脚本文件具有可执行权限。

  • 在终端中,指定 shell 来执行脚本
    例如:sh a.shbash a.sh
    不要求文件有可执行权限。因为调用的命令程序文件 shbash 已经具有了可执行权限,脚本文件是一个参数。

Shell zip 压缩文件或文件夹

  • 压缩一个文件📃
    zip demo.zip demo.txt

  • 压缩一个文件夹📁
    使用 -r 选项。
    假设当前目录下有个“work”文件夹,
    举例:zip -r work.zip work

自定义排除文件/文件夹,使用 -x 选项(小写的 x)

还是以“work”文件夹举例,

  • 假设要排除 work 根路径下的“node_modules”文件夹,
    zip -r work.zip work -x "/node_modules/*"