折腾¶
R 包安装指定 GCC 和 G++ 并开启 C++11 支持
如果你的 R 是使用比较低版本的 GCC(如 Red Hat 6.5 + GCC/G++ 4.4.7),但安装的 R 包需要开启 C++11 支持,或者需要更高版本的 GCC 和 G++,可以参考一下这个方法。
mamba 的两个分支 miniforge 和 mambaforge
在安装 mamba 的时候在 release 页面和官方的安装页面 总是看到关于 miniforge 和 mambaforge 的选择问题,傻傻搞不明白。
RockyLinux 9 基础配置与使用
今天终于在阿里云入手了一台 2核(vCPU)+ 2GiB + 3Mbps 的 ECS,安装了最新的 Rocky Linux release 9.3 (Blue Onyx),记录一下开箱后的一些基础配置。
苹果字体 PingFang SC 的一些踩坑记录
曾经在 《为 Windows 系统替换优雅的苹果字体》中提到可在 Windows 中使用苹方字体替代默认的微软雅黑,这里就有一个问题即需要在 Wondows 下安装苹方字体 —— 如果你的字体安装错误,很有可能导致你的浏览器或其他应用出现乱码。
浏览器乱码
出现这个的原因主要是站点使用了 PingFang SC 的字体设置。
body {
font-family: PingFang SC,microsoft yahei,sans-serif;
}
我们可以看到使用 F12 检查源码模式把 font-family 中的 PingFang SC 去掉后即可显示正常。
Python3 编译安装 –with-openssl 无效的问题
很多人在使用 Python3 经常会遇到一些 openssl 版本太低从而导致包无法正常使用的问题,尤其是 urllib3 这个包。
Python 3.9.18 (main, Sep 7 2023, 14:32:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/software/python-3.9.18/lib/python3.9/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/usr/local/software/python-3.9.18/lib/python3.9/site-packages/urllib3/__init__.py", line 41, in <module>
raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'. See: https://github.com/urllib3/urllib3/issues/2168
>>> import ssl
>>> import urllib3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/software/python-3.9.18/lib/python3.9/site-packages/urllib3/__init__.py", line 41, in <module>
raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'. See: https://github.com/urllib3/urllib3/issues/2168
不同版本服务器间 SSH 免密码登录失败
今天从服务器 A(CentOS 7.3)配置 SSH 无密码登录服务器 B(CentOS Steam 9),发现执行以下常规操作后无法实现:
$ ssh-keygen
$ ssh-copy-id -i ~/.ssh/id_rsa.pub shenweiyan@66.xx.xx.xx # ssh-copy-id user@rhel-9-server-IP
$ ssh shenweiyan@66.xx.xx.xx
Micro/Mamba 安装与注意事项
记录一下 Micromamba/Mamba 安装的步骤和注意事项。
Mamba 安装
Mamba 可以使用 Mambaforge 方法和已有 Mini/conda 的方式安装,官方推荐的是前面一种,即使用 Mambaforge 进行全新安装。
全新安装
关于 mamba 的安装,官方推荐 Fresh install,即全新安装。
We recommend that you start with the Mambaforge distribution. Mambaforge comes with the popular conda-forge channel preconfigured, but you can modify the configuration to use any channel you like. Note that Anaconda channels are generally incompatible with conda-forge, so you should not mix them.
我们建议您从 Mambaforge 发行版开始。 Mambaforge 预配置了流行的 conda-forge 通道,但您可以修改配置以使用您喜欢的任何通道。请注意,Anaconda 通道通常与 conda-forge 不兼容,因此您不应混合使用它们。
Python 中 tkinter 源码安装使用与中文乱码
主要是因为下面这两个原因,所以决定从源码编译安装去折腾一下 tkinter,以下是一些记录。
_tkinter not found
Python 3 源码编译安装,执行 make 过程中提示 _tkinter not found,如下:
$ make
......
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_tkinter