OpenLiteSpeed 版本升级

CURRENT VERSION:OpenLiteSpeed 1.7.18   New Release: 1.7.19 (current branch)

登陆管理后台,左上角显示 【当前版本 OpenLiteSpeed 1.7.18 最新版本 1.7.19

使用apt-get upgrade openlitespeed 没有找到新版本,如何更新呢?

下载 lsup.sh:

wget https://raw.githubusercontent.com/litespeedtech/openlitespeed/master/dist/admin/misc/lsup.shchmod +x lsup.sh
./lsup.sh

或者 -v 指定版本安装:

/usr/local/lsws/admin/misc/lsup.sh -v 1.7.19

Running ./lsup.sh 将更新之最新版本。

screen后台运行|恢复会话|断开当前会话

screen 控制 ssh 远程会话命令不中断。避免终端窗口关闭/网络断开 后的 进程会话中断。

新建screen

screen -S your_screen_name

Ctrl + a, d :断开当前 screen 会话,但保持会话在后台运行。 Ctrl + a, k :关闭当前窗口或会话。

进入screen

screen -r your_screen_name

Ctrl+D # 在当前screen下,输入Ctrl+D,删除该screen
Ctrl+A,Ctrl+D # 在当前screen下,输入先后Ctrl+A,Ctrl+D,退出该screen

显示screen list

​​​​​​​screen -ls

连接状态为【Attached】的screen

解决恢复会话时出现 There is no screen to be resumed matching 的错误

screen -D -r your_screen_name # 解释:-D -r 先踢掉前一用户,再登陆

判断当前是否在screen中断下,Ubuntu系统,可以这样:

sudo vim /etc/screenrc

文件末尾追加一行即可允许设置screen标题

caption always "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%H %Y/%m/%d "

删除指定screen, your_screen_name为待删除的screen name

​​​​​​​screen -S your_screen_name -X quit

使用service –status-all 或 systemctl status 查询服务状态时卡顿

问题:

在一个运行多年的 debian 系统中,使用 service --status-all 检查服务列表
输出到项目 "[ + ]  cron" 时,会卡顿很久,才继续显示其他服务名。

起初不知道为什么卡顿,今天看到一文,他在 systemctl status 某服务名 时卡顿很久,后来发现这个问题和systemd-journald有关。我感觉这个问题也有可能一样,老系统运行多年,记录的服务信息过多。决定也尝试清理一下journald。

单独查看service --status-all 中卡顿的 cron

systemctl status cron

果真,翻页几千行,才发现看了不到一个月的记录,太多了

cron 是定时执行任务的服务。各种计划任务的执行都会产生大量的服务启动日志。

可以看出 systemctl 输出服务启动时的相关信息。都是从systemd-journald中读取的。

进入文件夹 /var/log/journal,里面有一个长文件名的文件夹:f25c9fe2e9554b54950734c0b92298e0,里面是用户的 system.journal 文件,还有user-1000.journal。

ls -lhm --full-time /var/log/journal/f25c9fe2e9554b54950734c0b92298e0/

查看这个文件夹下文件大小,21,001,486,336 bytes 有19.5 GiB。

下面清理 journal 文件

先停止 systemd-journald 服务

systemctl stop systemd-journald

Warning: Stopping systemd-journald.service, but it can still be activated by:
  systemd-journald-dev-log.socket
  systemd-journald.socket
  systemd-journald-audit.socket

提示警告,为了保险,把这几个都停止掉:
systemctl stop systemd-journald-dev-log.socket
systemctl stop systemd-journald.socket
systemctl stop systemd-journald-audit.socket

然后可以删除 journal 文件(我直接全部删除了,重要的生产服务器不建议这样)
 

最后是要限制systemd-journald日志的大小,避免以后出现这个问题。

编辑文件: /etc/systemd/journald.conf

修改以下两个配置参数:

SystemMaxUse=100M
RuntimeMaxUse=100M

限制全部日志文件加在一起最多可以占用多少空间,相对的问题是,以后的日志记录总量也变少了。

最后重启 systemd-journald

systemctl restart systemd-journald

再次使用 service –status-all 或 systemctl status 查询服务状态时,就不再出现卡顿了。

systemctl daemon-reload #重新加载服务配置文件

[end]

Debian 12 apt update GPG error: NO_PUBKEY

debian 11 版本更新 到 12,update出现两个错误。

,Hit:5 https://packages.microsoft.com/debian/12/prod bookworm InRelease

Err:5 https://packages.microsoft.com/debian/12/prod bookworm InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.microsoft.com/debian/12/prod bookworm InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

解决办法:

1 下载 https://packages.microsoft.com/config/debian/12/prod.list 替换 /etc/apt/sources.list.d/microsoft-prod.list

2 直接修改 /etc/apt/sources.list.d/microsoft-prod.list 为以下内容:

deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/12/prod bookworm main

Hit:6 https://packages.sury.org/php bookworm InRelease

W: https://packages.sury.org/php/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: Failed to fetch https://packages.microsoft.com/debian/12/prod/dists/bookworm/InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
W: Some index files failed to download. They have been ignored, or old ones used instead.

解决办法,执行以下命令:

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

在web页面中使用HTML  Symbol作为URL链接字符

看到一个地址链接中有个图标做链接锚点,尝试下确实可以打开。。。

查看代码里也是符号

<a href="https://api2u.me/tag/📚Curricula.html">📚Curricula</a>

然后直接复制进浏览器地址栏,也是可以的。Google Chrome,Microsoft Edge都可以粘贴。查询下

以前知道在html中显示转义符号,可没想过用Emoji 在代码里可以做连接符号。。。竟然浏览器也都支持了。。。

大致了解了下,我的理解是,其实使用Chromium内核的浏览器本身就可以看作一个 建构在web之上的应用容器,它已经将符号编码转义渲染了一次。所以可以在渲染代码之前就显示符号。

Link Emoji Meaning: Uses, How to Reply & More – wikihow.com

点击上面的链接,打开的页面地址栏会有带有下面图标链接的URL。

我先试试在CMD下的效果。

如果你安装了powershell 可以本机命令,wget https://xn--i-7iq.ws

在命令行窗口内也会显示符号图标

在 linux bash下 curl https://xn--i-7iq.ws 也可以显示,但是与cmd下完全不同。

📚 ❤️🔗

符号在各种编码下的编码

🔗https://www.htmlsymbol.com/unicode-code/1f517.html

Technical information
Name:Link Symbol
Symbol:🔗
Unicode Number:U+1F517
HTML Code:&#128279; &#x1F517;
HTML Entity:
CSS Code:\1F517
UTF-8 Encoding:0x1F517
UTF-16 Encoding:0x0001F517
UTF-32 Encoding:0x000000000001F517
Hex 2700-27BF / Decimal 9984-10175

https://www.w3schools.com/charsets/ref_utf_dingbats.asp

Example

<p>I will display &#9986;</p>
<p>I will display &#x2702;</p>

Will display as:

I will display ✂
I will display ✂

符号在HTML中的使用。

参考站点:

HTML Symbol Unicode symbols, html entities and codes https://www.htmlsymbol.com/

HTML Unicode (UTF-8) Reference https://www.w3schools.com/charsets/ref_html_utf8.asp

符号查询

EmojiXD®️ https://emojixd.com/

EmojiXD是一本线上Emoji百科全书📚,收录了所有emoji,帮你通过分类或者搜索轻松找到合适的表情符号,并了解各种emoji符号的相关知识和使用情景

Letterlike Symbols – https://www.unichar.app/web/

HTML Unicode (UTF-8) Reference – https://graphemica.com/🔗

VPS下检测虚拟化方式的工具

imvirt

http://micky.ibh.net/~liske/imvirt.html

virt-what

https://people.redhat.com/~rjones/virt-what/

另外,wsl下执行“lsb_release -a”查看发行版本,会提示:“lsb_release: command not found”

执行命令安装 lsb_release

apt-get install -y lsb-release

解决wsl两个子系统同时登录ssh,以及ping,sftp权限的问题

重装了windows的linux子系统,从wsl到wsl2,安装了一个kali,一个debian(其实这两个装一个就行了)

试试能不能ssh,发现没ssh服务,先安装

sudo apt install openssh-server
sudo systemctl start ssh

之后ssh上去之后,想改ssh端口,发现sftp编辑sshd_config文件提示“Permission denied”。给sshd_config加上权限,还不行,发现原来是sftp-server没权限。。。加上权限,可以编辑文件了。

sudo chmod u+s /usr/lib/openssh/sftp-server

设置ssh自启动

sudo systemctl enable ssh

查看子系统IP地址,ping自己一下也是没权限。加上权限

sudo chmod u+s /usr/bin/ping

然后同时开了kali,debian两个子系统的CMD窗口。查看ip,竟然两个子系统ip地址是一样的?没搞明白,怎么选择登录另一个子系统?是不是不能同时登录两个子系统呢?

先测试一下,打开两个子系统(顺序是先kali,再Debian),ssh登录22端口,连到的是第一个打开的子系统kali。再修改子系统kali的ssh端口到2022,再连22端口,连接失败,sudo service ssh restart 重启子系统Debian的ssh服务,再连22端口,Debian就连上了。这样两台子系统就可以同时ssh登录。

———————————————————————-

#如果Debian 中service 命令不存在,先安装 sysvinit-utils 包.

sudo apt-get install sysvinit-utils

如果已经安装,先在~/.bashrc 中添加 $PATH

PATH=$PATH:/usr/sbin

重启bash,service命令就可用了。

 service --status-all

Openwrt 一次自动更新全部软件包

1.使用 opkg 命令更新

opkg update
opkg upgrade luci 
opkg list-upgradable | grep luci- | cut -f 1 -d ' ' | xargs opkg upgrade

在ssh下,先“opkg update”,获取更新。之后再更新“ luci-” 开头的包。如果 要全部无条件更新,就去掉过滤“ grep luci- |”

2 使用 opkg-upgrade.sh 更新(推荐)

https://github.com/tavinus/opkg-upgrade

使用sh脚本更新,需要 curl 或 wget,使用Https链接的话,还需要SSL支持。

注意:curl / wget 可能会因为缺少 SSL 证书而失败。
您可以使用以下命令选择忽略证书检查:

curl -k
wget --no-check-certificate

或者,您将需要修复您的安装。
请注意,SSL支持会占用相当多的存储空间。/etc/ssl/certs/ca-certificates.crt

#这应该足以使SSL工作:

opkg install ca-certificates openssl-util

#如果您仍有问题,这可能是一种解决方法:

mkdir -p -m0755 /etc/ssl/certs && curl -k -o /etc/ssl/certs/ca-certificates.crt -L http://curl.haxx.se/ca/cacert.pem
  • 安装到当前目录,使用./opkg-upgrade.sh 执行:
# 根据使用 wget curl ,是否SSL,选择对应命令执行。

# using wget with SSL
wget 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"

# using wget WITHOUT SSL
wget --no-check-certificate 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"

# using curl with SSL
curl -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"

# using curl WITHOUT SSL
curl -k -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"
# 执行更新
./opkg-upgrade.sh
  • (推荐)安装到系统(无需.sh扩展):/usr/sbin/opkg-upgrade
# 根据使用 wget curl ,是否SSL,选择对应命令执行。

# using wget with SSL
wget 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"

# using wget WITHOUT SSL
wget --no-check-certificate 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"

# using curl with SSL
curl -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"

# using curl WITHOUT SSL
curl -k -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"
# 执行更新
opkg-upgrade

将更新命令加入自定义菜单

可以先安装 luci-app-commands

opkg install luci-app-commands

安装后,就可在luci的系统菜单中

使用自定义命令进行更新,一键就直接执行,更方便!如下图

这样就可以在 luci 界面,使用opkg-upgrade一键更新所有软件包了!

Chrome 与 Flash 说再见

Adobe宣布计划在2020年底停止支持Flash。

20年来,Flash一直在帮助您塑造在网络上玩游戏、观看视频和运行应用程序的方式。但是在过去的几年里,flash已经不那么常见了。三年前,80%的桌面Chrome用户每天访问一个带有Flash的网站。今天的使用率只有17%,而且还在继续下降。

这一趋势表明,网站正在向比Flash更快、更节能的开放式Web技术转移。它们也更安全,因此在购物、银行或阅读敏感文档时更安全。它们也可以在移动和桌面上工作,所以你可以在任何地方访问你最喜欢的站点。

这些开放式Web技术在去年年底成为Chrome的默认体验,当时网站开始需要请求您的许可才能运行Flash。在接下来的几年里,Chrome将继续逐步淘汰Flash,首先是请求您允许在更多情况下运行Flash,最后在默认情况下禁用它。到2020年底,我们将把flash完全从chrome中删除。

如果你今天经常访问一个使用flash的网站,你可能会想知道这对你有何影响。如果网站迁移到开放式Web标准,除了不再看到在该网站上运行flash的提示外,您不应该注意到有什么不同。如果站点继续使用flash,并且您授予站点运行flash的权限,那么它将一直工作到2020年底。

为了确保网络准备好无闪存,需要与Adobe、其他浏览器和主要发行商密切合作。我们支持Adobe今天的声明,我们期待着与所有人合作,使网络变得更好。

Windows下 NTP时间服务器设置

NTP时间服务器
pool.ntp.org: public ntp time server : https://www.ntppool.org/zh/

pool.ntp.org 是一个以时间服务器的大虚拟集群为上百万的客户端提供可靠的 易用的 网络时间协议(NTP)服务的项目

NTP池正在为世界各地成百上千万的系统提供服务。 它是绝大多数主流Linux发行版和许多网络设备的默认“时间服务器”


国内NTP服务 http://ntp.org.cn/pool.php

设置

Windows 可以使用系统内置的ntp客户端: 以管理员权限在命令行运行如下指令:

w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org"

这在Windows 2003及之后的版本中被支持。 如果您使用旧版的Windows,您可以尝试如下指令:

net time /setsntp:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org"

作为管理员,右键任务栏的时钟,选择“更改日期和时间设置…”,并且在“Internet时间”选项卡下输入服务器名也能达到同样的效果。