MacOS Jetbrain commit failure when sign with a passphrase encoded gpg key solved

My MacBook was re-initialized recently and I have to set up my working environment from zero. I encountered a problem when commit my code to git repository, the git program just complaint a error message in git console:

error: gpg failed to sign the data
fatal: failed to write commit object

After researching, I guess it's because jetbrains have problem working with pinentry program which is used by gpg to ask user for passphrase. Jetbrains have a issue about this: https://youtrack.jetbrains.com/issue/IDEA-127802/Git-commit-fails-if-GPG-signing-is-enabled.

From this issue, I changed the gpg-agent pinentry program by modifying ~/.gnupg/gpg-agent.conf, adding an option:

pinentry-program /usr/local/bin/pinentry-mac

Note: if you don't have this pinentry-mac on your system, just brew install pinentry-mac it.

Then restart gpg-agent:

gpgconf --kill all
gpg-agent --daemon

If the agent starts, this problem should be solved. pinentry-mac will ask user for passphrase by prompting a dialogue rather than displaying message in console.

发表在 Misc | 标签为 , | 留下评论

新马泰签证办理信息聚合

目前(2024年)新马泰都已经对中国公民免签,祝各位旅途愉快!

继续阅读

发表在 旅行准备 | 留下评论

批量下载 Amazon Kindle 商店中已经购买的书籍

参考:https://bookfere.com/post/983.html

继续阅读

发表在 Misc | 标签为 | 留下评论

Linux CD 抓轨

依赖:

sudo apt install cuetools abcde flac

抓轨:

abcde -o wav -1

-o wav 表示输出文件为 wav 格式,也可以 flac

抓轨之前可以先修改一下 /etc/abcde.conf 里的玄学参数:

CDDBURL="https://gnudb.gnudb.org/~cddb/cddb.cgi"
CDPARANOIAOPTS="-X"

CDDBURL 默认的那个 url 已经失效了,但是改成 gnudb 的好像也并没有什么用……

abcde 依赖 cdparanoia ,-X 参数是指遇到错误就停止,不给玄学家质疑抓轨质量的机会

生成 CUE 文件:

mkcue

编辑 CUE 文件参考链接:

CUE 文件范例:

REM this is a comment
FILE "Free Water Way - Corey Harries.wav" WAVE
TITLE "Free Water Way"
PERFORMER "Corey Harris"
  TRACK 01 AUDIO
    TITLE "Mama Africa"
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    TITLE "Ark Of The Covenant"
    INDEX 01 04:54:66
...

分轨:

shntool split -t "%n.%t - %p" -f <cue_file> <input_wav_file> -d output

加入 -D 参数可以输出 debug 信息。

写入 id3 tags 到 flac 分轨文件:

cuetags <cue_file> *.flac
发表在 Misc | 标签为 , | 留下评论

Make supervisord logging feature work with logrotate

supervisord won't append new logs to the new log file created by logrotate after the rotation, this is because the file descriptor (fd) does not change within the running supervisord process. To make supervisor close current log file (both for child process log files and the supervisord itself) and reopen, send a SIGUSR2 to supervisord. For detail, see documentation.

继续阅读

发表在 未分类 | 留下评论

A Complement to “CAS configuration for G Suite”

We planned to change our E-mail service provider to Gmail, however for some reason this had to abort. Before the plan aborts, I somehow managed to make Google to work with our SSO that is built on Apereo CAS. Here I post some useful information to help anyone who could run into same situation.

When I was working on this, an article provided me very much help: CAS configuration for G Suite , as well as some offical documents listed below:

继续阅读

发表在 折腾 CAS | 标签为 , , , , , , | 留下评论

about gradle

defferences between configurations

https://docs.gradle.org/4.10.2/userguide/java_library_plugin.html#java_library_plugin

发表在 Misc | 留下评论

ADHD?没什么大不了

本文最终成稿于 2018-01-02 22:28:58。原先的博客已经不存在了,但近日发现这篇文章被其他的 post 引用过,看来也是帮助过一些人,故搬运至此,希望能给一些同僚带来帮助。


本文共同作者:蒙小七

开篇:此文章主要是帮助更多的人从相对科学的角度去了解和认识ADHD,而不是把它当作一个无法克服的外因来对待。从而,才可以从根本上去解决生活上的种种关于和可能关于ADHD所造成的问题。*

主题:为什么多动症并不是一种特殊的不能痊愈疾病,而是和感冒一般,我们不能把它当作一个可以炫耀或者特别的自己来对待,也不可以因为有ADHD而对生活灰心丧气。不同于其他的疾病,这是一种可以控制,可以治愈的疾病。至于如何去分析和去治疗,以下均有详细分析

cover图片

继续阅读

发表在 Misc | 标签为 | 留下评论

一种深度自定义 Apereo CAS 的思路

搬砖过程中,遇到了一个问题:需要自定义 CAS 的 Audit Log,更改其对 Client IP 的获取逻辑。在 CAS 源代码中查找,发现 Audit Log Entry 来自 ClientInfo 对象。而 ClientInfo 对象则是在 org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter 这个拦截器中收集并放置到 ThreadLocal 变量中去的。

这个拦截器在 cas.war 中的 configuration 类里通过 FilterRegistrationBean 被注册到 Spring 的 Filter Chain 里去。细看这个 bean 的配置,发现并没有 @ConditionalOnMissingBean 注解,导致我们没法在 cas-overlay 里提供一个 bean 去替换掉这个 FilterRegistrationBean。所以在 https://blog.dragonslayer.me/archives/150 这篇文章的最后一段我们可以看到,我用了 BeanFactoryPostProcessor 去完成需求。

那么,这个问题有没有其他的解决方法呢?本文提供了另一种思路。

继续阅读
发表在 折腾 CAS | 标签为 , , , , | 留下评论

VLC 无法播放 Samba 共享文件的解决方法

首先描述现象。

在 Linux 系统下,使用 KDE 链接 SMB 服务器,双击视频文件后使用 VLC 播放。VLC 此时弹出窗口询问 SMB 的用户名密码,正确输入用户名密码之后播放并未开始。此时从终端输入命令 vlc 打开 VLC,然后直接从 VLC 中通过“媒体->打开文件”选择刚刚试图播放的文件,发现依然无法播放。终端里有类似这样的报错:

[00007ff32c000c70] smb stream error: read failed (Software caused connection abort)
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu

在 Google 搜索错误信息,找到一篇文章:

https://www.dedoimedo.com/computers/plasma-dolphin-vlc-samba-playback-errors.html

看问题描述,与本文遇到的问题相同。解决方法是在 “工具->偏好设置->左下角显示设置选择全部”,此时偏好设置窗口应该显示为左半部分为树状菜单,右半部分为具体选项。在树状菜单中选择“输入/编解码器 -> 串流滤镜 -> prefetch”,然后在把右侧的“缓冲大小”与“读取大小”的值改为相同,并重新启动 VLC,问题就可以解决。

由于“缓冲大小”不能设置为 16MiB,所以可以把读取大小设置为 16KiB,也就是 16384。

发表在 Misc | 标签为 , , , , , , | 留下评论