寂静·流年

[冰与火的交缠,无法平息的灵魂]

这里以immortalwrt 24.10为例进行安装。

一、使用luci-app-mosdns进行安装

不要使用openwrt软件源自带的,功能有所缺失,版本也比较旧。

推荐使用luci-app-mosdns安装。

ssh登录进入openwrt,命令如下:

1
2
3
4
opkg update
opkg install curl

sh -c "$(curl -ksS https://raw.githubusercontent.com/sbwml/luci-app-mosdns/v5/install.sh)"

二、openwrt设置

阅读全文 »

linux下,可以使用ssh-copy-id命令,把密钥复制到远程主机,以实现无密码登录。
相关用法可以看我另一篇文章:Linux服务器使用密钥登录

ssh-copy-id基本用法如下:

1
ssh-copy-id -i  myid.pub  foo@remotehost

其中,-i是指定密钥文件的具体位置。

但是在实际使用过程中,经常会出现错误,具体如下:

1
2
3
4
  ~ ssh-copy-id -i /xxx/my_key.pub foo@192.168.1.23

/usr/bin/ssh-copy-id: ERROR: failed to open ID file '/xxx/my_key': No such file or directory
(to install the contents of '/xxx/my_key.pub' anyway, look at the -f option)

上面的错误提示,意思是找不到密钥文件,但其实密钥文件是存在的。

阅读全文 »

MacOS下,在使用squirrel(即rime的macOS版本)时,如果想让某一程序默认输入法状态是英文,则可以在squirrel.custom.yaml里做相应的设置,例如:

1
2
3
4
5
6
# --- 特定程序定义初始状态的英文输入 ---
app_options:
com.raycast.macos: # Raycast
ascii_mode: true
com.googlecode.iterm2: # iTerm2
ascii_mode: true

但是这里有个问题,如果不知道目标应用程序的Bundle Identifier,则无法添加。

所以首要任务是找到目标应用程序的Bundle Identifier

在macOS里,查找Bundle Identifier的命令如下:

1
osascript -e 'id of app "应用名称"'

例如,要获取Termora这个ssh工具的标识符,就输入

阅读全文 »

在安装完成oh-my-zsh,并在~/.zshrc配置文件里设置了zsh-syntax-highlighting后,下一步就是执行source ~/.zshrc,以使用插件配置生效。

这时候有可能会报错,内容如下图:

这个问题困扰我很长时间,今天终于解决了。

答案就写在官方的github说明里:

1
2
3
4
5
6
7
**Why must be sourced at the end of the file?**

zsh-syntax-highlighting works by hooking into the Zsh Line Editor (ZLE) and computing syntax highlighting for the command-line buffer as it stands at the time z-sy-h's hook is invoked.

In zsh 5.2 and older, hooks into ZLE by wrapping ZLE widgets. It must be sourced after all custom widgets have been created (i.e., after all calls and after running ) in order to be able to wrap all of them. Widgets created after z-sy-h is sourced will work, but will not update the syntax highlighting.zsh-syntax-highlighting.zshzle -Ncompinit

In zsh newer than 5.8 (not including 5.8 itself), zsh-syntax-highlighting uses the facility to install a hook. Hooks are run in order of registration, therefore, z-sy-h must be sourced (and register its hook) after anything else that adds hooks that modify the command-line buffer.add-zle-hook-widgetzle-line-pre-redraw

简单来说,就是zsh-syntax-highlighting这个插件,必须放在~/.zshrc配置文件的启用插件列表

阅读全文 »

安装homebrew

1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

关闭homebrew升级提示

将以下内容放入【~/.zshrc】文件,重启终端即可

1
2
3
4
# 关闭自动清理旧版本包(不建议使用)
export HOMEBREW_NO_INSTALL_CLEANUP=true
# 隐藏提示(建议使用)
export HOMEBREW_NO_ENV_HINTS=true

安装软件

常用软件

阅读全文 »
0%