This is an old revision of the document!
Ok.. here is a cheat sheet for all the useful commands you might need.
Login
Open a WSL session on your windows PC
ssh username@hostname.scottworld.net sudo -s (to become root/admin)
Reboot
This will reboot the server (only really necessary after a kernel update)
reboot
Shutdown
This will cause the server to shutdown and power off - you will need to press the power on button to restart.
shutdown -h now
Check for updates and upgrade
Occasionally you will need to make sure things are secure and up to date.
apt update (this will refresh the repositories and look for updates) apt upgrade (this will install any new updates) apt autoremove (this will remove any old packages that are no longer used)
Show disk space remaining
This will list all disks and their current usage.
df -h
Monitor the system log
This is really handy to see what is going on. Open a 2nd WSL ssh session to the server and run the following to follow the syslog in real time.
tail -f /var/log/syslog
Editing files
Use nano to edit files. Its is recommended you use TAB to predict the path and the file name.
nano /path/to/the/file
Exit the file and save after editing with
ctrl x (then press Y to save, followed by enter)
Changing / navigating directories etc
cd /path/to/location (change directory) pwd (show present working directory) cd .. (go up a directory) rm /path/to/file/or/directory -R (removes a file or directory the -R removes everything in it and under it) mkdir directoryname (makes a directory) rmdir directoryname (removes a directory) ls -l (lists the directory contents in a nice format) ls -la (lists the directory as well as hidden files in a nice format)
Managing Gaming Servers (steam)
login as normal … become root.
YOU MUST Change to become the gameadmin user do not run these scripts as root
su gameadmin
change to the gameservers directory.
cd /srv/data/gameservers
Or you can just change to this users home directory
cd ~
To update servers run
./game_updater.sh
To launch servers
./game_launcher,sh
To enable / disable servers to run or update.
Change into the scripts directory, and edit either the game script for that server or the update script. - Change “true” to “false” if you want to enable / disable from the updater or launcher scripts.
To see what servers are running…
screen -ls
To attach to a server instance (to shut it down)
screen -R <the screen id> e.g 116902.7d2d ctrl c (to shut the server down).
or if you don't want to shut it down you can
ctrl+a d (to detach again and leave it running)
To exit from the gameadmin account just exit…
exit
Homeassistant
Use virtual machine manager (on your gandalf machine to see whats going on) It is set to start on system boot, so no need to start it every time.
Your console can be accessed at
http://hobbiton.scottworld.net:8123
There is some useful stuff here
https://ubuntu.com/tutorials/command-line-for-beginners#1-overview
