AKZN Notes

Archives for My Lazy and Forgetful Mind

Category: IT Stuff

Fix EPrints 3.4.7 cgi HTTPS Redirect Loop (Certbot + Apache)

Fix: EPrints 3.4.7 /cgi HTTPS Redirect Loop (Certbot + Apache) Problem When enabling HTTPS using Certbot, EPrints /cgi endpoints (e.g. /cgi/users/login) return: 302 → same URL (infinite redirect) Main site works, but only /cgi loops. Root Cause Certbot generates its own SSL vhost: /opt/eprints3/cfg/apache/{repoid}-le-ssl.conf However, it omits required EPrints directives, specifically: PerlSetVar EPrints_Secure yes Without […]

Manual Rsync Backup from VPS to Local (with Exclusions)

Rsync Backup from VPS to Local (with Exclusions) Command rsync -avz -e "ssh -p 2222" \ –exclude='node_modules' \ –exclude='vendor' \ –exclude='.env' \ user@vps:/path/app/ /home/youruser/backup/app/ Explanation Basic flags -a → archive mode (preserve permissions, symlinks, etc.) -v → verbose (show progress) -z → compress during transfer (faster over network) -e "ssh -p 2222" → use SSH […]

VPS First-Time Setup

VPS First-Time Setup Assume: New SSH port = 2222 Ubuntu VPS 1. Initial Login ssh root@YOUR_VPS_IP apt update && apt upgrade -y reboot Reconnect after reboot. 2. Create Non-Root User adduser youruser usermod -aG sudo youruser 3. Setup SSH Key (Recommended) From local machine: ssh-keygen ssh-copy-id youruser@YOUR_VPS_IP Test login: ssh youruser@YOUR_VPS_IP Disable root SSH login […]

Setting Persistent IPv4 DNS for Ubuntu 20.xx

Prefer IPv4 for DNS & Connections on Ubuntu (Keep IPv6 Enabled) On Ubuntu 20.04+, systemd-resolved and the network stack prefer IPv6 when it’s available. Even if you set IPv4 DNS, connections may still use IPv6 (AAAA records). This guide keeps IPv6 enabled, but makes Ubuntu prefer IPv4 for DNS and connections. 🎯 Goal Keep IPv6 […]

Fixing Expo + npm ERR_INVALID_URL and Permission Issues on WSL

Fixing Expo + npm ERR_INVALID_URL and Permission Issues on WSL Problem Summary When running Expo inside WSL, npm errors appear such as: ERR_INVALID_URL expo: Permission denied Cause: Windows Node/NPM is being used inside WSL, and Windows-mounted paths block Linux permissions. Fix Instructions 1. Use WSL Terminal Open your Linux shell (Ubuntu app) instead of PowerShell/CMD. […]

Running Qwen Code in a Sidecar Docker Container

Running Qwen Code in a Sidecar Docker Container 1. Why Sidecar? Instead of installing Qwen Code on your host, you can run it in its own container. Keeps API keys out of your project repo. Only shares your project folder via a bind mount. Works across different projects. 2. Dockerfile Create a Dockerfile for Qwen […]

Batch resize image on windows 11 using powershell

This script below work as resize all image with jpg, jpeg, JPG, JPEG extension inside folder and subfolder save the result into ‘web’ folder at same folder as this script make file with ps1 extension Add-Type -AssemblyName System.Drawing $w = 300 $h = 400 $quality = 70 # JPEG quality 0–100 $root = Get-Location $outDir […]

iPerf3 on Windows 11 with Docker

# iPerf3 on Windows 11 with Docker This guide explains how to install Docker Desktop on Windows 11, run iPerf3 for network performance testing, and use a single .bat script for quick local, remote, and dual-direction tests. — ## 1. Install Docker Desktop 1. Download Docker Desktop: – [https://www.docker.com/products/docker-desktop/](https://www.docker.com/products/docker-desktop/) 2. Install it with **WSL 2 […]

How to Remove a Specific Command from PowerShell History in VS Code

How to Remove a Specific Command from PowerShell History in VS Code If you accidentally typed a password or sensitive command in the VS Code terminal using PowerShell, and you want to remove only that specific command from history, follow these steps: 📂 Step-by-Step Instructions Close the VS Code terminal to prevent file locking. Open […]

Upgrade Mysql / MariaDB version 10.1.xx to 10.6.xx on XAMPP Windows

To upgrade MariaDB in XAMPP, follow these steps carefully: 🔄 Replace MariaDB in XAMPP with a New Version ✅ 1. Backup your data Copy: \xampp\mysql\data → \xampp\mysql_backup\data Or export all DBs via phpMyAdmin. ✅ 2. Download MariaDB (ZIP version) Go to: https://downloads.mariadb.org/ Choose version 10.6 or later. Select Windows ZIP Archive, e.g.: mariadb-10.6.16-winx64.zip ✅ 3. […]