Update 1.RockyLinux.md
This commit is contained in:
parent
ed23529393
commit
8126ec5a7a
@ -11,7 +11,7 @@ dnf install rpmfusion-free-release
|
||||
|
||||
```sh
|
||||
dnf groupinstall "Development tools"
|
||||
dnf install vim git zip htop iftop btop hdparm stress
|
||||
dnf install vim git zip htop iftop btop hdparm stress python3-pip
|
||||
curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
|
||||
dnf install nodejs
|
||||
```
|
||||
@ -128,3 +128,45 @@ systemctl start rc-local.service
|
||||
systemctl status rc-local.service
|
||||
```
|
||||
|
||||
# Get password service
|
||||
|
||||
`/opt/password.py`
|
||||
|
||||
```sh
|
||||
#! /usr/bin/python3
|
||||
from aiohttp import web
|
||||
async def sendpass(request):
|
||||
data = {"password": "12345678"}
|
||||
return web.json_response(data)
|
||||
app = web.Application()
|
||||
app.add_routes([web.get('/andthepasswordis', sendpass)])
|
||||
web.run_app(app, port=9999)
|
||||
```
|
||||
|
||||
```sh
|
||||
python3 -m pip install aiohttp
|
||||
```
|
||||
|
||||
`/lib/systemd/system/password.service `
|
||||
|
||||
```sh
|
||||
[Unit]
|
||||
Description=Custom Python Service
|
||||
After=multi-user.target
|
||||
Conflicts=getty@tty1.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python3 /opt/password.py
|
||||
StandardInput=tty-force
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
```sh
|
||||
systemctl daemon-reload
|
||||
systemctl enable password
|
||||
systemctl start password.service
|
||||
systemctl status password.service
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user