ZHYQ118

一个太过正常的人的自白

apt install firmware-iwlwifi

原文链接

Debian 11 Linux(bullseye) 可用的国内镜像源

Debian 默认的软件源在国外,使用默认源安装软件速度感人,浪费大量不必要的等待时间。所以在安装完 Deiban 系统后的首要事情就是更换为国内的镜像源,能显著提高软件安装和系统更新速度。本文收集了 8 个能用的 Debian 国内镜像源以供选择。

如果不熟悉 Debian 镜像源的使用和配置,请直接翻到最后。文末提供了手动和命令式的两种镜像源配置方式。

可用的国内源

由阿里云提供的 Debian 镜像源:

1
2
3
4
5
6
7
8
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

由腾讯提供的 Debian 镜像源:

1
2
3
4
5
6
7
8
deb https://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb https://mirrors.tencent.com/debian-security/ bullseye-security main
deb-src https://mirrors.tencent.com/debian-security/ bullseye-security main
deb https://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib

由北京清华大学提供的 Debian 镜像源:

1
2
3
4
5
6
7
8
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

由中国科学技术大学提供的 Debian 镜像源:

1
2
3
4
5
6
deb http://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb http://mirrors.ustc.edu.cn/debian bullseye-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian bullseye-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian bullseye-proposed-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian bullseye-proposed-updates main contrib non-free

由上海交通大学提供的 Debian 镜像源:

1
2
3
4
5
6
deb http://mirrors.sjtu.edu.cn/debian bullseye main contrib non-free
deb-src http://mirrors.sjtu.edu.cn/debian bullseye main contrib non-free
deb http://mirrors.sjtu.edu.cn/debian bullseye-updates main contrib non-free
deb-src http://mirrors.sjtu.edu.cn/debian bullseye-updates main contrib non-free
deb http://mirrors.sjtu.edu.cn/debian bullseye-proposed-updates main contrib non-free
deb-src http://mirrors.sjtu.edu.cn/debian bullseye-proposed-updates main contrib non-free

由北京外国语大学提供的 Debian 镜像源:

1
2
3
4
5
6
7
8
deb https://mirrors.bfsu.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.bfsu.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.bfsu.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.bfsu.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.bfsu.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.bfsu.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.bfsu.edu.cn/debian-security bullseye-security main contrib non-free
deb-src https://mirrors.bfsu.edu.cn/debian-security bullseye-security main contrib non-free

由华为提供的 Deiban 镜像源:

1
2
3
4
5
6
7
8
deb https://mirrors.huaweicloud.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye main non-free contrib
deb https://mirrors.huaweicloud.com/debian-security/ bullseye-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bullseye-security main
deb https://mirrors.huaweicloud.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye-backports main non-free contrib

由网易提供的 Debian 镜像源:

1
2
3
4
5
6
7
8
deb https://mirrors.163.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye main non-free contrib
deb https://mirrors.163.com/debian-security/ bullseye-security main
deb-src https://mirrors.163.com/debian-security/ bullseye-security main
deb https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye-backports main non-free contrib

手动更换镜像源

手动更换 Debian 镜像源配置主要分为以下三步:

  1. 用熟悉的文本编辑器打开 /etc/apt/sources.list 文件(需要 sudo 权限),或是直接执行 sudo apt edit-sources 命令。
  2. 替换文件内容为上面任意一个镜像站的源配置代码并保存。
  3. 运行 sudo apt-get update 命令更新软件索引。

命令更换镜像源

使用命令替换镜像源更为快捷。比如在没有更换过数据源的情况下,要使用阿里云的 Debian 镜像源:

1
sudo sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list

这样就完成了默认源到阿里云镜像源的配置。接下来同样需要执行一下 sudo apt-get update 命令更新软件索引。

上面这个命令的原理在镜像源的地址上。不同的镜像源通常只是域名有所区别,其他部分大致类似。所以之需要通过 sed 命令来修改 /etc/apt/sources.list 这个源配置文件中的域名地址就足够了。

但这意味着使用这个命令方式修改镜像源的配置时需要格外注意。如果输入的匹配地址或替换地址有误,有可能不会生效,或是导致镜像源异常。遇到这种情况,可以选择上面手动更换镜像源的方式来解决。

针对“普通用户提示用户名不在sudoers文件中,此事将被报告“,如此解决:

解决办法:

  1. 终端输入 su 回车,输入 root 密码,回车,切换到 root 用户
  2. 打开 sudoers 文件:vi /etc/sudoers
  3. 找到 # Allow members of group sudo to execute any command,在 %sudo ALL=(ALL:ALL) ALL 下面添加 xxx ALL=(ALL:ALL) ALL,xxx 为前面无法执行 sudo 命令的用户名

vi 给 sudoers 添加内容方法:

  1. 光标移动到指定位置,按 i 键当前光标位置插入
  2. 输入内容
  3. ESC
  4. 输入 :wq! 回车,因为 sudoers 是只读文件,所以要加 ! 强制保存。

在linux端操作

timedatectl set-local-rtc 1 --adjust-system-clock

1、下载最新版

[地址在此]
(https://github.com/Dreamacro/clash/releases)

2、解压缩

3、授予可执行权限

chmod +x clash

4、初始化

./clash

初始化执行 clash 会默认在 ~/.config/clash/ 目录下生成配置文件和全球IP地址库:config.yaml 和 Country.mmdb。

5、配置config.yaml

没找到自动下载订阅的方式,只能采取笨方法,从clash for windows 中导出配置,粘贴到~/.config/clash/ 目录下的config.yaml

6、运行,可添加守护进程

这样就不用一直打开一个terminal了。

./clash &

7、配置系统代理

找到网络-代理设置-手动
http 127.0.0.1:7890
socks 127.0.0.1:7890

socks端口存疑,也可能是7891。

8、网页管理

http://clash.razord.top/#/proxies

在Clover时代,被这个问题困扰已久,搜了无数解决方案都没成功,偶然看到一个叫做innie.kext,然后竟然神奇地发生了作用,可惜,升到macos11 big sur后,可能由于安全方面的原因,这个第三方kext不能被注入,所以,硬盘又重新被识别成了外置硬盘,好在现在终于也解决了,不过原教程是英文的,我就用中文转述一下,方便有同类问题的爱好者参考。

实际测试的是三星960 EVO NVME硬盘,其它同样问题的可以参考,不保证有效性。

操作步骤如下:

查找设备地址

1.下载hackintool

2.打开并找到PCIe标签,

3.查找设备名称,找到相应的设备地址,然后右击,选择**”Copy Device Path”**,就像这样的内容:*”PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)”。

OpenCore中内建

1.挂载EFI分区,并用ProperTree打开config.plist,

2.找到DeviceProperties/Add

​ · 右键点击Add增加一个子项目

​ · 名字命名为刚才拷贝的设备路径,如*”PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)”.*

​ · Type类型选择**”Dictionary”.**

​ · 右键增加一个子项目,命名为**”built-in”, type改为“Data”, 并且把value值设为“01000000”**

3.至于Kernel-Quirks中的**”ExternalDiskIcons”**是否有必要设置成true请自己尝试,我是之前已经为true,也就懒得再取消了。

最终效果如下:截屏2021-01-21 22.23.22.png

4.记得保存config.plist,然后重启设备应该就生效了。

这就是所有步骤。

使用 SSH 连接

1.进入 ssh 目录

1
cd ~/.ssh

2.生成 SSH key (文件名:id_rsa, id_rsa.pub)

1
ssh-keygen -t rsa -C "xxxxxx@yy.com"  #填写自己真实有效的邮箱地址

3.文本编辑器打开公钥 id_rsa.pub 复制内容,添加到 Github setting。

4.测试

1
ssh -T git@github.com

You’ve successfully authenticated, but GitHub does not provide shell access.

hexo配置文件中选择git协议,不能用https

1
2
3
4
deploy:
type: 'git'
repo: 'git@github.com:xxx/xxx.github.io.git'
branch: 'master'

在windows上压缩的文件,是以系统的默认编码中文来压缩文件的。由于zip文件中没有声明其编码,所以linux上的unzip一般以默认编码解压,因此中文文件名会出现乱码。

所以解决方法很简单,可以使用终端解压缩zip文件时指定解压的编码:

unzip -O GBK xxx.zip

解压后的文件路径为当前终端所在的路径。

原文链接:https://wp.gxnas.com/202.html

请参见下表:

设置实用程序
类型 端口号 协议
Synology Assistant 9999、9998、9997 UDP
备份
类型 端口号 协议
Data Replicator、Data Replicator II、Data Replicator III 9999、9998、9997、137、138、139、445 TCP
DSM 5.2 数据备份、rsync、共享文件夹同步、远程 Time Backup 873、22(如果通过 SSH 加密) TCP
Hyper Backup(目标) 6281(多版本备份)、22(如果通过 SSH 加密)、873(远程数据复制) TCP
Hyper Backup Vault、DSM 5.2 Archiving Backup 6281 TCP
LUN 备份 3260 (iSCSI)、873、22(如果通过 SSH 加密) TCP
Snapshot Replication 3261 (iSCSI LUN)、5566(共享文件夹) TCP
Active Backup for Business 5510、443(vCenter Server 和 ESXi 主机)、902(ESXi 主机) TCP
下载
类型 端口号 协议
BT 6890 ~ 6999(用于固件版本早于 v2.0.1-3.0401 的型号); 16881(用于 DSM 版本 v2.0.1 及以上的型号) TCP/UDP
eMule 4662 (TCP)、4672 (UDP) TCP/UDP
Web 应用程序
类型 端口号 协议
DSM 5000 (HTTP)、5001 (HTTPS) TCP
File Station 5000(HTTP,可添加其它端口)、5001(HTTPS,可添加其它端口) TCP
Mail Server
类型 端口号 协议
IMAP 143 TCP
通过 SSL/TLS 的 IMAP 993 TCP
POP3 110 TCP
通过 SSL/TLS 的 POP3 995 TCP
文件传输
类型 端口号 协议
AFP 548 TCP
CIFS smbd:139 (netbios-ssn)、445 (microsoft-ds) TCP/UDP
Nmbd:137、138 UDP
FTP、通过 SSL 的 FTP、通过 TLS 的 FTP 21(命令)、20(主动模式的数据连接)、1025-65535(被动模式的数据连接;但默认范围因型号而异) TCP
iSCSI 3260 TCP
NFS 111、892、2049 TCP/UDP
TFTP 69 UDP
WebDAV、CalDAV 5005、5006 (HTTPS) TCP
套件
类型 端口号 协议
Audio Station 1900 (UDP)、5000(HTTP,可添加其它端口)、5001(HTTPS,可添加其它端口)、5353(Bonjour 服务)、6001-6010(AirPlay 控制/定时) TCP/UDP
日历 38008、38443 CalDAV
CardDAV 8008 (HTTP)、8443 (HTTPS) TCP
集中化管理系统 (CMS) 5000 (HTTP)、5001 (HTTPS) TCP
CIFS 向外延展集群 49152-49252 仅 TCP:17909、17913、19998、24007、24008、24009-24045、38465-38501、4379 TCP/UDP
Cloud Station 6690 TCP
DHCP Server 67、68 UDP
LDAP Server(前身为 Directory Server) 389 (LDAP)、636(LDAP 含 SSL) TCP
Download Station 5000 TCP
Drive 5000 (HTTP)、5001 (HTTPS)、6690 TCP
iTunes Server 3689 TCP
Logitech® Media Server 3483、9002 TCP
Mail Station 80 (HTTP)、443 (HTTPS) TCP
媒体服务器 1900 (UPnP)、50001(内容浏览)、50002(内容串流) TCP/UDP
Moments 5000 (HTTP)、5001 (HTTPS) TCP
Note Station 5000 (HTTP)、5001 (HTTPS) TCP
Photo Station、Web Station 80(可添加其它端口)、443 (HTTPS) TCP
Presto File Server 3360 (TCP/UDP)、3361 (TCP/UDP) TCP/UDP
代理服务器 3128 TCP
Surveillance Station 9900 (HTTP)、9901 (HTTPS) TCP
Syslog Server 514(可添加其它端口) TCP/UDP
Video Station 1900 (UDP)、5000 (HTTP)、5001 (HTTPS)、9025-9040、 5002、5004、65001(使用 HDHomeRun 网络调谐器的型号) TCP/UDP
Virtual Machine Manager 2379-2382(集群网络)、3260-3264 (iSCSI)、16509、16514、30200-30300 TCP
VPN Server (OpenVPN) 1194 UDP
VPN Server (PPTP) 1723 TCP
VPN Server (L2TP/IPSec) 500、1701、4500 UDP
移动应用程序
类型 端口号 协议
Drive 5000 (HTTP)、5001 (HTTPS) TCP
DS audio 5000、5001 (HTTPS) TCP
DS cam 5000、5001 (HTTPS) TCP
DS cloud 6690 TCP
DS download 5000 (HTTP)、5001 (HTTPS) TCP
DS file Android:DS file 4.x 和运行 DSM 4.3 或更新版本的 DiskStation:5000、5001 (HTTPS)DS file 4.0 之前的版本和运行 DSM 4.2 或更早版本的 DiskStation:5005、5006 (HTTPS) TCP
iOS:DS file 5.x 和运行 DSM 4.3 或更新版本的 DiskStation:5000、5001 (HTTPS)DS file 4.0 之前的版本和运行 DSM 4.2 或更早版本的 DiskStation:5005、5006 (HTTPS)
Windows Phone:5000、5001 (HTTPS)
群晖管家 5000 (HTTP)、5001 (HTTPS) TCP
DS note 5000 (HTTP)、5001 (HTTPS) TCP
DS photo 80、443 (HTTPS) TCP
DS video 5000 (HTTP)、5001 (HTTPS) TCP
Moments 5000 (HTTP)、5001 (HTTPS) TCP
打印机、UPS 和外围设备
类型 端口号 协议
Bonjour 5353 UDP
LPR 515 UDP
网络打印机 (IPP)/CUPS 631 TCP
网络 MFP 3240-3259 TCP
UPS 3493 TCP
系统
类型 端口号 协议
LDAP 389、636 (SLAPD) TCP
MySQL 3306 TCP
资源监视器/SNMP 161 TCP/UDP
SSH/SFTP 22 TCP
Telnet 23 TCP

N1打开smb共享服务,在mac及linux下皆能正常访问,偏偏在win10中打不开,百思不得其解,经过搜索,最终解决。

原来,win10 1809及以上处于安全考虑,默认关闭了SMBv1服务,所以,只要打开就好了。

打开smb功能

控制面板中找到“程序和功能”,或者直接在Cortana搜索框中搜“功能”,打开即可。

1.jpg

确定,然后重启。

修改本地组策略

重启后再次 Win+R 打开“运行”,输入 gpedit.msc,“确定”以打开“本地组策略编辑器”。

按 计算机配置→管理模板→网络 的顺序,依次展开左侧目录树。

点击“Lanman工作站”,右侧会显示该项目的详细设置。

点击里面的“启用不安全的来宾登录”,将它由“未配置”改为“已启用”,应用并重启电脑。

2.jpg

最后打开PowerShell,输入以下命令查看SMBv1的开启状态:

1
Get-SmbServerConfiguration | Select EnableSMB1Protocol

3.jpg

现在,一切正常了,可以访问N1-OpenWrt上的资源了。

本文参考链接