Building the Ubuntu Peer Core: Steps and Notes

Index

  1. Minimize Ubuntu Mini
  2. Self-contained Peering Program with Interface and MAC Tracking
  3. Libraries for C++, Python, and Robotics
  4. Ubuntu Logging Program
  5. Unified Login and Auto-Boot to Defaultuser with Sudo Privileges

Step Details

1. Minimize Ubuntu Mini

Remove all OS bloat, desktop packages, and other preinstalled programs while shrinking Ubuntu Mini as much as possible, retaining networking capabilities, the ability to compile in C++, support Python, and run bash scripts.

Back to Index


2. Self-contained Peering Program with Interface and MAC Tracking

Create a self-contained peering program that will interlink multiple copies of the minimized Ubuntu installation via Layer 2, with an interface that allows you to see each individually connected peer. Also, include a method for tracking and maintaining a list of MAC addresses that have interacted with the system.

Back to Index


3. Libraries for C++, Python, and Robotics

To include all necessary libraries for C++, Python, and robotics development (including controlling servos, actuators, and performing system control/monitoring), you will need the following packages and installs:

C++ Packages

  1. Build-essential (for compiling C++ code):

    sudo apt install build-essential
  2. Boost Libraries (useful for various C++ functionalities in robotics):

    sudo apt install libboost-all-dev
  3. Eigen3 (a popular C++ library for linear algebra, critical for robotics development):

    sudo apt install libeigen3-dev
  4. ROS (Robot Operating System) (optional, for advanced robotics functionality):

    sudo apt install ros-noetic-desktop-full

Python Packages

  1. Python3 and Pip (Python package manager):

    sudo apt install python3 python3-pip
  2. RPi.GPIO (if working with Raspberry Pi GPIO pins for servo control):

    sudo pip3 install RPi.GPIO
  3. Adafruit-Blinka (for interfacing with servos, actuators, and sensors):

    sudo pip3 install adafruit-blinka
  4. NumPy (for numerical computations in Python):

    sudo pip3 install numpy
  5. SciPy (scientific computations, useful in robotics):

    sudo pip3 install scipy
  6. PySerial (for serial communication, often used in robotics):

    sudo pip3 install pyserial
  7. OpenCV (for computer vision applications in robotics):

    sudo apt install python3-opencv

Robotics Control and Monitoring Libraries

  1. pigpio (library for controlling servos and GPIO):

    sudo apt install pigpio python3-pigpio
  2. WiringPi (an older but widely used library for GPIO pin control):

    sudo apt install wiringpi
  3. I2C and SPI Utilities (for communicating with sensors/actuators):

    sudo apt install i2c-tools python3-smbus
    sudo apt install spi-tools
  4. MQTT (Message Queuing Telemetry Transport) (for robotics systems communicating over a network):

    sudo pip3 install paho-mqtt
  5. SMBus (for I2C communication with servo controllers):

    sudo apt install python3-smbus
  6. PyZMQ (ZeroMQ bindings for distributed and concurrent systems in robotics):

    sudo pip3 install pyzmq

Additional System Monitoring and Control

  1. htop (for system performance monitoring):

    sudo apt install htop
  2. lm-sensors (for monitoring system temperatures and voltages):

    sudo apt install lm-sensors
  3. pm-utils (for power management utilities in robotics applications):

    sudo apt install pm-utils

After installing these packages, you will have all the necessary libraries for C++, Python, and robotics development, including the control of servos, actuators, and system monitoring.

Back to Index


4. Ubuntu Logging Program

Create a program that can grep, search, and navigate the Ubuntu logging system.

Back to Index


5. Unified Login and Auto-Boot to Defaultuser with Sudo Privileges

To create and/or update a "defaultuser" account with root/sudo privileges and have the system automatically log in to this account:

1. Create/Update the "defaultuser" Account:

  1. Create the "defaultuser" account:
    If the account doesn’t exist, create it with the following command:

    sudo adduser defaultuser

    Follow the prompts to set a password for the user.

  2. Add "defaultuser" to the sudo group:
    Grant administrative privileges by adding the user to the sudo group:

    sudo usermod -aG sudo defaultuser
  3. Verify the user has sudo privileges:
    Check the sudoers file to ensure the user has the correct permissions:

    sudo visudo

    Ensure there is a line that looks like this:

    defaultuser ALL=(ALL:ALL) ALL

2. Auto-Boot to "defaultuser":

  1. Edit the GRUB configuration to automatically boot into text mode:
    Open the GRUB configuration file:

    sudo nano /etc/default/grub
  2. Change the GRUB_CMDLINE_LINUX_DEFAULT line to permit auto-login:
    Replace the line with:

    GRUB_CMDLINE_LINUX_DEFAULT="text"
  3. Set auto-login for "defaultuser":
    Create or edit the override.conf file for getty@tty1:

    sudo mkdir -p /etc/systemd/system/[email protected]
    sudo nano /etc/systemd/system/[email protected]/override.conf

    Add the following content:

    [Service]
    ExecStart=
    ExecStart=-/sbin/agetty --autologin defaultuser --noclear %I $TERM
  4. Update the GRUB configuration and reboot:
    Run the following commands:

    sudo update-grub
    sudo systemctl enable getty@tty1
    sudo reboot

3. Unify Passwords for All Systems:

  1. Set the same password for MySQL root user:
    Use the following command to set or update the MySQL root user password:

    sudo mysql -u root -p
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';
    FLUSH PRIVILEGES;
    EXIT;
  2. Set the same password for WordPress:
    If WordPress is installed, set the password for the admin user:

    wp user update admin --user_pass="your_password"
  3. Unify system user passwords:
    To change the password for the system’s "defaultuser" account:

    sudo passwd defaultuser
  4. Create a script to update passwords for all systems:
    Create a shell script that updates all necessary credentials in one step:

    nano ~/update_passwords.sh

    Add the following to the script:

    #!/bin/bash
    echo "Enter new unified password:"
    read -s password
    
    # Update MySQL root password
    mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '$password'; FLUSH PRIVILEGES;"
    
    # Update WordPress admin password
    wp user update admin --user_pass="$password"
    
    # Update defaultuser system user password
    echo "defaultuser:$password" | chpasswd
    
    echo "Passwords have been updated."
  5. Make the script executable:

    chmod +x ~/update_passwords.sh
  6. Run the script whenever you want to update all passwords:

    ./update_passwords.sh

Now your system will auto-boot into the "defaultuser" account, and you will have a unified password system across services that can be managed with a single script.

Back to Index



This version sets up the "defaultuser" account with root/sudo privileges and provides a unified password management system, while also ensuring the system auto-boots into the "defaultuser" account. Let me know if you need further adjustments!