飞羽

个人速查手册
本文记录了自己搜集的一些资料,以便自己翻阅。
扫描右侧二维码阅读全文
04
2019/07

个人速查手册

本文记录了自己搜集的一些资料,以便自己翻阅。

无图.jpg

个人速查手册

源相关

ubuntu16.04LTS更换阿里源

sudo vim /etc/apt/sources.list

替换

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

centos7更换163源

首先备份/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

CentOS7

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

CentOS6

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

CentOS5

http://mirrors.163.com/.help/CentOS5-Base-163.repo

运行以下命令生成缓存

yum clean all
yum makecache

永久保存DEBIAN防火墙 IPTABLES规则 以及重启服务器后自动保留

一、保存防火墙规则到文件中

iptables-save > /etc/iptables.up.rules

二、配置启动后自动加载最新的防火墙规则

vi /etc/network/if-pre-up.d/iptables
/etc/network/if-pre-up.d/iptables

文件内容如下:

#!/bin/sh
/sbin/iptables-restore < /etc/iptables.up.rules

三、给文件增加可执行权限

chmod +x /etc/network/if-pre-up.d/iptables

配置完成,如果之后修改了防火墙规则,只需要执行 iptables-save > /etc/iptables.up.rules命令将最新的防火墙规则写入文件即可。同时Debian重启也会自动恢复之前保存的防火墙规则。

一键DD命令

bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 10 -v 64 -a -p 你的密码 --mirror 'http://mirrors.ustc.edu.cn/debian/'

未完待续

文章名: 《个人速查手册》

文章链接:https://blog.8086k.cn/archives/63/

联系方式:1412981048@qq.com

除特别注明外,文章均为飞羽小随笔原创,转载时请注明本文出处及文章链接
Last modification:May 9th, 2021 at 08:25 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment