0%

之前有一块板子做软路由,闲置很久了,导致 intl AMT 密码遗忘,找了很久的资料终于重置成功了

  1. 断掉电源
  2. 找到主板跳线image.png
  3. 移动主板跳线image.png
  4. 通电开机进入设置image.png
  5. Reset Intel AMT
  6. 关机,断电
  7. 还原跳线,通电开机,Ctrl + P 即可进入 AMT 输入默认密码即可
  8. 默认密码有 admin

Linux 默认终端丑不拉几的,几乎没法看。高亮不足,提示不全,颜值太 low 影响视觉。终极优化方案zsh + oh-my-zsh + powerlevel10k大大提升用户体验感。

如下图所示,图来自 powerlevel10k 官方
performance.gif

安装 zsh

1
2
3
4
5
# zsh
sudo apt-get install zsh

# 修改默认shell 为zsh 注意不要用sudo
chsh -s /bin/zsh

安装 oh-my-zsh & 主题

1
2
3
4
5
# 官方安装脚本
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# 下载主题 powerlevel10k主题:https://github.com/romkatv/powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k

配置 oh-my-zsh

1
2
3
4
5
6
7
8
9
10
11
12
13
vi ~/.zshrc

## 修改主题配置为
ZSH_THEME="powerlevel10k/powerlevel10k"

## 修改插件配置为
plugins=(git git-open zsh-autosuggestions zsh-syntax-highlighting)

## git-open 配置 alias 可以直接在终端输入go 就打开远程仓库地址
alias go="git-open"

## 修改完毕,保存退出后执行
source ~/.zshrc

配置 powerlevel10k

1
p10k configure

configuration-wizard.gif

有可能需要安装字体

https://github.com/romkatv/powerlevel10k#fonts

常用插件

插件 作用
zsh-syntax-highlighting 代码高亮 https://github.com/zsh-users/zsh-syntax-highlighting
zsh-autosuggestions 自动补全 https://github.com/zsh-users/zsh-autosuggestions
git-open open 仓库 https://github.com/paulirish/git-open

windows subsystem linux ubuntu安装的版本默认源仓库在国外,此文为替换国内源一个记录,同时适用于所有Ubuntu-18.04系统

阿里云源地址:https://developer.aliyun.com/mirror/

查看现有ubuntu软件源信息

1
cat /etc/apt/sources.list

结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates universe
....

更换软件源

1
2
3
4
5
6
7
8
9
# 先备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

# 在替换
sudo sed -i "s/security.ubuntu/mirrors.aliyun/g" /etc/apt/sources.list
sudo sed -i "s/archive.ubuntu/mirrors.aliyun/g" /etc/apt/sources.list

# 后更新
sudo apt update

转换证书格式

1
2
3
4
5
6
7
8
9
10
11
12
13
#查看证书
openssl x509 -in cert.crt -text -noout

#查看DER encoded证书
openssl x509 -in uhttpd.crt -inform der -text -noout

#PEM to DER
openssl x509 -in cert.crt -outform der -out uhttpd.crt
openssl rsa -in cert.key -outform der -out uhttpd.key

#DER to PEM
openssl x509 -in uhttpd.crt -inform der -outform pem -out cert.crt
openssl rsa -in uhttpd.key -inform der -outform pem -out cert.key

K3刷了LEDE想单线多拨,发现软件源内没有syncdial。手动设置感觉麻烦(没设置过啊,一键多好)
脸上笑嘻嘻,心里MMP

编译需要在Linux环境下,虚拟机不想折腾了。。懒得装的,所以用Ubuntu for Win10来试试(在微软商店下载),然后 控制面板 > 程序 > 启动或关闭Windows功能
勾上适用于Linux的Windows子系统

下载LEDE K3 SDK

可以在windows下载, 也可以在ubuntu wget

中国科大提供了openwrt镜像和代理连接openwrt.proxy.ustclug.org
SDK地址:lede-sdk-17.01.4-bcm53xx_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64

1
2
3
4
5
6
7
8
9
10
11
# 切换到D盘目录并建立文件夹lede
cd /mnt/d/ && mkdir lede
#下载SDK
wget http://openwrt.proxy.ustclug.org/releases/17.01.4/targets/bcm53xx/generic/lede-sdk-17.01.4-bcm53xx_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64.tar.xz
# 解压SDK 到lede-sdk目录
tar xvJf lede-sdk-17.01.4-bcm53xx_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64.tar.xz -C lede-sdk
# 切换到sdk目录
cd lede-sdk
# 安装依赖软件
sudo apt-get update
sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev

将源码下载到package目录下面

链接: https://pan.baidu.com/s/1pMPhJ5L 密码: fu6r

编译luci-app-syncdial

1
2
3
4
make menuconfig
# 选择 Luci > Application > luci-app-syncdial
# 保存
make package/luci-app-syncdial/compile V=99

编译完成后文件在bin目录下面

安装

通过winscp上传路由器

1
opkg install luci-app-syncdial_2.0-22_all.ipk

然后进入路由器web管理页面就完事大吉
图片

测试结果

我的宽带是20MB的, 电脑连接wifi所以没有达到下载三拨的慢速,上传已经是慢速了
图片

MARK 软件包来自https://github.com/coolsnowwolf/lede