pip or pip3 update all packages

$ pip freeze > requirements.txt
Open the text file, replace the == with >=, or have sed do it for you:

$ sed -i ‘s/==/>=/g’ requirements.txt
and execute:

$ pip install -r requirements.txt –upgrade

 

 

https://stackoverflow.com/questions/2720014/how-to-upgrade-all-python-packages-with-pip

r2s lsusb result

root@FusionWrt:/# lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0bda:b812 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

faq

kodi链接失败?
把 api.themoviedb.org 翻墙看看

n1电视盒子或者安卓设备时间不对?
换个网络看看,说不定是连不上时间服务器。

如何添加公钥

wget -q ‘https://www.abc.com/key.txt’ -O – >>/root/.ssh/authorized_keys

oracle cloud机器修改主机名不起效

vi /etc/oci-hostname.conf

测试翻墙速度的一些文件

test_file_urls=https://download.microsoft.com/download/2/0/E/20E90413-712F-438C-988E-FDAA79A8AC3D/dotnetfx35.exe|Default
test_file_urls=https://dl.google.com/android/studio/maven-google-com/stable/offline-gmaven-stable.zip|Google
test_file_urls=http://cachefly.cachefly.net/200mb.test|Cachefly
test_file_urls=http://updates-http.cdn-apple.com/2019FallFCS/fullrestores/061-22552/374D62DE-E18B-11E9-A68D-B46496A9EC6E/iPhone12,1_13.1.2_17A860_Restore.ipsw|Apple

 

*back data to onedrive
onedrive –synchronize –upload-only –no-remote-delete
*add ip address to black list
iptables -I INPUT -s 121.12.125.240 -j DROP
*delete
iptables -D INPUT -s 121.12.125.240 -j DROP
*find big file
find . -type f -size +1M -mtime -1 -exec ls -lh {} \;

ubuntu修改主机名

sudo apt install systemd
hostnamectl set-hostname jiarm1

 

git 

ssh://juhui@192.168.5.10:2022/volume1/gitRepos/test.git

升级openssl

ssh
apt-get install -y aptitude
aptitude install -f libpam0g-dev libselinux1-dev
apt-get install -y libssl-dev zlib1g-dev

# 备份ssh配置
cp -rf /etc/ssh /etc/ssh.bak

# 设置文件权限
chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key

# 配置sshd配置
sed -i ‘s/^#PermitRootLogin yes/PermitRootLogin yes/’ /etc/ssh/sshd_config
sed -i ‘s/^GSSAPIAuthentication/#&/’ /etc/ssh/sshd_config
sed -i ‘s/^GSSAPICleanupCredentials/#&/’ /etc/ssh/sshd_config
sed -i ‘s/^UsePAM/#&/’ /etc/ssh/sshd_config

# 配置service, 取消notify
sed -i ‘s/^Type/#&/’ /lib/systemd/system/ssh.service

# 下载包

wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.6p1.tar.gz
tar zxf openssh-8.6p1.tar.gz

# 编译安装
cd openssh-8.6p1
./configure –prefix=/usr –with-privsep-path=/var/empty/sshd/ \
–sysconfdir=/etc/ssh –with-ssl-dir=/usr/local/openssl/ \
–with-default-path=/usr/local/bin:/bin:/usr/bin \
–with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin \
–with-pam –with-selinux –disable-strip –with-md5-passwords
make
make install

# 重启服务
systemctl daemon-reload

systemctl restart sshd

# 现在版本
ssh -V

openssl
https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/

也可以看这个

https://stackoverflow.com/a/49578644

但是记得要看Openssl是不是在path里面

 

esxi esir openwrt ikuai 安装注意点

客户机操作系统版本 其他5.X或更高linux64,可以选vmxnet3,获取更好的性能。
esxi 7 安装,启动的时候要输入参数,避免占用120空间
ikuai主路由 lede等做旁路由,会出现mac地址混乱的问题,要在主路由开通xx,旁路由启动yyy
安装windows 10,可能安装过程认不出网卡,先取消联网,装了vmtools之后就行了
esxi的管理口可以在启动后的黄黑屏幕设置,可以多选,选了以后就不能直通了
管理口设置的ip地址放一个网段,允许混杂,可以不插网线访问
esxi上的系统可以通过这个管理口虚拟的网卡做连通
如果用主路由+胖路由的方式上网,群晖设置外网访问upnp,说有两个路由器,把网关手工指定一下就行了

服务器安装推荐

安装lnmp
lnmp ssl add
强制所有的走https
include black.conf
传输文件 用管道
导入数据
安装v2ray
安装 monit
配置crontab
lnmp 安装exif opcache memcached
开启bbr
——————
nginx配置
cut log脚本
monit配置
配置mon
v2ray配置

CentOS8的基础防火墙配置

systemctl使用
systemctl unmask firewalld #执行命令,即可实现取消服务的锁定
systemctl mask firewalld # 下次需要锁定该服务时执行
systemctl start firewalld.service #启动防火墙
systemctl stop firewalld.service #停止防火墙
systemctl reloadt firewalld.service #重载配置
systemctl restart firewalld.service #重启服务
systemctl status firewalld.service #显示服务的状态
systemctl enable firewalld.service #在开机时启用服务
systemctl disable firewalld.service #在开机时禁用服务
systemctl is-enabled firewalld.service #查看服务是否开机启动
systemctl list-unit-files|grep enabled #查看已启动的服务列表
systemctl –failed #查看启动失败的服务列表

firewall-cmd使用
firewall-cmd –state #查看防火墙状态
firewall-cmd –reload #更新防火墙规则
firewall-cmd –state #查看防火墙状态
firewall-cmd –reload #重载防火墙规则
firewall-cmd –list-ports #查看所有打开的端口
firewall-cmd –list-services #查看所有允许的服务
firewall-cmd –get-services #获取所有支持的服务

/usr/lib/firewalld/services

#区域相关
firewall-cmd –list-all-zones #查看所有区域信息
firewall-cmd –get-active-zones #查看活动区域信息
firewall-cmd –set-default-zone=public #设置public为默认区域
firewall-cmd –get-default-zone #查看默认区域信息
firewall-cmd –zone=public –add-interface=eth0 #将接口eth0加入区域public
#接口相关
firewall-cmd –zone=public –remove-interface=eth0 #从区域public中删除接口eth0
firewall-cmd –zone=default –change-interface=eth0 #修改接口eth0所属区域为default
firewall-cmd –get-zone-of-interface=eth0 #查看接口eth0所属区域

用例
firewall-cmd –query-port=8080/tcp # 查询端口是否开放

firewall-cmd –add-port=80/tcp –permanent #永久添加80端口例外(全局)
firewall-cmd –remove-port=80/tcp –permanent #永久删除80端口例外(全局)
firewall-cmd –add-port=65001-65010/tcp –permanent #永久增加65001-65010例外(全局)
firewall-cmd –zone=public –add-port=80/tcp –permanent #永久添加80端口例外(区域public)
firewall-cmd –zone=public –remove-port=80/tcp –permanent #永久删除80端口例外(区域public)
firewall-cmd –zone=public –add-port=65001-65010/tcp –permanent #永久增加65001-65010例外(区域public)

firewall-cmd –reload #重启防火墙(修改配置后要重启防火墙)