Tuesday, December 22, 2020

[Solved] Proxmox 6.3 DHCP Error on Huawei RH2288 V3 Servers: No Working Lease in Persistent Database

When booting the Proxmox VE 6.x installer on enterprise Huawei FusionServer RH2288 V3 rack servers, the graphical installation aborts and drops into a debug shell with the error: No working lease in persistent database.

Root Cause: Kernel framebuffer conflict with Huawei integrated server graphics (BMC) and IOMMU initialization.

Step-by-Step Resolution

  1. At the Proxmox GRUB boot menu, press e to edit the boot entry.
  2. Locate the linux kernel line and append the following kernel parameters:
    modprobe.blacklist=nouveau amd_iommu=on video=efifb:off
  3. Press Ctrl+X or F10 to boot.

Assigning Static IP in Debug Shell (If DHCP is Unavailable)

If your datacenter environment does not offer DHCP on the management network, configure network parameters directly in the debug prompt:

ip addr add 192.168.1.50/24 dev enp2s0f0
ip route add default via 192.168.1.1 dev enp2s0f0
echo "nameserver 1.1.1.1" > /etc/resolv.conf

How to Install Matching Linux Kernel Headers on Sangoma OS (FreePBX Distro)

When running the FreePBX Sangoma OS distro inside a VirtualBox virtual machine, installing VirtualBox Guest Additions fails with "Kernel headers not found for target kernel" even after installing kernel-devel and kernel-headers via yum.

Root Cause: In FreePBX Sangoma OS installations, the build directory symlink /lib/modules/$(uname -r)/build is missing from the active kernel directory.

The 1-Line Fix

Create the missing build symlink pointing to the kernel source directory:

# 1. Install development packages
yum install dkms gcc kernel-devel kernel-headers -y

# 2. Fix the missing module build symlink
ln -s /usr/src/kernels/$(uname -r) /lib/modules/$(uname -r)/build

# 3. Mount and build Guest Additions
mount /dev/cdrom /media/cdrom
cd /media/cdrom
./VBoxLinuxAdditions.run

The kernel module compilation will complete cleanly, enabling dynamic display resizing and shared folders.

Tuesday, December 15, 2020

How to Compile and Install the Latest Tesseract OCR 4/5 on Debian 11 (Bullseye)

Tesseract OCR is Google's optical character recognition engine. Compiling the latest upstream release directly on Debian 11 ensures access to LSTM neural network model improvements and enhanced UTF-8 language model accuracy.

Prerequisites: Leptonica image processing library • Autotools • C++17 compiler

Build and Installation Commands

# 1. Install build headers and Leptonica
sudo apt-get update
sudo apt-get install g++ autoconf automake libtool pkg-config   libpng-dev libjpeg62-turbo-dev libtiff5-dev zlib1g-dev libleptonica-dev -y

# 2. Download and compile Tesseract
VERSION="4.1.1" # Or latest 5.x release
cd /usr/src
wget https://github.com/tesseract-ocr/tesseract/archive/${VERSION}.tar.gz
tar -zxf ${VERSION}.tar.gz
cd tesseract-${VERSION}

./autogen.sh
./configure --prefix=/usr/local
make -j$(nproc)
sudo make install
sudo ldconfig

# 3. Download traineddata language models (e.g., English and Persian/Arabic)
cd /usr/local/share/tessdata
sudo wget https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata
sudo wget https://github.com/tesseract-ocr/tessdata_fast/raw/main/fas.traineddata

Sunday, December 13, 2020

Connecting USB GSM / 3G / 4G Dongles to Raspberry Pi 4 (Huawei E303, usb-modeswitch, and Gammu)

USB cellular modems (such as the ubiquitous Huawei E303, E173, and E3372) enable Raspberry Pi 4 projects to send SMS notifications, handle emergency alerts, and provide cellular backup connectivity. However, modern USB modems initially boot into a virtual CD-ROM storage mode (ZeroCD) to deliver Windows drivers, requiring usb-modeswitch to toggle them into serial modem mode.

Hardware: Raspberry Pi 4 • Huawei E303 USB Dongle • usb-modeswitch • Gammu SMS Gateway

1. Installing usb-modeswitch and Gammu

sudo apt-get update
sudo apt-get install usb-modeswitch usb-modeswitch-data gammu minicom -y

2. Switching from Mass Storage to Modem Mode

Check lsusb to identify your device vendor and product ID:

# Example: ID 12d1:1f01 (Mass Storage Mode)
lsusb | grep Huawei

# Mode-switch into serial modem mode (12d1:1001 or 12d1:14db):
sudo usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000011062000000100000000000000000000'

Confirm the modem serial nodes are created under /dev/ttyUSB0, /dev/ttyUSB1, and /dev/ttyUSB2.

3. Sending a Test SMS via Gammu

Configure ~/.gammurc:

[gammu]
port = /dev/ttyUSB0
connection = at115200

Send an automated test message:

echo "Alert: Raspberry Pi online!" | gammu sendsms TEXT +1234567890

Monday, November 23, 2020

How to Install and Configure Munin Monitoring with Nginx and CGI on CentOS 8

Setting up Munin on CentOS 8 via EPEL 8 provides turnkey server performance graphs. This guide walks through configuring systemd timer units, fastcgi spawners for dynamic graph generation, and integrating the dashboard into an Nginx virtual host.

Packages: munin • munin-node • munin-cgi • spawn-fcgi

1. Installing Packages from EPEL 8

dnf install epel-release -y
dnf install munin munin-cgi munin-node spawn-fcgi nginx -y

2. Enabling Node and Systemd Services

systemctl enable --now munin-node
systemctl enable --now munin-cgi-graph.socket
systemctl enable --now munin-cgi-html.socket

3. Nginx Server Block (/etc/nginx/conf.d/munin.conf)

server {
    listen 80;
    server_name munin.example.com;

    location / {
        root /var/www/html/munin;
        index index.html;
    }

    location ^~ /munin-cgi/munin-cgi-graph/ {
        fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*);
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass unix:/run/munin/fcgi-graph.sock;
        include fastcgi_params;
    }
}

Tuesday, September 22, 2020

How to Deploy BigBlueButton Web Conferencing on CentOS 8 with Docker

BigBlueButton (BBB) is the leading open-source virtual classroom and web conferencing system. While upstream BBB exclusively provides automated installer scripts for Ubuntu LTS, organizations standardized on Enterprise Linux (CentOS 8 / RHEL 8) can deploy BigBlueButton components cleanly using Docker containers.

Stack: CentOS 8 • Docker CE • BigBlueButton Docker Compose • Nginx TLS Reverse Proxy

1. Installing Docker CE on CentOS 8

dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install docker-ce docker-ce-cli containerd.io -y
systemctl enable --now docker

2. Deploying BigBlueButton via Docker Compose

git clone https://github.com/bigbluebutton/docker.git bbb-docker
cd bbb-docker
cp .env.example .env

# Configure your FQDN and Let's Encrypt email in .env
./scripts/generate-api-secrets.sh
docker-compose up -d

Thursday, July 9, 2020

How to Install and Configure Icecast 2 Streaming Audio Server on CentOS 8

Icecast is a high-performance, open-source streaming media audio server capable of broadcasting MP3, Ogg Vorbis, and Opus audio streams. Because prebuilt Icecast packages were initially omitted from CentOS 8 and EPEL 8 repositories, compiling from source with Vorbis and Theora audio support is required.

Environment: CentOS 8 / RHEL 8 • Icecast 2.4.x • Ogg / Vorbis / Theora Codecs

1. Install Build Tools and Codec Dependencies

yum groupinstall "Development Tools" -y
yum install curl-devel libtheora-devel libvorbis-devel libxslt-devel speex-devel libshout-devel -y

2. Download and Build Icecast

cd /usr/src
wget http://downloads.xiph.org/releases/icecast/icecast-2.4.4.tar.gz
tar -zxf icecast-2.4.4.tar.gz
cd icecast-2.4.4

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make && make install

3. Create Service User and Start Daemon

useradd -r -s /sbin/nologin icecast
chown -R icecast:icecast /var/log/icecast

# Launch Icecast as a background daemon
icecast -b -c /etc/icecast.xml

Wednesday, July 8, 2020

How to Rebuild Apache httpd to Change suexec AP_DOC_ROOT from /var/www to /home (CentOS & RHEL)

Standard RPM packages of Apache httpd in CentOS and RHEL compile suexec with a hardcoded document root of /var/www (--with-suexec-docroot=/var/www). However, web control panels like Virtualmin host customer accounts under /home. When suexec executes a user script under /home, it aborts with "command not in docroot". Here is how to rebuild the official upstream httpd SRPM with AP_DOC_ROOT set to /home.

Compilation Flag: --with-suexec-docroot=/home

Rebuilding the RPM

# 1. Install build tools and dependencies
yum install rpm-build redhat-rpm-config gcc make -y
yum-builddep httpd -y

# 2. Download and unpack httpd SRPM
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
cd ~/rpmbuild/SRPMS
yumdownloader --source httpd
rpm -ivh httpd-*.src.rpm

# 3. Edit SPECS/httpd.spec and modify suexec docroot
cd ~/rpmbuild/SPECS
sed -i 's|--with-suexec-docroot=/var/www|--with-suexec-docroot=/home|g' httpd.spec

# 4. Rebuild binary RPM
rpmbuild -bb httpd.spec

# 5. Install the custom suexec binary
rpm -Uvh --force ~/rpmbuild/RPMS/x86_64/httpd-*.rpm

Confirm the new docroot:

suexec -V | grep AP_DOC_ROOT

Monday, June 22, 2020

[Solved] Fixing Apache suexec and mod_fcgid: Error Reading Data from FastCGI Server

When running PHP applications under Apache using mod_fcgid combined with suexec privilege separation, web requests may suddenly abort with HTTP 500 Internal Server Errors and the following message in Apache error logs:

Error Message: End of script output before headers: php.fcgi • mod_fcgid: error reading data from FastCGI server

Root Cause

suexec enforces strict security checks on the FastCGI wrapper script and user directory:

  1. The wrapper script and parent directories must be owned exclusively by the virtual server user and group—not root or apache.
  2. File permissions cannot be group-writeable (chmod 755 is required, 775 or 777 causes instant suexec rejection).
  3. The target script must reside strictly inside the compiled suexec document root (e.g. /home/user/public_html).

Resolution Steps

Inspect /var/log/httpd/suexec.log to reveal the exact permission violation, and enforce correct ownership:

# Fix permissions and ownership
chown -R user:user /home/user/fcgi-bin /home/user/public_html
chmod 755 /home/user/fcgi-bin/php.fcgi
chmod 755 /home/user/public_html

Wednesday, June 3, 2020

How to Install Virtualmin with Multiple PHP and MySQL Versions on CentOS 8

Deploying a production web hosting stack on CentOS 8 with Virtualmin requires modern multi-PHP support (allowing legacy applications to run PHP 5.6 or 7.2 while modern apps run PHP 7.4 or 8.0) and reliable database server management via Remi repositories.

Stack: CentOS 8 • Virtualmin 6.x • Remi Software Collections (SCL) • MySQL 8.0 • Multi-PHP

1. Fix Perl UTF-8 Locale Warnings

cat << 'EOF' > /etc/environment
LANGUAGE=en_US.utf8
LC_ALL=en_US.utf-8
LANG=en_US.utf8
LC_TYPE=en_US.utf8
EOF

2. Enable EPEL and Remi Repositories

dnf install epel-release -y
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
dnf module reset php -y
dnf module enable php:remi-7.4 -y

3. Installing Parallel PHP Versions

dnf install php56-php-fpm php72-php-fpm php74-php-fpm php80-php-fpm -y

4. Install Virtualmin

wget http://software.virtualmin.com/gpl/scripts/install.sh
sh install.sh

Friday, May 29, 2020

How to Forward Public IP Traffic to a WireGuard Client Behind NAT While Preserving Client IPs

When exposing a local server located behind a residential CGNAT (Carrier-Grade NAT) to the public internet using a cloud VPS as a front-end gateway, standard DNAT/MASQUERADE setups rewrite incoming packets with the WireGuard gateway's internal IP. This destroys client IP visibility, making rate-limiting, geo-blocking, and security auditing impossible. Here is how to configure policy-based routing and iptables PREROUTING to preserve the original client IP all the way to your backend application.

Architecture: Public Client (IP: X) → Cloud VPS (Public IP: Y) → WireGuard Tunnel → Home Server Behind NAT (Sees Real Client IP: X)

1. Cloud VPS Gateway Configuration

On the cloud VPS, forward external ports directly through the WireGuard interface (wg0) without applying SNAT/MASQUERADE to the incoming packets:

# Enable IP forwarding
sysctl -w net.ipv4.ip_forward=1

# Forward HTTP port 80 to WireGuard client (10.200.200.2)
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.200.200.2:80
iptables -A FORWARD -p tcp -d 10.200.200.2 --dport 80 -j ACCEPT

2. Home Server Policy Routing (The Secret to Preserving IPs)

Because the incoming packet preserves the public client IP, the home server's reply would normally route through its default residential gateway rather than returning via the WireGuard tunnel (causing asymmetric routing drop). Resolve this using Linux policy routing:

# 1. Create a custom routing table
echo "200 custom_vpn" >> /etc/iproute2/rt_tables

# 2. Route responses to traffic arriving on wg0 back through wg0
ip rule add from 10.200.200.2 table custom_vpn
ip route add default via 10.200.200.1 dev wg0 table custom_vpn

Now your backend web application logs the true public client IP address for every visitor!

Thursday, April 16, 2020

How to Access Native SIP / VoIP Account Settings Across Different Android Versions

Many Android releases include a built-in native SIP client directly integrated into the system Dialer application, allowing users to make and receive VoIP calls over Wi-Fi and mobile data without installing third-party battery-draining apps. However, OEM custom skins (Samsung, Huawei, Asus, Xiaomi) frequently relocate the configuration menu.

Native SIP Client Path Reference by Android OS Version
  • Android 4.2.2 (Jelly Bean):
    Dialer App → Menu → Settings → Internet Call → Accounts
  • Android 5.0 / 5.1 (Lollipop):
    Phone App → Settings → Call Settings → Phone Account Settings → SIP Accounts
  • Android 6.0 (Marshmallow) & 7.0 (Nougat):
    Phone App → Three Dots Menu → Settings → Calling Accounts → SIP Accounts
  • Android 8.0 (Oreo) through Android 11:
    Phone App → Settings → Calls → Calling Accounts → SIP Accounts → Add (+)

Note: In Android 12 and newer, Google deprecated the legacy built-in SIP stack. For modern Android releases, standard standalone clients like Linphone, Grandstream Wave, or MizuDroid are recommended.

Wednesday, April 15, 2020

How to Configure VoIP SIP Settings on GreenPacket DT-350 4G Routers

The GreenPacket DT-350 TD-LTE indoor router includes an integrated hardware VoIP FXS port (RJ-11) for connecting analog telephone handsets directly to SIP servers (such as Asterisk, FreePBX, or telecom IMS gateways). However, on many telecom-branded firmwares (such as Irancell), the VoIP menu is hidden from standard administrative accounts.

Hardware: GreenPacket DT-350 TD-LTE Router • RJ-11 POTS Handset • SIP Protocol

1. Accessing Hidden VoIP Menus

Log in with the root/operator credentials (or inspect the web GUI source to reveal hidden navigation items under /voip_settings.html or /sip.html).

2. SIP Account Configuration

SIP Proxy / Registrar: YOUR.PBX.SERVER.IP
Port: 5060
SIP Transport: UDP
Outbound Proxy: (Optional, set if behind telecom NAT)
Account / Display Name: 101
Authentication Username: 101
Secret / Password: YOUR_SIP_SECRET
Codec Priority: G.711u (PCMU), G.711a (PCMA), G.729

Save and apply settings. Once registered, the Phone LED on the router faceplate illuminates solid green, and connected analog handsets will receive dial tone.

Sunday, March 29, 2020

Fixing Lantronix Spider KVM Java Security Errors: Using the Native Standalone Client

When accessing remote datacenter servers via Lantronix Spider KVM-over-IP devices, modern Java Runtime Environments (Java 7, 8, and newer) block the JNLP applet with strict security exceptions like "unsigned application requesting unrestricted access to system". Adjusting Java deployment security rules and exception lists frequently fails.

Solution: Replace browser-based Java Web Start with Lantronix's official SpiderControl native standalone client.

Direct Native Client Download

Lantronix provides native standalone binaries that connect directly to the Spider KVM without requiring Java or browser plugins:

  • Download the official SpiderControl standalone application for Windows, Linux, or macOS from Lantronix support.
  • Launch the client, enter the Spider's IP address, username, and password.
  • The native client supports virtual media mounting (ISO redirection), low-latency mouse synchronization, and native resolution scaling without certificate validation errors.

Sunday, March 1, 2020

How to Install XFCE Desktop and RealVNC Server on CentOS 7

XFCE is a lightweight, responsive desktop environment ideal for remote graphical management on headless CentOS 7 servers without consuming excessive RAM. However, launching an XFCE session inside RealVNC Server (vncserver-virtual) on CentOS 7 often fails or displays a blank screen because default Xsession startup scripts target GNOME.

Environment: CentOS 7 • XFCE Desktop • RealVNC Server

1. Installing XFCE and RealVNC

yum groupinstall "Xfce" -y
yum install tigervnc-server -y # Or install RealVNC Server RPM

2. Configuring the VNC Virtual Session (/etc/vnc/xstartup.custom)

To ensure RealVNC launches the XFCE desktop environment properly, create or edit /etc/vnc/xstartup.custom:

#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
startxfce4 &

Make the script executable and launch the VNC virtual display:

chmod +x /etc/vnc/xstartup.custom
vncserver-virtual :1

How Google Antigravity Solved the Mysterious NVIDIA Sleep Reboot on My Dell Inspiron 7567 (Ubuntu Linux)

If you run modern Ubuntu or Linux on a Dell Inspiron 15 Gaming (7567) or a similar 7th-gen Intel laptop paired with an NVIDIA GeForce GTX ...