Server features and usage

This page summarizes features and usage.

Important: As this page may be seen publicly, names, passwords, key-pairs, etc. should *not* be posted here.

Linux kernel

For OVH Debian 10 boxes, Linux kernels shouldn't be updated or you may brick the boxes.

Passwords, etc.

This is a list of partner-level box credentials. Each partner should have these items. These items should not be shared with others.

"debian" account password. "mariadb" server root password. "debian" account private-key. "postgresql" server root password.

Cloud Storage

The Google Drive CLI tool (drive) is installed. So is the AWS CLI tool (aws), which can be used to connect to various AWS storage services.

Virtual disks

The system includes two special virtual disks: /ram/ and /mnt/cdisk/

/ram/ is a RAM disk. It's to be used for builds or other temporary operations. This will speed up builds and reduce disk wear.

Warning: The contents of /ram/ will disappear on reboot or may be purged periodically.

/mnt/cdisk/ is a persistent disk. Its contents will survive reboot.

/mnt/cdisk/ is to be used by applications that generate lots of small to medium size files (up to about 50 MB each in size). If you have applications like that, create directories in /mnt/cdisk/ and keep the files there.

These are compressed disks. /ram/ is presently 4 GB of RAM and about 8 GB of storage. /mnt/cdisk/ is presently 50 GB of physical disk and about 100 GB of storage.

The sizes can be increased or decreased if necessary.

No compression gains will be realized by the storage of JPEG, PNG, ZIP, or tarball files in these directories. However, /mnt/cdisk/ in particular is efficient for the storage of small files whether or not they can be compressed.

Minetest builds

All of the usual desktop Minetest dependencies are installed.

This box builds Minetest, both server and client as well as both Linux and Windows versions, in just a few seconds.

Caveats: We're not set up to build Android releases yet. And, for the Windows builds, it'll take longer if you decide to build the support libraries from scratch.

Web servers and SSL certs

Both nginx and apache2 are supported and running. Both support PHP7.

Don't add modules to the web servers without discussion as we need to document this step.

To register and renew Let's Encrypt SSL certs, use lego. Akuma and Edgy1 have separate lego-scripts for their respective domains. The scripts are TBD.

lego is a replacement for certbot. Don't use certbot as certbot doesn't properly support multiple accounts.

Misc. pieces

dnsmasq is used for DNS. Lookups are cached and should be fast. As a related note, "resolv.conf" is immutable. This is intentional.

To clear the DNS cache, use: sudo service dnsmasq restart

go is release 1.14 as opposed to 1.11, the older release that, as of mid-2020, Debian 10 uses by default.

IPV4 addresses

Presently, 3 extra IPV4 addresses come up shortly after boot time. To be documented.

There's a system script that application startup scripts can use to wait for the IPV4 addresses to come up. More about this further down.

System restarts

If you'd like to set up some of your processes to restart on reboot, proceed as follows:

(a) Create a bash script named myboot.sh or anything similar. Put it somewhere in your home directory tree. The script should start as follows:

#!/bin/bash
/opt/boot/wait-ipv4.sh

(b) Append the commands needed to start your processes. Make your script executable; i.e., run chmod 755 on it.

(c) Add a line similar to the following to "/etc/rc.local" right before the "exit 0" line in that file:

/home/edgy1/myboot.sh >& /home/edgy1/myboot.log &

Execution in the background, i.e., the trailing "&", is strongly advised unless you know what you're doing. Additionally, blocking commands must not be added to "/etc/rc.local" itself.

MariaDB admin

If you need to create a MariaDB aka MySQL database and/or user, you can use a bash script similar to the following.

This script deletes the database specified by DBNAME, if it exists, and then creates the database.

It then creates the database user specified by DBUSER unless the user already exists. It closes by granting the user control of the database. DBPASS specifies the user's database password.

DBROOTPASS='mariadb-root-password-goes-here'
DBUSER=sally
DBNAME=sally
DBPASS='sally/forth&conquer'

mysql -uroot -p$DBROOTPASS << END
drop database if exists $DBNAME;
create database $DBNAME;
use $DBNAME;

create user if not exists
'$DBUSER'@'localhost' identified by '$DBPASS';

grant usage on *.* to '$DBUSER'@'localhost';
grant all on $DBNAME.* to '$DBUSER'@'localhost';
END

PostgreSQL admin

To create a PostgreSQL database and user, you can use steps similar to the following.

Warning: This example both creates and deletes the specified database and user.

service postgresql restart

su - postgres
psql
create database testdb;
create user snoopy password 'tomato';
grant all on database testdb to snoopy;
# Press Control-D to exit "psql"
# Press Control-D to exit "su"

su - snoopy
psql -d testdb
# Press Control-D to exit "psql"
# Press Control-D to exit "su"

su - postgres
psql
drop database testdb;
drop user snoopy;
# Press Control-D to exit "su" session
# Press Control-D to exit "su"

Misc. CLI utilities

cls - clear screen
cmptree - Byte-compare two directory trees
cptime - copy file or directory timestamp
debak - Delete backup files in current directory
debaktree - Delete backup files in current tree
deext - Echoes arguments with filename extensions removed
detab - Detabs files using a 4-space column width
epoch - Display timestamp of a directory or file
largest - List largest files in a directory tree
md5all - Output MD5 sums for a directory tree
md5tree - Relatively powerful MD5 sum manager
newest - List newest files in a directory tree
oldest - List oldest files in a directory tree
runhtpdate - (root only) sync server time by HTTP
scalerx - PNG scaler intended for small game icons
scalex - Alternate version of "scalerx"
setdos - Set newlines to DOS format
setunix - Set newlines to UNIX format
tardate - Set timestamp of a tarball or ZIP file
trimws - Trim white space from end of text lines

© OldCoder 2020 Internal page    |  Privacy   |  Contact   |  Notices  
© 2012-2020 Robert Kiraly aka OldCoder and BoldCoder    |  Privacy policy    |  Contact   |  Notices