2017年2月

wget -qO- bench.sh | bash
wget -qO- git.io/superbench.sh | bash
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench-CN.sh && bash ZBench-CN.sh

安装需要的库

apt-get install subversion g++ zlib1g-dev build-essential git python
apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget

下载配置 LEDE 源码

git clone https://git.lede-project.org/source.git lede
cd lede
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make menuconfig
make kernel_menuconfig

编译

make

解决错误

错误信息
make[1] world
make[2] tools/compile
make[3] -C tools/flock compile
make[3] -C tools/sed compile
make[3] -C tools/patch compile
make[3] -C tools/xz compile
make[3] -C tools/tar compile
make -r world: build failed. Please re-run make with -j1 V=s to see what's going on
/root/lede/include/toplevel.mk:197: recipe for target 'world' failed
make: * [world] Error 1

make -j1 V=s
export FORCE_UNSAFE_CONFIGURE=1

下载更换内核

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y

查看内核是否安装成功

rpm -qa | grep kernel

删除旧内核(可选)

rpm -ev 旧内核 

更新 grub 系统引导文件并重启

egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
grub2-set-default 0  #default 0表示第一个内核设置为默认运行, 选择最新内核就对了
reboot

系统优化 + 启用 BBR

yum install wget -y
wget https://hantu.win/sysctl.conf
mv sysctl.conf /etc
sysctl -p

安装 ss

yum install epel-release -y
yum install python-pip -y
第一种方法
wget https://github.com/shadowsocks/shadowsocks/archive/2.9.1.tar.gz
tar xzvf 2*
cd shadowsocks-2.9.1/
python setup.py install
第二种方法
pip install git+https://github.com/shadowsocks/shadowsocks.git@master
启动服务
ssserver -p 端口 -k 密码 --fast-open -d start

设置防火墙

firewall-cmd --zone=public --add-port=端口/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-all

设置开机启动

vi /etc/rc.local
ssserver -p 端口 -k 密码 --fast-open -d start

更改 SSH 端口

vi /etc/ssh/sshd_config 改Port 字段
yum install policycoreutils-python -y
semanage port -a -t ssh_port_t -p tcp 端口
firewall-cmd --permanent --zone=public --add-port=端口/tcp
firewall-cmd --reload
firewall-cmd --list-all
systemctl restart sshd.service
ss -tnlp | grep ssh

购买Virmach KVM VPS 七折优惠码:LEB30

列出当前的默认计划任务列表

crontab -l

删除当前的默认计划任务列表

crontab -r

启用vi修改当前的默认计划任务列表

crontab -e

crontab 后面还可以跟 FILE 参数,指定计划任务列表

然后是计划任务列表的格式:

[minute] [hour] [day of month] [month] [day of week] [program to be run]

其中各个参数的取值范围是:

minute(0-59)
hour(0-23)
day of month(1-31)
month(1-12)
day of week(0-7,0 or 7 is Sun)

每个参数里的取值可以有4种间隔符:

* 表示任意
- 表示范围
, 表示枚举多个值
/ 表示每隔

例如:
周一到周五每天晚上23:30执行 client -k

30 23 * * 1-5 /bin/client -k

每天每隔10分钟执行date

*/10 * * * * date

另外每次执行完成任务后系统会发送信息给你,如果你不想收,可以在每条执行语句后面加:

>> /dev/null 2>&1

wget -N --no-check-certificate https://softs.pw/Bash/cloudt.sh && chmod +x cloudt.sh && bash cloudt.sh

or

bash -c "$(wget --no-check-certificate https://coding.net/u/benzBrake/p/SeedBox-Scripts/git/raw/master/cloudtorrent.sh -O -)" -c "-i"