包含关键字 linux 的文章

环境:我家云 (Debian Buster with Armbian Linux 5.3.0-rockchip64)

失败的方法:

在我的设备上实测不生效,手动改了也自动秒恢复,实际上就是存在某些问题压根改不了。
查看风扇状态:cat /sys/class/thermal/cooling_device0/cur_state
启用风扇; echo 1 > /sys/class/thermal/cooling_device0/cur_state
关闭风扇: echo 0 > /sys/class/thermal/cooling_device0/cur_state

成功方案

参考了:恩山论坛原贴

#!/bin/bash
#甜糖监控进程存在&自动唤起&日志记录脚本
d=`date '+%F %T'`;
num=`ps fax | grep '/ttnode' | egrep -v 'grep|echo|rpm|moni|guard' | wc -l`;
echo $num;
if [ $num -lt 1 ];then
 echo "[$d] ttnode is dead...restarting" >> /usr/ttnode/log.log ;
 echo "[$d] ttnode is dead...restarting";
 mount -o,remount,rw /dev/sda1 /mnts
 /usr/ttnode/ttnode_172 -p /mnts;
fi

#温控风扇(大于40度开转小于45度停止)每次开转前有反复启停转动三次作为提示。

if [ -n "$1" ]; then
max=$1
else
max=45000
fi
if [ -n "$2" ]; then
min=$2
else
min=40000
fi
echo $max, $min
#(只是为了方便关闭调试的时候打开的东西才多了这句) echo 70 > /sys/class/gpio/unexport 
echo 70 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio70/direction
i=0
for j in 1 2 3 4 5 6
do
echo $i > /sys/class/gpio/gpio70/value
i=$(( 1 - $i ))
sleep 2
done
while true
do
t=`/bin/cat /sys/class/thermal/thermal_zone0/temp`
if [ $t -gt $max ]; then
  echo 1 > /sys/class/gpio/gpio70/value
  echo "$t > $max"
fi
if [ $t -lt $min ]; then
  echo 0 > /sys/class/gpio/gpio70/value
  echo "$t < $min"
fi
sleep 10
done
echo 70 > /sys/class/gpio/unexport


原文:
[[Python-Dev] [RELEASE] Python 2.7.18, the end of an era][1]
Benjamin Peterson:

I'm eudaemonic to announce the immediate availability of Python
2.7.18.

Python 2.7.18 is a special release. I refer, of course, to the fact
that "2.7.18" is the closest any Python version number will ever
approximate e, Euler's number. Simply exquisite!

A less transcendent property of Python 2.7.18 is that it is the last
Python 2.7 release and therefore the last Python 2 release. It's time
for the CPython community to say a fond but firm farewell to Python 2.
Users still on Python 2 can use e to compute the instantaneously
compounding interest on their technical debt.

Download this unique, commemorative Python release on python.org:

https://www.python.org/downloads/release/python-2718/

Python 2.7 has been under active development since the release of
Python 2.6, more than 11 years ago. Over all those years, CPython's
core developers and contributors sedulously applied bug fixes to the
2.7 branch, no small task as the Python 2 and 3 branches diverged. There were large changes midway through Python 2.7's life such as PEP
466's feature backports to the ssl module and hash randomization.
Traditionally, these features would never have been added to a branch
in maintenance mode, but exceptions were made to keep Python 2 users
secure. Thank you to CPython's community for such dedication.

Python 2.7 was lucky to have the services of two generations of binary
builders and operating system experts, Martin von Löwis and Steve
Dower for Windows, and Ronald Oussoren and Ned Deily for macOS. The
reason we provided binary Python 2.7 releases for macOS 10.9, an
operating system obsoleted by Apple 4 years ago, or why the "Microsoft
Visual C++ Compiler for Python 2.7" exists is the dedication of these
individuals.

I thank the past and present Python release managers, Barry Warsaw,
Ned Deily, Georg Brandl, Larry Hastings, and Łukasz Langa for their
advice and support over the years. I've learned a lot from them—like
don't be the sucker who volunteers to manage the release right before
a big compatibility break!

Python 3 would be nowhere without the critical work of the wider
community. Library maintainers followed CPython by maintaining Python
2 support for many years but also threw their weight behind the Python
3 statement (https://python3statement.org). Linux distributors chased
Python 2 out of their archives. Users migrated hundreds of millions of
lines of code, developed porting guides, and kept Python 2 in their
brain while Python 3 gained 10 years of improvements.

Finally, thank you to GvR for creating Python 0.9, 1, 2, and 3.

Long live Python 3+!

Signing off, Benjamin
2.7 release manager

谷歌机翻:

我很高兴地宣布Python 2.7.18的立即可用性。

Python 2.7.18是一个特殊版本。我指的是“ 2.7.18”是
最接近的任何Python版本号都将近似为e,欧拉数。只是
精美!

Python 2.7.18的一个较小的超越属性是它是最新的Python 2.7版本
因此是最新的Python 2版本。是时候让CPython社区表示喜欢了
却告别了Python2。仍然使用Python 2的用户可以使用e来计算
即时增加其技术债务的利息。

在python.org上下载以下独特的纪念Python版本:

https://www.python.org/downloads/release/python-2718/

自Python 2.6发行以来,Python 2.7一直处于积极开发中,
11年前。在这些年中,CPython的核心开发人员和贡献者都认真从事
已将错误修复应用到2.7分支,这与Python 2和3分支一样不容易
发散。在python 2.7的生命中途发生了很大的变化,例如PEP 466的变化
将特性反向移植到ssl模块和哈希随机化。传统上,这些功能
永远不会以维护模式添加到分支,但是对
确保Python 2用户安全。感谢CPython社区的奉献精神。

Python 2.7幸运地拥有两代二进制生成器的服务,并且
操作系统专家,Windows的Martin vonLöwis和Steve Dower以及Ronald
Oussoren和Ned Deily适用于macOS。我们之所以提供二进制Python 2.7版本,是因为
macOS 10.9,4年前被苹果公司淘汰的操作系统,或者为什么“
适用于Python 2.7的Visual C ++编译器是这些人的奉献精神。

我感谢过去和现在的Python发布经理,Barry Warsaw,Ned Deily,Georg
多年来,Brandl,Larry Hastings和ŁukaszLanga均提供了建议和支持。我有
从他们那里学到了很多东西,例如不要成为自愿管理发布的傻瓜
就在兼容性大破坏之前!

没有更广泛社区的关键工作,Python 3将无处不在。图书馆
维护者遵循CPython并保持了对Python 2的多年支持,但同时也投入了
它们在Python 3语句(https://python3statement.org)后面的重要性。 Linux发行商将Python 2淘汰了
他们的档案。用户迁移了数亿行代码,开发了移植
指南,并将Python 2保留在大脑中,而Python 3获得了10年的发展
改进。

最后,感谢GvR创建Python 0.9、1、2和3。

Python 3+万岁!

签收,
本杰明
2.7版本管理器

今天用了一下探针,意外的发现服务器swap占用为0,因为开的docker挂上了一个基岩服务器,只要有人玩就会占用70%~80%,对我来说这是很危险的,因为上次有开了clouddreve后几天突然宕机的惨痛教训。

首先查看/etc/sysctl.conf里的配置

cat /etc/sysctl.conf
[root@Hangzhou ~]# cat /etc/sysctl.conf
vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120

# see details in https://help.aliyun.com/knowledge_detail/39428.html
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce=2
net.ipv4.conf.all.arp_announce=2

# see details in https://help.aliyun.com/knowledge_detail/41334.html
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_synack_retries = 2

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

kernel.sysrq=1

忽然发现,根本没写物理内存占用到多少开始使用swap,默认应该60%的,也就是应该有个vm.swappiness参数写着60 ,可是我还真的没看见.....(阿里云骚操作+1 ,也许是为了使用更流畅吧......

查看当前vm.swappiness的设置是怎么样的

[root@Hangzhou ~]# sysctl -q vm.swappiness
vm.swappiness = 0

不出意外还真的是0......
如果vm.swappiness = 0 ,系统会不使用swap(我就不喝水,除非要渴死了 ~哼╭(╯^╰)╮~)。
接下来就是修改了
vim /etc/sysctl.conf ,既然没写,那就手动加上vm.swappiness = 90,也就是物理内存占用到90%就开始用swap分担内存需求压力。写个0我怕再用Cloudreve还会宕机,但是也要尽可能利用闪存,毕竟比swap快多了。
接下来reboot

[root@Hangzhou ~]# sysctl -q vm.swappiness
vm.swappiness = 90

问题解决(^▽^)

前言:本文所讲的是利用我已经修改好的Docker镜像完成我的世界基岩版服务器部署。如果你有能力自己在Ubuntu下完成就自己在Ubuntu下解决依赖库等问题部署好,不要说我为什么要多此一举让新人接触Docker。
Docker安装其实是有很多坑的,但是我会让你用宝塔一键解决,那就没什么难度了,有爪就能跟着走下来。

- 阅读剩余部分 -

终于发现了网络卡慢的根本原因

又重装了最新版的Manjaro deepin,照例执行以下命令:
排列源:sudo pacman-mirrors -g
同步并优化:sudo pacman-optimize && sync
升级系统:sudo pacman -Syyu
但是发现无论用哪个镜像源都出现访问错误,又想起来,外婆家移动网络原来还好好的,这次来网页加载时间明显加长(Linux里用火狐打开百度都要三十秒),简单检查了路由器看上去没有问题。最终考虑可能DNS不太好,更换了腾讯公共DNS的DNS节点,打开百度秒开,问题暂时解决。
接下来,发现家里所有人的上网设备都存在访问网页时间长的问题,这就不太对了。
忽然想起来我的爪机曾经出现WiFi连接提示未分配IP地址的报错,第一反应路由器DHCP是不是出了问题。打开浏览器输入192.168.0.1(有的型号是192.168.1.1)打开路由器Web管理界面,一看DHCP服务器设置,有三个选项,开、关、自动,当前正在自动上,我个人是喜欢手动设置的。于是调到开,然后发现,默认首选DNS和备选DNS居然是Google的公共DNS(8.8.8.8、8.8.4.4)这两个DNS在前几年还是很常用的,尤其是一些经常访问外网的同学,会喜欢这么设置。
But:就在近几年,这个谷歌的公共DNS节点已经被污染了!
于是我马上更换为腾讯的公共DNS服务器;
首选DNS:119.29.29.29
备选DNS:182.254.116.116
点击保存关掉Web界面,把我的每个设备WiFi连接设置为自动获取网络信息,再访问网页就没问题了。