欢迎光临
我们一直在努力

Install lspci,lsscsi,lsusb and lsblk tools in Centos7

Hong阅读(146)

yum install util-linux-ng command to install lsblk tool
yum install lsscsi command to install lsscsi tool.
yum install pciutils command to install lspci tool
yum install usbutils command to install lsusb tool.

HA中使用USB作为启动密钥

Hong阅读(116)

使用命令查询vendor ID and device ID

$ lsusb

在目录中增加文件 /etc/udev/rules.d/80-usb.rules

ACTION=="add", SUBSYSTEMS=="usb", ATTR{idVendor}=="05e3", ATTR{idProduct}=="0751", RUN+="/usr/local/bin/usb-ha.sh start"  
ACTION=="remove", SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05e3", ENV{ID_MODEL_ID}=="0751", RUN+="/usr/local/bin/usb-ha.sh stop"

在目录增加文件 /usr/local/bin/usb-ha.sh

#!/bin/bash
if [ ${1} == "start" ]
then
docker start homeassistant
elif [ ${1} == "stop" ]
then
docker stop homeassistant
fi

授权

chmod +x /usr/local/bin/usb-lock.sh
sudo udevadm control --reload

 

 

How To Install and Use Docker on CentOS 7

Hong阅读(128)

sudo yum check-update

curl -fsSL https://get.docker.com/ | sh

sudo systemctl start docker

sudo systemctl status docker

 

sudo systemctl enable docker

sudo usermod -aG docker $(whoami)

 

 

 

 

 

 

 

 

Docker 搭建私有镜像仓库Registry

Hong阅读(134)

一, Registry安装

1.新建配置文件:/usr/local/app/config.yml

version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
Access-Control-Allow-Origin: ['*']
Access-Control-Allow-Methods: ['*']
Access-Control-Max-Age: [1728000]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3

2.运行docker registry 镜像

docker run -d -p 5000:5000 --name registry -v /usr/local/app/config.yml:/etc/docker/registry/config.yml -v /usr/local/registry:/var/lib/registry --restart=always registry:2

二、Docker Registry UI

1. 运行docker 镜像

docker run -d -p 80:80 joxit/docker-registry-ui

可以使用http://localhost 访问registry ui

三、Push image 到Registry

docker tag imageId registryIp/project/imageName:tag
docker push registryIp/project/imageName:tag

 

Ubuntu 18.04安装Docker

Hong阅读(133)

以普通用户执行如下命令:

sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt install -y docker-ce
sudo usermod -aG docker ${USER}

运行完所有命令,重新登录该用户

安装完Docker以后,以普通用户执行如下命令:

sudo mkdir -p /etc/systemd/system/docker.service.d/
sudo cat << EOF > /etc/systemd/system/docker.service.d/docker.root.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -g /data/docker -H fd://
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

Windows11 去掉右键 ”Show More Options“

Hong阅读(216)

Open Windows Terminal, Command Prompt, or PowerShell use Administrator.

Disable:
reg add “HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32” /f /ve

Enable:
reg delete “HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}” /f

Restart your computer.

微信小程序 scroll-view中input弹起键盘内容不显示

ziyoukeji阅读(234)

最近input遇到一些问题,

问题一:微信小程序 scroll-view中input弹起键盘内容不显示,收起键盘后才可会显示

问题二:input弹出键盘后 scroll-view位置滚动变化。

解决方案一  height不能是100vh   不能是100%

解决方案二  scroll-view加上 overflow: hidden;

visual studio 2022 mvc 无法格式化的问题

ziyoukeji阅读(366)

最近安装了visual studio 2022  创建了mvc发现写的js无法格式化。查了好久,也没有找到方案。终于在我的研究下找到了解决方案就是参考下图把 使用适用于ASP.NET core 的旧版Razor选项改成true

Ubuntu install mailutils to send email

Hong阅读(350)

 

Install mailutils:

sudo apt-get update -y
sudo apt-get install -y mailutils

Test send email:

echo "test message" | mail -s 'test subject' myemail@mydomain.com

Postfix : postdrop warning unable to look up public/pickup

Hong阅读(459)

WSL Ubuntu下,使用Postfix  发送邮件时提示如下错误:

postdrop: warning: unable to look up public/pickup: No such file or directory

处理方式:

sudo mkfifo /var/spool/postfix/public/pickup

sudo service postfix restart

 

 

自由技术,自由自在

项目合作联系我们