How to create a systemd service?
Application:
$ cat myapp.sh
#!/usr/bin/bash
echo "I'm a test app" > /tmp/test.file
Service:
$ cat /etc/systemd/system/myapp.service
...After=network.target
After=mysqld.service
Restart=on-failure
RestartSec=1
Start the service:
$ sudo systemctl start myapp
Start on boot:
$ sudo systemctl enable myapp
How to disable beep speaker?
# temporary
$ sudo rmmod pcspkr
# permanently
$ sudo gedit /etc/modprobe.d/blacklist
blacklist pcspkr
$ reboot
SSH by key
$ ssh-keygen -t ed25519 -C "new"
$ cat ~/.ssh/config
Host x.x.x.x
HostName x.x.x.xIdentityFile ~/.ssh/new
IdentitiesOnly yes
User root
Port 22
$ ssh x.x.x.x
No comments:
Post a Comment