ArchWSL - Windows下的Arch Linux

参考:https://docs.microsoft.com/zh-cn/windows/wsl/install

GitHub: https://github.com/yuk7/ArchWSL

更新系统

1
sudo pacman -Syyu

配置环境变量

1
vi ~/.config/fish/config.fish
1
set PATH /opt/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf/bin $PATH

验证

1
arm-linux-gnueabihf-gcc -v

安装需要的tool

1
sudo pacman -S git gcc g++ make gcc-multilibmake python xz-utils

卸载子系统

1
wslconfig /l

从列表中选择要卸载的发行版(例如Ubuntu)并键入命令

1
wslconfig /u Arch

Archlinux清华大学镜像源

编辑 /etc/pacman.d/mirrorlist,找到 #China 去掉清华源前面的#

1
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch

之后安装 archlinuxcn-keyring 包导入 GPG key。

Awtrix智能像素灯服务端部署

AWTRIX 2.0服务端搭建

参考:https://www.zhangtaidong.cn/archives/69/

Linux Installer

Enter the following command in your SSH terminal for automatic installation

1
wget -N https://blueforcer.de/awtrix/awtrix.sh ; sudo sh awtrix.sh

Shortly after the start the web interface can be accessed via http://awtrix_ip:7000.

服务管理

Starting AWTRIX:

1
sudo service awtrix start

Stop AWTRIX:

1
sudo service awtrix stop

AWTRIX Restart:

1
sudo service awtrix restart

AWTRIX 使能开机启动:

1
sudo systemctl enable awtrix

Controller

文档:https://awtrixdocs.blueforcer.de/#/en-en/

Reset the Controller

Fast and easy(使用手机或电脑搜索wifi,找到AWTRIX Controller这个ssid并加入,密码为awtrixxx)

  • switch of your routers wifi
  • resatrt the controller
  • It will go into the hotspot mode if it doesnt find the wifi
  • Turn on your routers wiif again and proceed with the configuration

Awtrix保姆级教程

https://bbs.iobroker.cn/t/topic/3888

DNSmasq+webproc-Web管理界面部署

安装dnsmasq

1
yum install -y dnsmasq

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
resolv-file=/etc/resolv.dnsmasq.conf
strict-order
no-hosts
listen-address=192.168.31.4
server=192.168.31.1
log-queries
log-facility=/var/log/dnsmasq.log
log-async=20
cache-size=10000

#DNS解析设置
address=/esxi.mg.sh/192.168.31.3
address=/dns.mg.sh/192.168.31.4
address=/jira.mg.sh/192.168.31.6
address=/git.mg.sh/192.168.31.8

webproc管理界面

https://github.com/jpillora/webproc

使用二进制安装

1
curl https://i.jpillora.com/webproc | bash

安装完成后启动

1
nohup webproc --configuration-file /etc/dnsmasq.conf -- dnsmasq --no-daemon &

后面的–no-daemon可以写成以守护进程启动–daemon

启动完成后可以在浏览器输入地址加端口号8080访问,没有账号密码。

DNSmasq搭建与配置

Docker搭建

docker-dnsmasq支持通过web页面配置域名映射,镜像地址: https://hub.docker.com/r/jpillora/dnsmasq

使用步骤如下:

1、在Docker宿主上创建 /home/gary/dnsmasq.conf 配置文件

1
touch /home/gary/dnsmasq.conf

2、docker run启动容器

1
2
3
4
5
6
7
8
9
10
11
docker run \
--name dnsmasq \
-d \
-p 53:53/udp \
-p 5380:8080 \
-v /home/gary/dnsmasq/a_dns/dnsmasq.conf:/etc/dnsmasq.conf \
--log-opt "max-size=100m" \
-e "HTTP_USER=admin" \
-e "HTTP_PASS=123456" \
--restart always \
jpillora/dnsmasq

HTTP_USER:web页面登陆的管理员帐号 HTTP_PASS:web页面登陆的管理员密码

3、通过 ip:5380 地址访问web页面,使用帐户密码登陆后在线编辑 dnsmasq.conf 文件

我的dnsmasq.conf配置文件内容如下:

1
2
server=192.168.1.8
address=/www.vlab.syb/192.168.1.8

项目地址:https://github.com/jpillora/docker-dnsmasq

直接安装

1
yum install -y dnsmasq

web-ui管理界面:https://github.com/jpillora/webproc

1
webproc --configuration-file /etc/dnsmasq.conf -- dnsmasq --no-daemon

IPcheck-IP地址变化监控脚本

安装

1
2
sudo apt-get install mutt
sudo apt-get install msmtp

安装好了这两个包之后,就是进行相关配置文件的配置了:

首先配置 mutt

系统全局设置配置文件在 /etc/Muttrc,如果使用某个系统用户,可以在~/.muttc中设置,没有该文件,就自己创建。

1
vi .muttrc
1
2
3
4
5
6
set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="qingwei_cui@163.com"
set from="qingwei_cui@163.com"
set envelope_from=yes
set copy=no