Arch Linux 安装与配置

Arch Linux 是一个轻量级、灵活的Linux发行版。

安装

参考 Arch Wiki 安装指南。

更新系统

1
sudo pacman -Syyu

配置

基本工具

1
pacman -S man base-devel

强制更新 系统、软件

1
pacman -Syyu

用户配置

1
2
useradd -m -G wheel gary
passwd gary

visudo(修改wheel组的权限)

把 wheel ALL=(ALL)ALL 前的”#”去掉

不想用vi把vi替换掉,做vi的软链接

1
ln -s /usr/bin/vim /usr/bin/vi

前提条件,已安装(vi、sudo)

安装fish-shell

1
2
3
4
5
pacman -S fish
which fish
chsh -s /usr/bin/fish
curl -L https://get.oh-my.fish| fish
fish_config

安装yay

1
2
3
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

版权声明:本文为CSDN博主「qingt2314」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/qq_44858936/article/details/108275848

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

NextCloud私有云盘部署

1.安装Nextcloud服务端

docker hub镜像仓库自带有nextcloud的镜像,可以直接拉取

1
docker pull nextcloud

2.启动Nextcloud服务器端

1
2
# mkdir /home/gary/nextcloud
# docker run --name nextcloud -p 8096:80 --restart=always -v /home/gary/nextcloud:/var/www/html/data -d nextcloud

参数说明:

  • –name:设定容器名称为nextcloud
  • -p 8096:80 :端口映射,将宿主机8080端口映射到容器中的80端口
  • -v /data/nextcloud:/var/www/html/data将容器中项目的data目录映射到本地/home/gary/nextcloud目录下方便配置和数据保存
  • -d 是以后台形式启动

3.配置Nextcloud服务器端

3.1 Nextcloud的数据存储可以选择多种数据库,本文是以MySQL数据库为例,可以使用Docker容器方式启动MySQl数据库并link部署好的nextcloud容器

3.2 如果有域名的化,可以搭配nginx代理宿主机映射出的8096端口,使用更为简便。

安装onlyoffice

1
2
3
4
5
6
7
# mkdir /home/gary/onlyoffice

docker run --name onlyoffice -i -t -d -p 9001:80 --restart=always \
-v /home/gary/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
-v /home/gary/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
-v /home/gary/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
-v /home/gary/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver

Seafile私有云存储部署

Seafile容器安装

1
2
3
4
5
6
7
8
docker run -d --name seafile \
--restart unless-stopped \
-p 8000:8000 \
-p 8082:8082 \
-v /home/gary/seafile:/seafile \
-e SEAFILE_ADMIN="admin@seafile.local" \
-e SEAFILE_ADMIN_PW="Routon@1981" \
seafileltd/seafile

OnlyOffice集成

1
2
3
4
5
docker run --name onlyoffice -i -t -d -p 9001:80 --restart=always \
-v /home/gary/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
-v /home/gary/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
-v /home/gary/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
-v /home/gary/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver

ShowDoc文档管理工具部署

基础安装

安装前请确保你的环境已经装好了docker 。docker的安装教程在网上比较多,可以搜索了解下。这里重点介绍showdoc.

原版官方镜像安装命令(中国大陆用户不建议直接使用原版镜像,可以用后面的加速镜像)

1
docker pull star7th/showdoc

中国大陆镜像安装命令(安装后记得执行docker tag命令以进行重命名)

1
2
docker pull registry.cn-shenzhen.aliyuncs.com/star7th/showdoc
docker tag registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest star7th/showdoc:latest