[Review] Asrock x300 as Home Server

[Review] Asrock x300 as Home Server

November 3, 2024

It is about time to put everything together.

This year I got this compact ~2L box as my new personal computer (probably server at some point).

Why a server? I went crazy and build it with 64GB RAM.

Asrock x300 boxes

ℹ️

Asrock x300 How to

Im using Ubuntu KDE Plasma with Kernel 6.8. Customized like so.

Screen/Display Setup in Linux 📌

I am using a Flatron W1946, which it is native 1360x768 and it was not detected by default.

#xrandr --query #get the name, in this case, DisplayPort-1
cvt 1360 768 60
xrandr --newmode "1360x768_60.00" 85.25  1360 1424 1568 1776  768 771 778 795 -hsync +vsync
xrandr --addmode DisplayPort-1 "1360x768_60.00"
xrandr --output DisplayPort-1 --mode "1360x768_60.00"

And now, I could see the configuration also in the System Settings UI, right at Display Configuration.

See Hardware Info and Disks Setup 📌
lscpu
#sudo lshw

#sudo apt install lm-sensors
#sensors
df -h | awk '$2 ~ /G/ && $2+0 > 3' #if you set logs, careful with the disk space (see drives >3GB)
df -h | awk 'NR==1 || $2 ~ /[GT]/'

lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT | awk 'NR==1 || $2 ~ /[GT]/'
Asrock X300 Wifi Connectivity 📌

Using an TP-Link Archer T3U (AC1300), which I upgraded to the AC1300 T4U Plus version.

ip addr show
hostname -I

#sudo apt-get install net-tools
#ifconfig
#ifconfig eth0 | grep -A 10 "<global>" #check mac, and transfered packages
ifconfig eth0 | grep "inet " | awk '{ print $2 }' #if ETH Connected - SEE THE LOCAL IP
#ifconfig tailscale0 | grep "inet " | awk '{ print $2 }' #for Tailscale

ping -c 4 192.168.0.1 #gateway
ping -c 4 192.168.0.117 #ping the orange pi which is connected to same device
ping 9.9.9.9 #ping quad9 dns server
sudo apt-get install dnsutils -y #dns resolution
nslookup github.com 
dig google.com
sudo apt-get install speedtest-cli
speedtest-cli #speedtest-cli --simple

sudo snap install fast
fast
#npm install --global fast-cli && fast
  • The Opi5 with cable has 780/60 for comparison.

Got 195mb/s and 58mb/s with the T3U and 218/59 with the t4U Plus.

curl -sS https://ipinfo.io/json #the command to use
curl -sS http://ip-api.com/json/ #provides info about country, ISP, ...
curl -6 ifconfig.me #ipv6 info 
Better DNS’s 📌

I like to use QUAD9 DNS’s:

sudo nano /etc/resolv.conf

Add the following, if you want, to use quad9 DNS:

#nameserver 192.168.0.117 #to use the OPi5 locally
nameserver 9.9.9.9
nameserver 149.112.112.112
nslookup google.com #see that now you are using quad9 DNS

Server Power and Fan Management

As per this post

But I decided to manage everything via the BIOS.

So now the fan is at 30% up to 60 Celsius.

For Windows you can use FanControl and AMD Adrenaline Software. You also have thinkfan for Thinkpads

Changing Power Profiles 📌
#sudo apt-get -y install power-profiles-daemon
powerprofilesctl list
#powerprofilesctl set performance

Conclusions of Asrock X300

Benchmarks of Asrock x300 with Ryzen 5600G 📌

What am I using it for right now?

Video Editing 101

I recently started to make some simple video edits.

Video editing with shell scripts was interesting.

But I needed to try Python video editing with moviePy.

And it can do crazy stuff.

ℹ️
Video Edition Repo. Using ffmpeg. Or using Python MoviePy which worked for Windows/Linux

Like having speech recognition and silencing the parts with human voices…

…so that only the music is playing at those moments.

AI Stuff

  • Generating Content - like so
    • Already working for interesting sites, like this
  • Better CVs for all with OpenAI API
    • MailerLite API to check emails, makes it easy to place a small wall to streamlit
      • If you choose doble opt-in, they will verify the email
    • But we could also use FormBricks as a wall
      • You can get feedback on the users needs before/after trying the app
      • If you connect the form with GSheets and make python read it, you have a simple way to compare emails for access
      • Forms can be embed on email, on website (as iframe or pop up) and…with a simple link.
    • Or…a real paywall, with StripeAPI
      • It allow to have pricing tables, to embed on your website with a async scrypt that you can copy paste
      • Stripe API is crazy cool - YOu can get info about sessions, customers (which product/ subscription have they bought, if its on trial, active…)
    • Keeping the prompts tidy & consistent
    • And Streamlit can be customized in cool ways with option menu and bootstrap icons
    • And improvement the way I build my docker-compose with API keys
    • Oh, and even gitlab CI/CD testing!
      • You can see their status at the jobs tab
    • Better sqlite logs to see who actually uses it
Exploring SQLite content 📌

I made similar thing Check whats in there

sqlite3 ./login_log.db
#.tables

SELECT * FROM login_logs;
SELECT * FROM job_offers ORDER BY timestamp DESC LIMIT 5;
#.quit
python3 query_pracuj_sqlite_v3b.py
  • Better vacation planning

Web Stuff

What happened with the Bmax B4?

I decided to give it to a friend.

Reason being that I wanted an upgrade in computing power from my previous Desktop with a 2200G.

BMax B4 vs Asrock X300 Size

BMaxB4 vs Asrock X300.
BMax-B4 Mini PC

BMaxB4 vs Asrock X300. Photo by JAlcocerT

BMax B4 vs Asrock X300 Size
CV with a RPI4
Mini PC Setup

This is an image of a BMAX ASRock x300 used as a mini PC.

Benchmarks 101

Its always a good start to get ready for SelfHosting.

For Quick Benchmarks, just do:

curl -O https://raw.githubusercontent.com/JAlcocerT/Linux/main/Z_Linux_Installations_101/Benchmark101.sh
chmod +x Benchmark101.sh
./Benchmark101.sh
ℹ️
Other Benchmarks: SBC-Reviews / RPi-benchmark
Testing CPU Performance - SysBench, TripPlanner, build Astral-sh,…

Check CPU cores and test with sysbench:

#cat /proc/cpuinfo
#uname -a
#nproc
sudo apt install sysbench -y
sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run
  • Benchmark with 7zip:
sudo apt-get install p7zip-full
7z b -mmt
7z b -mmt4
7z b

and with 7zr:

7zr b -mmt1
git clone https://github.com/JAlcocerT/Py_Trip_Planner/
cd Py_Trip_Planner

sudo bash -c 'time docker pull python:3.8' #let's remove the time of downloading the Python base image from the equation, it was ~1 min!

#docker build -t pytripplanner .
sudo bash -c 'time docker build --no-cache -t pytripplanner .'
#sudo bash -c 'time podman build -t pytripplanner .'
  • Astral-sh Python Dependency Manager:
apt install cargo
#cargo install --git https://github.com/astral-sh/rye rye
time cargo install --git https://github.com/astral-sh/rye rye
  • Just simple stress test:
sudo apt-get install stress-ng

sudo stress --cpu  8 --timeout 120
Testing Internet Connectivity 📌
ip addr show
hostname -I

#sudo apt-get install net-tools
#ifconfig

ping -c 4 192.168.0.1 #gateway
ping -c 4 192.168.0.117 #ping the orange pi which is connected to same device
ping 9.9.9.9 #ping quad9 dns server
sudo apt-get install dnsutils -y #dns resolution
nslookup github.com 
dig google.com

Test the connectivity speed with:

sudo apt-get install speedtest-cli
speedtest-cli #speedtest-cli --simple

#sudo apt install snapd -y
sudo snap install fast
fast
curl -sS https://ipinfo.io/json #the command to use
curl -sS http://ip-api.com/json/ #provides info about country, ISP, ...
curl -6 ifconfig.me #ipv6 info 

Hardware Table Comparison

Hardware / Computing Power / Volume / Energy Consumption

Here’s a consolidated version of the data from all the tables into a single table. The columns are organized to combine all the relevant information:

DeviceCPUPriceSysbench (4 threads) (events)Tot (4 threads) 7 zip (events)Docker Build (s)Build Astral (Time)Docker Build (s/Price)CPU Benchmark (4 threads) (events/Price)Tot (4 threads) 7 zip (events/Price)
Raspberry Pi 4 2GBBroadcom BCM2711 Quad-core (4x ARM Cortex-A72)$35~1.7k1622/6311~3672s10min 7s12852048.5746.34
Raspberry Pi 4 4GBBroadcom BCM2711 Quad-core (4x ARM Cortex-A72)$55~28k1442/5508~3480s-191400509.0926.49
Orange Pi 5Rockchip RK3588S (4x Cortex-A76 + 4x Cortex-A55)$150~38k2.7k/11.8k~1777s5min 20s266550253.3318.00
Raspberry Pi 5 8GB---2.7k/10k-4min 30s---
BMAX B4 (16 GB)Intel N95 (x4 cores Alder-Lake)$150~26.9k~4.2k/15.34k~45s-6750179.3328.00
FireBat AK2 Plus (8 GB)Intel N100 (x4 cores Alder-Lake)$75~35k~1.8k/6.4k~47s2min 45s3525466.6724.00
AMD 2200g--~26.9k~4.2k/15.34k-----
AMD 5600G---------
Hetzner-----6min 15s---

Hetzner CX22 Cloud Server ~2.35 eur +23% VAT ~3$/month

Explanation:

  • Device: The name of the device.
  • CPU: The CPU specifications of the device.
  • Price: The price of the device in USD.
  • Sysbench (4 threads) (events): The results from the sysbench CPU test for 4 threads, in events.
  • Tot (4 threads) 7 zip (events): The results from the 7zip benchmark for 4 threads (compression and decompression speeds).
  • Docker Build (s): The time it takes to build the Docker image (in seconds).
  • Build Astral (Time): The time it takes to install or build the Astral dependency manager.
  • Docker Build (s/Price): The ratio of Docker build time in seconds to the price of the device.
  • CPU Benchmark (4 threads) (events/Price): The ratio of the CPU benchmark events to the price of the device.
  • Tot (4 threads) 7 zip (events/Price): The ratio of 7zip benchmark events to the price of the device.

This table combines the information across all your tests, and it should give you a comprehensive overview of the devices, their performance, and their costs.

DeviceSysbench (4 threads)Sysbench (8 threads)Tot (4 threads) 7 zipDocker BuildMax TempPeak Temp (Docker Build)Avg Temp (Docker Build)Idle PowerMax (Power & Temp Seen)Power AdapterYearly 🔌 Cost (USD)Release DateCPU Benchmark (4 threads)CPU Benchmark (8 threads)Build Time (Astral-SH)
Raspberry Pi 4 2GB~1.7k events-1622/6311~3672s-~46°C~39°C~2/3w6W5V 3A~$5June 2019~1.7k events-10min 7s
Raspberry Pi 4 4GB~28k events-1442/5508~3480s---~2/3w6W5V 3A~$5June 2019~28k events-10min 7s
Orange Pi 5~38k events~50k events2.7k/11.8k~1777s80°C~65°C~50°C~3/5w8W, 80°C5V 4A~$8November 2022~38k events~50k events5min 20s
BMAX B4---~45 seconds64°C fan--9W18W & 64°C, fan-~$14----
FireBat AK2 Plus~35k events-~1.8k/6.4k~3525s--------~46052.63 events--
FireBat AK2 Plus N100---~47s64°C-------~46052.63 events-2min 45s
Raspberry Pi 5 8GB--2.7k/10k-----------4min 30s
AMD 2200g~26.9k events-~4.2k/15.34k---------~44225 events--
AMD 5850U (AMD Ryzen 7)~72k events~121k events---------Jan 2021~72k events~121k events-
AMD 5600G (AMD Ryzen 5)~79k events~123k events (12 threads ~130k)~6.1k/24.1k (7zip)--------April 2021~79k events~123k events-

Now, the large table includes:

  • Sysbench performance (4 and 8 threads)
  • 7zip performance (Tot 4 threads)
  • Docker build times and temperatures
  • Idle power consumption, max power usage, and yearly cost
  • Release dates for devices
  • CPU benchmark results (4 and 8 threads)
  • Build time for Astral-SH

This provides a comprehensive view of all the devices’ performance and specifications in one table.

Desktop with VPS as VPN with Wireguard

Time to combine a Desktop, like the X300 + Hetzner to get a custom VPN connection with Wireguard.

Use the Hetzner Setup Script or the SelfHosting Script as described here

Server Setup

I am spinning a Hetzner (Cloud) Server. Like the one Benchmarked on this post.

Then, with this Wireguard Server DockerCompose

Connect via SSH & Setup WireGuard📌
ssh root@serverip #or use a terminal via

Lets do it with wgeasy, or if you prefer with plane WireGuard

#create the hashed PWD
docker run --rm -it ghcr.io/wg-easy/wg-easy wgpw 'YOUR_PASSWORD'

docker run --rm -it ghcr.io/wg-easy/wg-easy wgpw 'YOUR_PASSWORD' | sed 's/\$/\$\$/g'
⚠️
  • Don’t wrap the generated hash password in single quotes when you use docker-compose.yml. Instead, replace each $ symbol with two $$ symbols. Example

  • You’ll get different results (for the same given pass) because the hash is salted

</div>
version: "3.8"  # Specify Docker Compose version (optional)

services:
  wg-easy:
    image: ghcr.io/wg-easy/wg-easy
    container_name: wg-easy
    environment:
      LANG: en  # Set the language for the web UI
      WG_HOST: 188.245.198.60  # Replace with your actual server IP
      PASSWORD_HASH: thisishashed!  # Replace with your generated password hash
      PORT: 51821  # Web UI port
      WG_PORT: 51820  # WireGuard UDP port
    volumes:
      - "/home/your_user/.wg-easy:/etc/wireguard"  # Mount local configuration directory (replace with absolute path)
    ports:
      - "51820:51820/udp"  # Publish WireGuard UDP port
      - "51821:51821/tcp"  # Publish Web UI port
    cap_add:
      - NET_ADMIN  # Grant network administration capabilities
      - SYS_MODULE  # Grant access to load kernel modules (potentially risky)
    sysctls:
      net.ipv4.conf.all.src_valid_mark: "1"  # Enable source address validation
      net.ipv4.ip_forward: "1"  # Enable IP forwarding
    restart: unless-stopped  # Restart container if it crashes

# Optional Networks (if needed)
# networks:
#   wg_network:
#     driver: bridge  # Define a bridge network (optional)
curl -sS https://ipinfo.io/json #the command to use
#  "org": "AS24940 Hetzner Online GmbH",

Wireguard Setup

Check that the Wireguard Connection works 📌

Connecting the Wireguard Client

Setup a regular Wireguard Client in Windows / Linux.

Also on Android.

Or use Gluetun as Client.

Check the Desktop IP 📌

[Optional] - Setup Wifi2ETH Bridge

You can do this steps with a Raspberry Pi (connected to WIFI) as Wireguard client.

Which will then provide VPN access to your desktop via the Ethernet cable.

Wifi2Eth Post1 and Post2

Details 📌

FAQ

Other Cloud Resources 📌
OS Inside Containers: RPi emulator / Windows / macOS 📌
  1. A raspberry Pi inside a container - https://github.com/ptrsr/pi-ci

A Raspberry Pi emulator in a Docker image that lets developers easily prepare and flash RPi configurations.

  1. Thanks to the Dockur Project and by using the Image

Use Windows inside Docker with:

version: '3.3'

services:
  windows:
    image: dockurr/windows
    container_name: windows
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - "8006:8006" #UI
      - "3389:3389/tcp"
      - "3389:3389/udp"
    stop_grace_period: 2m
    restart: on-failure
    volumes:
      - ./data:/storage
    environment:
      RAM_SIZE: 8GB
      CPU_CORES: 3
      DISK_SIZE: 75GB
      VERSION: "win10"
Keeping GIT tidy 📌
git add .
git commit -m "some good msg"
git push

Outro

Using HuggingFace for LLMs

How I Edited this video

  • Video was recorded with a Huawei P30 and Iphone 15Pro - Back in ~Apr2024
  • I Have silenced it as learn with the DJI Workflow
ℹ️
The videos were filmed Spring this year, just put them together now