2022年6月27日星期一

Ubuntu: Could not load the Qt platform plugin "xcb" in "" even though it was found

 

Ubuntu 桌面版报错信息:

python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: 无法打开共享对象文件: 没有那个文件或目录)"

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.


解决方案:

sudo apt install libxcb-xinerama0

 

2022年6月26日星期日

Mac 读写 NTFS 移动硬盘、U盘的命令行方式

首先,插入 NTFS 格式的移动硬盘或U盘。

此时,Mac 会自动挂载,在访达能看到,只读、不可写。

接下来我们命令行要做的事情:

  1. 找到移动硬盘名字
  2. 弹出,umount
  3. 重新挂载,mount(此时在访达还无法显示)
  4. 在访达显示
  5. (最后是用完移动硬盘后,弹出)

一步一步来。


1. 找到移动硬盘名字

命令行输入: 

diskutil list

# 或

mount | grep ntfs

找到移动硬盘名字,注意有2个名字是需要的,比如“移动硬盘的分区 disk5s1 挂载到 /Volumes/MyPassport”这句话里面的 “disk5s1”和 “MyPassport”(注:以下都以此为例)。

查看 disk5s1 的更多信息:

    distutil info disk5s1


2. 弹出,umount

    sudo umount /Volumes/MyPassport

操作后,在访达就看不到挂载的移动硬盘了。


3. 重新挂载,mount(此时在访达还无法显示)

# sudo mkdir /Volumes/disk5s1

mkdir ~/Downloads/mnt

sudo mount -t ntfs -o rw,auto,nobrowse /dev/disk5s1 ~/Downloads/mnt

注释:

1)上述代码是挂载到 ~/Downloads/mnt 目录。

2)Mac默认挂载到 /Volumes 底下,但我推荐自行挂载到 ~/Downloads 或之类的,原因是方便记得“弹出 umount”。

因为在访达很容易进入 ~/Downloads 从而看到“弹出”的图标。但访达并不很方便地进入 /Volumes 底下,更不用说看到“弹出”的图标。

3)需要 nobrowse。nobrowse会导致不在访达里显示,但 mac 强行要求添加 nobrowse,否则上述挂载会失败。


4. 在访达显示

open ~/Downloads/mnt


5. 用完移动硬盘后,弹出移动硬盘

方式一:访达里进入“下载”文件夹,点击弹出图标

方式二:命令行弹出 sudo umount ~/Downloads/mnt



参考:

https://gist.github.com/CharlesThierry/7305166b208d6f6cdd37962761d5ac23

https://medium.com/macoclock/enabling-ntfs-write-in-macos-10-15-catalina-the-open-source-way-a5fd0d1cb32e

https://www.jianshu.com/p/3bdfea303a62

https://www.cpming.top/p/using-mount-ntfs-to-manage-ntfs-disk

https://prateekvjoshi.com/2013/04/21/ntfs-write-support-on-os-x-mountain-lion/

https://osxdaily.com/2013/10/02/enable-ntfs-write-support-mac-os-x/





Mac 读写 NTFS 移动硬盘、U盘的软件一览

 

1. 免费、开源


ntfstool

https://github.com/ntfstool/ntfstool


ntfsx

https://github.com/Sailiy/ntfsx

2022年6月24日星期五

Windows 查看wifi密码

以 wifi 名字为 "CMCC-1234" 为例,查看 wifi 密码的命令是:

netsh wlan show profile name="CMCC-1234" key=clear


查看所有连接过的 wifi 名字:

netsh wlan show profiles

 

2022年6月22日星期三

Linux CTP登陆遇到问题:/sys/firmware/dmi/tables/smbios_entry_point Permission Denied

 

Permission Denied 的解决方案是用 sudo。

但是,运行的程序是在普通用户底下安装的 Python,切换到 sudo 的话没有此 Python,需要重新搭建 Python 环境,所以 sudo 解决方案不太可能。

所以,另一种思路是,修改文件的权限为普通用户可读,比如这样:

chmod 755 /sys/firmware/dmi/tables/smbios_entry_point

chmod 755 /sys/firmware/dmi/tables/DMI

chmod 755 /dev/mem

程序跑完后,再复原文件权限:

chmod 400 /sys/firmware/dmi/tables/smbios_entry_point

chmod 400 /sys/firmware/dmi/tables/DMI

chmod 640 /dev/mem

顺便一提,查看文件数字权限的方式是:
stat -c "%a %n" *  

2022年6月21日星期二

Linux 查看文件的权限数字

stat -c "%a %n" *  

可查看当前目录下所有文件的权限数字。

比如

cd /dev

stat -c “%a %n” * | grep mem

输出如下:

mem   640

sha diao Linux 到处用数字作为权限代号,比如 chmod 755 xxx,却不提供简单的命令查看权限数字,实在非常不人性化。 



2022年6月14日星期二

我国万事不进步,而独防民之术乃突过于先进国

 “我国万事不进步,而独防民之术乃突过于先进国,此真可痛哭也”

——《梁启超年谱长编》1909年八月十二日《致佛苏俄我兄书》493页,上海人民出版社1983年版。

2022年6月7日星期二

Windows 远程登陆日志


参考:

https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4625

https://blog.csdn.net/C_chuxin/article/details/84974207


大量 Special Logon 是什么

This is due to SYSTEM account which every couple of seconds try to logon. It is perfectly normal. So, don't worry.


Special Logon

事件查看器的  Windows - RemoteDesktopServices-RdpCoreTS 事件日志查看具有IP地址的连接尝试。


WinSCP 防止连接超时

WinSCP 连接后,如果长时间无操作,会自动断线,这点 Putty 也是一样。以下设置可以防止 WinSCP 连接超时:

点击 Advanced,然后点  Connection,然后勾选 Sending of null SSH packets。






IPv6 的 fe80开头的地址

fe80开头的 ipv6 地址不是公网地址,没人给你分ip,自动协商的地址,通常无法用于上网。 现在各大运营商用的ipv6: 电信是240e开头的(240e::/20) 移动是2409开头的(2409:8000::/20) 联通是2408开头的(2408:8000::/20)