Add additional IPv4 on OVH server with Ubuntu 22.04+

1. Create file /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg :

sudo nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

with content:

network: {config: disabled}

Press CTRL+O and Enter to save, CTRL+X to leave nano

2. Edit file /etc/netplan/50-cloud-init.yaml :

sudo nano /etc/netplan/50-cloud-init.yaml

In addresses: section add your new IP with /32 at end. Example files edits at end of this post.

3. Test your new config:

sudo netplan try

It will count down from 120 seconds:
– open second SSH connection to server, to make sure that network still works
– ping new additional IP, server should return ping

If SSH and ping works, press Enter to stop countdown and then run:

sudo netplan apply

If connection to SSH is blocked or ping does not work, wait these 120 seconds, so it will revert your network changes. If you accept invalid network config, it may disable network on your dedic/VPS. Then you will have to reinstall operating system on machine or run Rescue Mode in OVH panel, but it may take around 30 minutes to fix server network config – OS reinstall is faster.

Example 1

Before:

network:
    version: 2
    ethernets:
        enp6s0:
            accept-ra: false
            addresses:
            - 2001:aa:aa:aa::/56
            dhcp4: true
            match:
                macaddress: aa:aa:aa:00:d9:a0
            routes:
(... many lines with IPv6 config)

After:

network:
    version: 2
    ethernets:
        enp6s0:
            accept-ra: false
            addresses:
            - 2001:aa:aa:aa::/56
            - 5.12.13.123/32
            dhcp4: true
            match:
                macaddress: aa:aa:aa:00:d9:a0
            routes:
(... many lines with IPv6 config)

Example 2

Before:

network:
  version: 2
  ethernets:
    eno1:
      match:
        macaddress: "a4:bf:01:22:90:c6"
      addresses:
      - "2604:aa:aa:aa::1/128"
      dhcp4: true
      accept-ra: false
      set-name: "eno1"
      routes:
      - on-link: true
        to: "default"
        via: "2604:aa:aa:aa:9ff:ff:ff:ff:ff"

After:

network:
  version: 2
  ethernets:
    eno1:
      match:
        macaddress: "a4:bf:01:22:90:c6"
      addresses:
      - "2604:aa:aa:aa::1/128"
      - 5.12.13.123/32
      dhcp4: true
      accept-ra: false
      set-name: "eno1"
      routes:
      - on-link: true
        to: "default"
        via: "2604:aa:aa:aa:9ff:ff:ff:ff:ff"

Move OTS database from MySQL to MariaDB

If you installed MySQL 8.0 and imported OTS schema.sql with default settings, you database uses encoding not supported by MariaDB.

If you dump database using:

mysqldump dbname > dump.sql

and try to import it into MariaDB using:

mysql dbname < dump.sql

It will show error. To fix this, run these 2 commands:

sed -i 's/utf8mb4_0900_ai_ci/utf8_general_ci/g' dump.sql
sed -i 's/CHARSET=utf8mb4/CHARSET=utf8/g' dump.sql

Save core dump to file named ‘core’ on Linux Ubuntu

By default crashes are processed by apport app, so first step is to disable it:

sudo systemctl stop apport
sudo systemctl disable apport

Then you have to set core file name to core and disable adding PID to core file name. Create file /etc/sysctl.d/99-crash.conf with content:

kernel.core_pattern=core
kernel.core_uses_pid=0

Then you have to reload system config:

sysctl --system

To check current core file location config execute:

cat /proc/sys/kernel/core_pattern