Fedora 常用

第三方软件源

包括FFMPEG等

dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

修改密码

passwd

屏蔽暴力登陆

dnf install denyhosts -y
systemctl enable denyhosts && systemctl start denyhosts

更新docker镜像

docker pull repo/image:latest
docker inspect container-id # 获取信息
docker stop container-id
docker rm container-id
docker run #早先的运行参数 repo/image:latest

升级Fedora至27 并启用bbr

echo dnf to 27
dnf install dnf-plugin-system-upgrade -y
dnf system-upgrade download --releasever=27 --allowerasing --nogpgcheck -y

echo bbr config
echo "net.ipv4.tcp_congestion_control = bbr" >> /etc/sysctl.d/80-bbr.conf
echo "tcp_bbr" >> /etc/modules-load.d/80-bbr.conf
echo "net.core.default_qdisc=fq" >> /etc/sysctl.d/80-bbr.conf
sysctl -p

echo apply
dnf system-upgrade reboot

查找旧内核

rpm -qa|grep kernel

vim命令

# 排序
:sort
# 不同时排序
:sor ur /^/
# 删除包含xxx的行
g/xxx/d
# 删除不含xxx的行
v/xxx/d

Python3通过批量更新库至最新

import pip
from subprocess import call
for dist in pip.get_installed_distributions():
    call("pip install --upgrade " + dist.project_name, shell=True)
# 过期库列表
pip3 list --outdated
# 单独更新
pip3 install --upgrade Scipy

以上

Comments
Write a Comment