Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simply-static domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
2024 年 3 月

andoq 安装openwrt

玩客云刷Armbian->安装Docker->安装openwrt / 安装青龙面板 极简教程(成功率高 拿走不谢)_armbian安装openwrt-CSDN博客

#安装docker可视面板
docker run --restart always --name fast -p 8081:8081 -d -v /var/run/docker.sock:/var/run/docker.sock wangbinxingkong/fast
#打开网卡混杂模式 
ip link set eth0 promisc on
#创建网络:你的网络是多少段 X 就填多少,其他的数字不要乱改!
docker network create -d macvlan --subnet=192.168.X.0/24 --gateway=192.168.X.1 -o parent=eth0 macnet
#拉取镜像
docker pull jyhking/onecloud:1.1
#然后配置一下
docker run -itd --name=OneCloud --restart=always --network=macnet --privileged=true jyhking/onecloud:1.1 /sbin/init

#路由后台查看openwrt的ip地址->直接网页登陆IP 【账号:root 密码:password】 

树莓派中装docker,docker中装openwrt – 知乎 (zhihu.com)

自定义固件安装

scp openwrt-03.20.2024-rockchip-armv8-panther_x2-rootfs.tar.gz root@192.168.0.105:/root/

gunzip openwrt-03.20.2024-rockchip-armv8-panther_x2-rootfs.tar.gz
#使用docker import命令导入到docker,把镜像命名为openwrt
docker import openwrt-03.20.2024-rockchip-armv8-panther_x2-rootfs.tar openwrt
#检查镜像是否导入成功
docker image ls
#创建docker网络
#打开网卡混杂模式,使网卡可以接收任何流量
ip link set eth0 promisc on
#上面的命令是临时性的,重启失效。如果打算把openwrt设置成开机自动启动的话,需要改成永久有效。编辑/etc/rc.local文件,添加一行:

ip link set eth0 promisc on
#创建docker网络,网络驱动程序为macvlan,网络命名为openwrt,子网和网关根据实际情况修改
docker network create -d macvlan --subnet=192.168.0.0/24 --gateway=192.168.0.1 -o parent=eth0 openwrt
创建docker容器
使用docker run创建容器,命令格式:docker run [选项] 镜像名 命令。

docker run --restart always --name openwrt -d --network openwrt --privileged openwrt /sbin/init

openwrt基本配置
openwrt启动后,执行docker exec进入容器

docker exec -it openwrt /bin/sh
修改openwrt的root密码

passwd
编辑openwrt的/etc/config/network文件,在config interface 'lan' 一节,把设备改成eth0,把其中的ip并改成想要的ip,这里改成192.168.0.254。添加一行网关:option gateway '192.168.0.1'其他无用配置也可以删掉
重启openwrt网络,使修改生效。

service network restart

设置一下开机自动启动

docker update --restart=always openwrt
docker update --restart=always homeassistant

不加ha会导致ha启动失败

Linux清除历史命令

在Linux中,可以通过清除特定的历史文件或者修改特定的环境变量来清除历史命令。历史命令通常保存在当前用户的家目录下的一个隐藏文件中,即.bash_history

要清除当前用户的历史命令,可以使用以下命令:

history -c

如果想要永久地清除历史记录,需要删除.bash_history文件:

rm ~/.bash_history

另外,如果你使用的是其他shell,比如zsh或者csh,历史文件可能会有不同的名称,如~/.zsh_history~/.history

请注意,这些方法只会影响当前用户,如果需要清除其他用户的历史记录,需要相应提升权限,并且指定对应的用户家目录。

如果你想要临时阻止某些命令出现在历史记录中,可以在命令行执行命令时使用history -c,或者在执行命令时使用空格或其他字符(如;)分隔命令,这样执行时不会被加入到历史记录中。例如:

echo"This command will not be in history" ; history -c ; echo"Neither will this"

上述命令中的echo语句不会出现在历史记录中,因为它们被分隔了。

密码保护:aptool

此内容受密码保护。如需查阅,请在下列字段中输入您的密码。

istoreos恢复出厂设置

软路由启动完成后,多次输入回车,在命令行中输入`firstboot`命令。系统会提示清理相关配置,确认后输入“y”并回车