20231019 备份
This commit is contained in:
parent
0e9b1cc5a5
commit
f7bb4ebe19
|
@ -1,3 +1,3 @@
|
||||||
# 启动文件的选择
|
# 启动文件的选择
|
||||||
|
|
||||||
![RCU](../../.image/c08ec715-6e8a-45fc-86ff-187265b0e861.png)
|
![RCU](../../.image/c08ec715-6e8a-45fc-86ff-187265b0e861.png)
|
|
@ -1,14 +1,14 @@
|
||||||
# .net core 远程调试
|
# .net core 远程调试
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
mkdir /root/.vs-debugger
|
mkdir /root/.vs-debugger
|
||||||
|
|
||||||
curl -sSL -k https://aka.ms/getvsdbgsh -o /root/.vs-debugger/GetVsDbg.sh
|
curl -sSL -k https://aka.ms/getvsdbgsh -o /root/.vs-debugger/GetVsDbg.sh
|
||||||
|
|
||||||
#没有下载包执行此命令
|
#没有下载包执行此命令
|
||||||
bash /root/.vs-debugger/GetVsDbg.sh -v latest -l /vsdbg
|
bash /root/.vs-debugger/GetVsDbg.sh -v latest -l /vsdbg
|
||||||
|
|
||||||
#下载过安装包执行此命令
|
#下载过安装包执行此命令
|
||||||
bash /root/.vs-debugger/GetVsDbg.sh -v latest -l /vsdbg -e /root/.vs-debugger/vsdbg-linux-arm64.tar.gz -u
|
bash /root/.vs-debugger/GetVsDbg.sh -v latest -l /vsdbg -e /root/.vs-debugger/vsdbg-linux-arm64.tar.gz -u
|
||||||
```
|
```
|
|
@ -1,32 +1,32 @@
|
||||||
# 安装 .NET 7
|
# 安装 .NET 7
|
||||||
|
|
||||||
* 下载脚本
|
* 下载脚本
|
||||||
|
|
||||||
```
|
```
|
||||||
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
|
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
* 授予此脚本作为可执行文件运行的权限
|
* 授予此脚本作为可执行文件运行的权限
|
||||||
|
|
||||||
```
|
```
|
||||||
chmod +x ./dotnet-install.sh
|
chmod +x ./dotnet-install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
* 安装
|
* 安装
|
||||||
|
|
||||||
```
|
```
|
||||||
./dotnet-install.sh --channel 7.0 --runtime aspnetcore
|
./dotnet-install.sh --channel 7.0 --runtime aspnetcore
|
||||||
```
|
```
|
||||||
|
|
||||||
* 设置环境变量
|
* 设置环境变量
|
||||||
|
|
||||||
```
|
```
|
||||||
vim ~/.bashrc
|
vim ~/.bashrc
|
||||||
export DOTNET_ROOT=$HOME/.dotnet
|
export DOTNET_ROOT=$HOME/.dotnet
|
||||||
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
|
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
|
||||||
```
|
```
|
||||||
|
|
||||||
* 使环境变量生效
|
* 使环境变量生效
|
||||||
```
|
```
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
```
|
```
|
|
@ -1,72 +1,72 @@
|
||||||
# 开机启动
|
# 开机启动
|
||||||
|
|
||||||
### 复制程序到 /opt 目录下
|
### 复制程序到 /opt 目录下
|
||||||
|
|
||||||
```
|
```
|
||||||
cp /root/works/console_app/console_app /opt/app
|
cp /root/works/console_app/console_app /opt/app
|
||||||
```
|
```
|
||||||
|
|
||||||
### 创建启动脚本
|
### 创建启动脚本
|
||||||
|
|
||||||
* 切换目录, 并创建文件
|
* 切换目录, 并创建文件
|
||||||
|
|
||||||
```
|
```
|
||||||
cd /opt
|
cd /opt
|
||||||
vim run.sh
|
vim run.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
* run.sh 文件内容
|
* run.sh 文件内容
|
||||||
|
|
||||||
```
|
```
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
cd /opt/
|
cd /opt/
|
||||||
./app
|
./app
|
||||||
```
|
```
|
||||||
|
|
||||||
### 创建服务
|
### 创建服务
|
||||||
|
|
||||||
* 切换目录, 并创建文件
|
* 切换目录, 并创建文件
|
||||||
|
|
||||||
```
|
```
|
||||||
cd /etc/systemd/system
|
cd /etc/systemd/system
|
||||||
vim console_app.service
|
vim console_app.service
|
||||||
```
|
```
|
||||||
|
|
||||||
* console_app.service 文件内容
|
* console_app.service 文件内容
|
||||||
|
|
||||||
```
|
```
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=console app server
|
Description=console app server
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
#ExecStart=/home/rpdzkj/works/console_app/console_app
|
#ExecStart=/home/rpdzkj/works/console_app/console_app
|
||||||
ExecStart=/opt/run.sh
|
ExecStart=/opt/run.sh
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5s
|
RestartSec=5s
|
||||||
# 30秒后在启动服务
|
# 30秒后在启动服务
|
||||||
TimeoutStartSec=infinity
|
TimeoutStartSec=infinity
|
||||||
ExecStartPre=/bin/sleep 30
|
ExecStartPre=/bin/sleep 30
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
### 重新加载 Systemd
|
### 重新加载 Systemd
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
```
|
```
|
||||||
|
|
||||||
### 启动服务
|
### 启动服务
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo systemctl start console_app
|
sudo systemctl start console_app
|
||||||
```
|
```
|
||||||
|
|
||||||
### 开机启动
|
### 开机启动
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo systemctl enable console_app
|
sudo systemctl enable console_app
|
||||||
```
|
```
|
5
Ubuntu/动态查看文件.md
Normal file
5
Ubuntu/动态查看文件.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# 动态查看文件
|
||||||
|
|
||||||
|
```
|
||||||
|
tail -f 文件名
|
||||||
|
```
|
56
香橙排打印机(orangepi)/打印脚本.md
Normal file
56
香橙排打印机(orangepi)/打印脚本.md
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
# 打印脚本
|
||||||
|
|
||||||
|
* printer.sh
|
||||||
|
|
||||||
|
```
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
echo "FALSE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#删除所有的打印任务
|
||||||
|
lprm
|
||||||
|
|
||||||
|
#删除默认打印机
|
||||||
|
lpadmin -x DS-RX1HS
|
||||||
|
|
||||||
|
#查找打印机
|
||||||
|
result=`lpinfo -v | grep direct`
|
||||||
|
if [ -n "$result" ]
|
||||||
|
then
|
||||||
|
directs=`echo $result | cut -d " " -f 2`
|
||||||
|
|
||||||
|
# 重启CUPS服务
|
||||||
|
service cups restart
|
||||||
|
|
||||||
|
# 重新添加驱动
|
||||||
|
lpadmin -p DS-RX1HS -E -v "$directs" -m gutenprint.5.2://dnp-dsrx1/expert
|
||||||
|
|
||||||
|
# 设置默认打印机
|
||||||
|
lpoptions -d DS-RX1HS
|
||||||
|
|
||||||
|
# 激活
|
||||||
|
cupsenable DS-RX1HS
|
||||||
|
|
||||||
|
# 设置为接受作业
|
||||||
|
cupsaccept DS-RX1HS
|
||||||
|
|
||||||
|
# 查询默认打印机
|
||||||
|
result=`lpstat -d | cut -d ":" -f 2`
|
||||||
|
|
||||||
|
if [ -n "$result" ]
|
||||||
|
then
|
||||||
|
# 打印机驱动重新加载成功
|
||||||
|
PrintPhoto DS-RX1HS $1
|
||||||
|
echo "TRUE"
|
||||||
|
else
|
||||||
|
# 打印机驱动重新加载失败
|
||||||
|
echo "FALSE"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# 打印机不存在
|
||||||
|
echo "FALSE"
|
||||||
|
fi
|
||||||
|
```
|
|
@ -1,48 +1,48 @@
|
||||||
# 添加打印机驱动脚本
|
# 添加打印机驱动脚本
|
||||||
|
|
||||||
* 需要进行[环境搭建](./环境搭建.md), 脚本文件如下:
|
* 需要进行[环境搭建](./环境搭建.md), 脚本文件如下:
|
||||||
|
|
||||||
```
|
```
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "删除所有的打印任务"
|
echo "删除所有的打印任务"
|
||||||
lprm
|
lprm
|
||||||
|
|
||||||
echo "删除默认打印机"
|
echo "删除默认打印机"
|
||||||
lpadmin -x DS-RX1HS
|
lpadmin -x DS-RX1HS
|
||||||
|
|
||||||
echo "查找打印机"
|
echo "查找打印机"
|
||||||
result=`lpinfo -v | grep direct`
|
result=`lpinfo -v | grep direct`
|
||||||
if [ -n "$result" ]
|
if [ -n "$result" ]
|
||||||
then
|
then
|
||||||
directs=`echo $result | cut -d " " -f 2`
|
directs=`echo $result | cut -d " " -f 2`
|
||||||
echo "打印机=$directs"
|
echo "打印机=$directs"
|
||||||
|
|
||||||
echo "重启CUPS服务"
|
echo "重启CUPS服务"
|
||||||
service cups restart
|
service cups restart
|
||||||
|
|
||||||
echo "重新添加驱动"
|
echo "重新添加驱动"
|
||||||
lpadmin -p DS-RX1HS -E -v "$directs" -m gutenprint.5.2://dnp-dsrx1/expert
|
lpadmin -p DS-RX1HS -E -v "$directs" -m gutenprint.5.2://dnp-dsrx1/expert
|
||||||
|
|
||||||
echo "设置默认打印机"
|
echo "设置默认打印机"
|
||||||
lpoptions -d DS-RX1HS
|
lpoptions -d DS-RX1HS
|
||||||
|
|
||||||
echo "激活"
|
echo "激活"
|
||||||
cupsenable DS-RX1HS
|
cupsenable DS-RX1HS
|
||||||
|
|
||||||
echo "设置为接受作业"
|
echo "设置为接受作业"
|
||||||
cupsaccept DS-RX1HS
|
cupsaccept DS-RX1HS
|
||||||
|
|
||||||
echo "查询默认打印机"
|
echo "查询默认打印机"
|
||||||
result=`lpstat -d | cut -d ":" -f 2`
|
result=`lpstat -d | cut -d ":" -f 2`
|
||||||
|
|
||||||
if [ -n "$result" ]
|
if [ -n "$result" ]
|
||||||
then
|
then
|
||||||
echo "打印机驱动重新加载成功"
|
echo "打印机驱动重新加载成功"
|
||||||
else
|
else
|
||||||
echo "打印机驱动重新加载失败"
|
echo "打印机驱动重新加载失败"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "打印机不存在"
|
echo "打印机不存在"
|
||||||
fiS
|
fiS
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user