Waseem Rahmani http://waseem.test Solutions Architect @ Teqnius Tue, 28 Jan 2025 05:49:18 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 http://waseem.test/wp-content/uploads/2025/01/DSC03535_1-edited-1-150x150.jpg Waseem Rahmani http://waseem.test 32 32 A No-Budget Solution to Hosting WordPress Sites http://waseem.test/2025/01/24/132/ Fri, 24 Jan 2025 06:17:19 +0000 http://waseem.test/?p=132 Recently, I came across an interesting tweet from Joost de Valk, a well-known figure in the WordPress community. He posed a simple question:

This reminded me of the times we used this solution to host websites for some of my friends and clients who didn’t have a budget for hosting. I wanted to share my approach for anyone in a similar situation.

I will not be going into the depths of implementation here. Instead, I’ll simply outline the process, keeping it brief and focused. This is your quick roadmap to hosting WordPress without spending a penny.

Two Simple Solutions

For students or developers on a budget, I’ve found two effective approaches:

  1. Static WordPress Hosting – Perfect for small websites or personal blogs that don’t require dynamic features like comments or user logins.
  2. Temporary Full WordPress Hosting – Great for when you need the full WordPress experience, for a short-term project.

Let’s break these down into simple steps.

Static WordPress Hosting

Here’s how you can set up a static version of WordPress for free:

  1. Use tools like Laragon or Local by Flywheel to create a local WordPress environment.
  2. Convert your local WordPress site into static HTML using tools like wget or httrack.
  3. Use Git to upload your static files to a repository on platforms like GitHub.
  4. Connect your Git repository to Vercel and deploy your static site. If you have a custom domain, you can configure it here.

While this method is incredibly cost-effective, it’s important to note a few caveats and cautions:

  • Static sites don’t support comments, user logins, or other dynamic WordPress functionalities.
  • You may face challenges with SEO, such as issues with permalinks or sitemaps.
  • Many WordPress plugins won’t work as they rely on server-side processing.
  • This is best suited for personal blogs, portfolios, or informational sites where interactivity isn’t required.
  • Each update to the site requires regenerating and redeploying the static files.

Temporary Hosting Solution – Full WordPress Experience

If you need the full WordPress experience for a short time, here’s an alternative:

  1. Platforms like Digital Ocean, AWS, Google Cloud, and Azure offer free credits or trials.
  2. Use their one-click install options to set up WordPress on a virtual machine.
  3. Configure your site as needed and enjoy the full functionality of WordPress.

Caveats and cautions to keep in mind:

  • Free trials are time-limited and may require you to enter credit card details.
  • Improper server setup can cause issues with permalinks, site accessibility and security.
  • Cloud instances have limited resources, so it’s crucial to monitor usage.
  • Forgetting to cancel the trial or exceeding free-tier limits could lead to charges.

]]>
AI for Handwritten Order Data Processing http://waseem.test/2025/01/07/ai-powered-handwritten-data-entry-a-case-study-in-wholesale-distribution/ Tue, 07 Jan 2025 15:47:00 +0000 http://waseem.test/?p=101 In today’s fast-paced business environment, speed, efficiency and accuracy are paramount to maintaining a competitive edge. This is particularly true in the traditional wholesale distribution industry (in India), where processing large volumes of handwritten orders can be both time-consuming and error-prone.

The Business Challenge

Samples of Handwritten Order Information Collected

As a solutions architect at Teqnius, my team and I had just begun working on the digital transformation of a client in the footwear distribution business when an urgent issue surfaced. Following a major sales event, they were overwhelmed with handwritten orders that needed immediate processing. These orders included:

  • Brand Name
  • Model Number
  • Colors
  • Sizes
  • Quantities

Manually processing this data presented several challenges including:

  • Different handwriting styles: Many were difficult to read and interpret accurately.
  • Lack of context awareness: Data entry operators who would need to be hired might not understand the nuances of the data.
  • Slow processing speed: Manual entry was too slow to meet the distributor’s urgent needs.
  • Error-prone processes: Mistakes in transcription could result in incorrect orders and delays.

With a competitor’s event and the festive season just around the corner, The client needed a fast, reliable solution that would help them analyze and process the orders.

The AI-Driven Solution

To tackle this challenge, we developed an AI-powered data entry solution using both Gemini 1.5 Pro and ChatGPT, training each model on the client’s dataset of brand names, colors, sizes, and model information extracted from their ERP system. While both models showed promise, Gemini 1.5 Pro emerged as the superior tool for this use case. A human-in-the-loop interface was also implemented for manual review and corrections. Here’s how the project unfolded:

AI Powered Workflow for Handwritten Order Data Extraction

1. Training the AI Models

We extracted a dataset from the client’s ERP system containing valid entries for brands, colors, sizes, and models.

Both ChatGPT and Gemini 1.5 Pro were trained on this dataset, enabling them to recognize domain-specific details and handle handwritten data effectively.

We evaluated each model’s accuracy and efficiency in extracting key data points. Gemini 1.5 Pro outperformed ChatGPT due to its advanced contextual understanding and superior accuracy in handling structured data.

2. Image Preprocessing

Handwritten orders were digitized using mobile photography. To address concerns about data leakage while using Large Language Models (LLMs), we anonymized sensitive information in the images before processing.

3. Handwritten Text Recognition (HTR)

We leveraged Gemini’s advanced handwriting recognition capabilities to convert handwritten text into machine-readable format with high accuracy.

4. Data Extraction and Human Review

Gemini’s superior training and advanced NLP capabilities enabled it to extract data fields like brand, color, size, and quantity with high accuracy.

A custom interface was designed to display the extracted data alongside the corresponding image of the handwritten order. Users could review the data, compare it with the image, and make corrections as needed.

This interface ensured that even edge cases—such as unclear handwriting or missing data—could be resolved efficiently.

5. Data Validation

The extracted data was validated against the ERP system’s master dataset, ensuring accuracy and consistency.

Any discrepancies or unrecognized entries flagged during the review were updated through the interface, maintaining high data integrity.

6. Export to Structured Format

The validated data was exported into structured formats like Excel and CSV for easy analysis and integration into inventory systems.

The final output seamlessly fed into the distributor’s sales and inventory management systems, accelerating their workflows.

Key Takeaways: Gemini vs. ChatGPT

While both models were trained on the same dataset, Gemini 1.5 Pro demonstrated significant advantages:

  1. Higher Accuracy: Gemini consistently delivered better results in recognizing handwritten data, especially for complex fields.
  2. Contextual Understanding: Its ability to understand the relationships between fields (e.g., brand and size ranges) reduced errors.
  3. Efficiency: Gemini required fewer iterations and less manual correction, making it the more time-effective solution.

Business Impact and Results

  1. Significant Time Savings: Tasks that previously required days of manual data entry were completed in hours, allowing the client to focus on sales and inventory planning.
  2. Improved Accuracy: The combination of AI and human review ensured consistently high accuracy in data extraction and validation.
  3. Competitive Advantage: By rapidly processing orders, the client maintained a competitive edge, meeting customer demand even as competitors vied for market share.

Why This Matters

This project underscores the value of combining AI and human oversight to optimize manual processes. The integration of a user-friendly review interface ensured high data quality while maintaining the speed and efficiency of automated systems. By leveraging AI tailored to their specific needs, businesses can optimize workflows, reduce costs, and improve decision-making—all while ensuring accuracy and trust in their data.

]]>
Distributed Resources for Network Simulation in GNS3 http://waseem.test/2023/10/27/distributed-resources-for-network-simulation-in-gns3/ Fri, 27 Oct 2023 06:30:00 +0000 http://waseem.test/?p=142 As a solutions architect, I constantly seek innovative ways to overcome resource limitations while delivering impactful results.

One particularly challenging yet enlightening experience came during my MSc. Data Science dissertation at London South Bank University. My project, titled Network Anomaly Detection in SD-WAN using Machine Learning, required robust computational resources to generate data and simulate complex network environments.

My Final Topology for Dataset Generation

Unfortunately, my local system—a standard gaming laptop—fell woefully short of these demands.

The university’s Systems Lab, while normally an excellent resource, was temporarily unavailable due to maintenance. Purchasing a high-performance workstation was financially impractical. Faced with these constraints, I embarked on a journey to creatively leverage available resources.

Finding the Solution

My research led me to an insightful video series by David Bombal, which highlighted the potential of combining local and cloud resources for running GNS3 simulations. This approach aligned perfectly with my project needs. However, one significant hurdle remained: the appliances I required, particularly Cisco SD-WAN, necessitated nested virtualization—a feature not supported by all cloud providers.

To address this, I devised a hybrid solution combining the computational power of:

  1. My Local Laptop: Acting as the primary control hub for running GNS3 and managing simulations.
  2. DigitalOcean Cloud Instance: Chosen for its support for nested virtualization, critical for running Cisco SD-WAN appliances effectively.
  3. A Dedicated Server: Generously provided by a friend, offering additional compute and memory capacity.
Architecture of My Extended GNS3 Setup

To interconnect these disparate resources, I implemented a VPN mesh using OpenVPN. This setup created a seamless network environment, enabling appliances hosted on different GNS3 VMs to communicate as though they were on the same local network. The architecture’s core components included VPN connectivity, distributed GNS3 instances, and optimized resource allocation based on the workload demands.

Pulling everything together, I managed to create a setup using local, cloud, and remote systems that supported my project needs.

Have you faced similar challenges? If so, I’d love to hear your solutions or explore how I could help you tackle them.

]]>
Installing OpenStack and Deploying an E-Commerce App [Tutorial] http://waseem.test/2023/01/12/installing-openstack-and-deploying-an-e-commerce-app-tutorial/ Thu, 12 Jan 2023 11:25:00 +0000 http://waseem.test/?p=162 OpenStack is a fantastic open-source tool for creating, managing, and scaling cloud services. In this guide, I’ll show you how to set up OpenStack on your local machine and use it to deploy an e-commerce application (WooCommerce). By following these steps, you’ll gain hands-on experience with virtualization, networking, and cloud hosting.

What You’ll Learn

Here’s what you’ll pick up along the way:

  • Setting up virtual machines.
  • Installing and configuring OpenStack.
  • Creating networks and managing IPs.
  • Deploying a LAMP-based application.

Step 1: Understand the Setup

We are going to achieve our setup using 3 layers comprising of a physical layer, and two layers of virtualization as shown in Figure 1.

Figure 1: Our Setup Architecture

Before we start, let’s break it down:

  1. Physical Layer: This is your host machine. I used a Lenovo Legion Y530 with 16 GB RAM, a 512 GB SSD, and an Intel i7 CPU. The host machine runs on runs on Windows 11 Pro operating system.
  2. Virtualization Layer 1 (L1): This layer hosts OpenStack. It’s configured with 8 GB RAM, 100 GB storage, and 4 CPU cores. The L1 layer runs on Ubuntu 2.04.1 LTS Desktop.
  3. Virtualization Layer 2 (L2): This runs the e-commerce app inside OpenStack. The L2 layer runs on an Ubuntu 20.04 LTS Server Cloud Instance.

Step 2: Setup the Physical Layer

OpenStack requires Linux and works especially well with Ubuntu. To run Ubuntu as a guest operating system (OS) on a Windows host machine, we require a hypervisor. We will use VMWare Workstation Pro for this tutorial, but you may also use VirtualBox.

Step 3: Setup Virtualization Layer 1 (L1)

To ensure optimal performance, we allocated resources to the Virtual Machine (VM) as follows: 8 GB of RAM, 100 GB of SSD storage, and 4 CPU cores. These specifications are designed to support efficient operation and handle the expected workload effectively. The VM’s configuration details can be seen in Figure 2 for reference.

Figure 2: L1 VM Details

Step 4: Setting Up Network Adapters for the L1 VM

Here’s how we configured the L1 VM:

  1. Two NAT Adapters: These were set up to provide internet connectivity and assign specific IP ranges to the L1 VM.
  2. One Bridged Adapter: This connects the VM to the physical network, allowing it to share the same IP address as the host machine. This setup enables smooth communication between the VM and other devices on the network.

Step 5: Installing Ubuntu on L1 VM and Configuring a Static IP

Next, we powered on the L1 VM and followed the Ubuntu installation wizard. After completing the setup, we logged in using the username and password we had set earlier.

By default, the L1 VM gets a new IP address with every reboot because of DHCP. To fix this, we ensured the VM had a consistent IP for accessing OpenStack:

  • We opened the Virtual Network Editor (VNE) in VMware (see Figure 3).
  • In the NAT network settings, we assigned an easy-to-remember subnet IP.
  • Then, we adjusted the DHCP range to 192.168.100.128 - 192.168.100.254, reserving 192.168.100.100 - 192.168.100.127 for static IPs.
Figure 3: L1 VM Network Settings

Finally, we used the Ubuntu interface to set a specific static IP for the L1 VM, ensuring consistent and reliable access to OpenStack. (See Figure 4)

Figure 4: Setting Static IP for L1 VM

We can verify the networking setup by pinging the IP 192.168.100.100 from Windows 11. If the ping is successful, it confirms that the network configuration is correctly in place, as shown in Figure 5.

Figure 5: Pinging from Physical Layer to L1 VM

With this step, all the groundwork for installing OpenStack on the L1 VM is complete.

Step 6: Install OpenStack on L1 VM

Before installing OpenStack on the L1 VM, I suggest you do a quick recap on the OpenStack Architecture and how things work together.

Now, since we have an idea of the components of OpenStack, we can dive into the installation part. To quickly set up an OpenStack environment, we use DevStack, a collection of scripts designed for this purpose. Here’s the step-by-step process to install OpenStack Zed using DevStack:

Update the Ubuntu packages on the L1 VM using the following commands:

$ sudo apt -y update
$ sudo apt -y upgrade

Git is essential for downloading the latest OpenStack version. Install it using:

$ sudo apt-get install git

DevStack requires a non-root user with sudo capabilities:

$ sudo useradd -s /bin/bash -d /opt/stack -m stack

This creates a user named stack, with a home directory at /opt/stack and a bash login shell.

Grant execution permission to the stack user’s home directory:

$ sudo chmod +x /opt/stack

Add the stack user to the sudoers list for passwordless sudo access:

$ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack

Switch to the stack user:

$ sudo -u stack -i

Clone the DevStack repository from the OpenDev platform:

$ git clone https://opendev.org/openstack/devstack
$ cd devstack

Before running the DevStack script, create a local.conf file to configure passwords. Use the following content for the file:

[[local|localrc]]
ADMIN_PASSWORD=Password123..
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

Note: The password is intentionally weak since this is not a production setup.

Start the installation by executing the DevStack script:

$ ./stack.sh

The installation process takes about 20-30 minutes. Once completed, the terminal will display URLs for services like Horizon, along with other OpenStack components as shown in Figure 6

Figure 6: OpenStack Installation Complete

You can log in to the OpenStack Horizon dashboard through your web browser on the Windows host (see Figure 7). Use the address displayed in Figure 6 to access it.

Figure 7: OpenStack Horizon Login Screen

Once logged in, you will see the Horizon dashboard interface and an overview of the system resources managed by the current OpenStack Installation , as illustrated in Figure 8.

Figure 8: OpenStack Horizon Dashboard

Step 7: Create Prerequisites for Instance Creation on OpenStack

To prepare for creating an instance to deploy the Ecommerce Application in OpenStack, follow these steps:

7.1 Create Users for the Project

  • Project Admin (Admin Role): Responsible for managing the project.
  • Project Member (Member Role): Responsible for creating instances and deploying the application.

Users can be created as shown in Figure 9. The Admin user can then create additional users, like project members, and configure their roles.

Figure 9: User Creation on OpenStack

7.2 Create a Project

A project, part of Keystone, organizes resources in OpenStack.

  • Use the Project Admin user to create a project (Figure 10).
  • Add the previously created users to this project.
Figure 10: Project Creation in OpenStack

7.3 Create Networking Configurations (Neutron)

7.3. a. Private Network

A private network ensures secure and isolated communication for instances. Create it as shown in Figure 11:

  • Set a network name.
  • In the Subnet tab, provide a subnet name and manually enter the network address as 192.168.0.0/24.
  • Leave other fields as default.
Figure 11: Network Creation in OpenStack

7.3. b. Security Group

A security group configures firewall rules to manage traffic. Modify the default security group by adding these ingress rules (Figure 12):

  • Port 80 for HTTP
  • Port 443 for HTTPS
  • Port 22 for SSH
  • ICMP for pinging the instance
Figure 12: Modifying Default Security Group

7.3. c. Router

Create a router to connect the private network to the public network, as shown in Figure 13.

Figure 13: Router Creation

7.3. d. Floating IP

Assign a floating IP to provide a fixed IP for the instance. This allows inbound access from external networks without issues (Figure 14).

Figure 14: Creation of Floating IP

7.3. e. Image Creation (Glance)

Upload an operating system image. We used the Ubuntu Focal Cloud Image in QCOW2 format (Figure 15).

Figure 15: Image Creation

7.3. f. Key Pair

Add an SSH public key from the L1 Ubuntu VM. This is required for accessing Ubuntu cloud instances, as they do not have a default password.

These steps ensure the prerequisites for creating and deploying an OpenStack instance are met.

Step 8: Instance Launch in OpenStack

You can now launch an instance from the Compute section of the project by following these steps, as shown in Figure 16:

  1. Name the Instance: Provide a name for the instance in the Details tab.
  2. Select Image: In the Source tab, select the previously uploaded image (e.g., Ubuntu Focal Cloud Image).
  3. Choose Flavor: Select M1 Medium as the flavour, which includes: 4 GB RAM, 2 Cores, 40 GB Disk
  4. Assign Network: In the Networks tab, select the previously created Private Network.
  5. Set Security Group: Ensure the modified Default Security Group with the ingress rules is selected.
  6. Add Key Pair: In the Key Pair section, select the key pair you added earlier.
Figure 16: Instance Launch

Once these steps are complete, launch the instance. You can access it via the Web Console, which will display a login prompt (Figure 17) once the instance is ready. This process typically takes 5-10 minutes.

Figure 17: Web Console Login Prompt

Step 9: Networking Configuration for L2 VM

9.1 Associating a Floating IP with the L2 Instance

Navigate to the Instance Dropdown menu. Select the option to Associate Floating IP. Assign the floating IP address 172.24.4.41 to the instance. After this step, the network topology will update to reflect the changes, as shown in Figure 18. This floating IP allows external access to the L2 instance.

Figure 18: Network Topology

9.2 Add SSH Keys

The L2 VM is now running and can be accessed via SSH from the L1 VM using the private key associated with the instance. To enable access from the Windows 11 physical machine, add its SSH public key to the ~/.ssh/authorized_keys file on the L2 VM. Additionally, update the ~/.ssh/known_hosts file on the L2 VM by adding the L1 VM’s public key to ensure secure access and prevent host authenticity warnings.

9.3

Enable IP forwarding:

sudo sysctl net.ipv4.ip_forward=1

Set up NAT rules to forward L1 ports to L2 ports:

sudo iptables -t nat -A PREROUTING -p tcp --dport 2222 -j DNAT --to-destination 172.24.4.41:22
sudo iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 172.24.4.41:80
sudo iptables -t nat -A PREROUTING -p tcp --dport 4343 -j DNAT --to-destination 172.24.4.41:443

These rules forward incoming traffic on L1 ports 2222, 8080, and 4343 to the L2 VM ports 22 (SSH), 80 (HTTP), and 443 (HTTPS) respectively. The chosen L1 ports avoid conflicts with other services.

To enable access from the Windows P laptop network, you need to configure similar rules on the Windows system. After setting up, you can SSH into the L2 VM from the P layer. Make sure to upgrade the necessary packages in the L1 VM as done in the previous steps.

Step 10: Install WooCommerce

Now that the server is accessible via SSH and browser, you can install WooCommerce by following these two steps:

Install WordPress on Ubuntu: Use the tutorial from DigitalOcean to set up WordPress on your server

Install WooCommerce: After setting up WordPress, follow the WooCommerce guide to install the WooCommerce plugin

Final Words

Congratulations! You’ve set up OpenStack, deployed an instance, and hosted an e-commerce app. While this was a local setup, the skills you learned here can scale to larger, production-level systems. Keep experimenting with OpenStack and discover its full potential.

Ready to go bigger? Try deploying OpenStack on a dedicated server for better performance and scalability

]]>
WooCommerce Architecture for a Multi-Country Brand http://waseem.test/2019/03/16/woocommerce-architecture-for-a-multi-country-brand/ Sat, 16 Mar 2019 08:59:00 +0000 http://waseem.test/?p=153 One of our clients at Teqnius, with a presence in over 20 countries across MENA and APAC, needed a scalable, efficient, and user-friendly ecommerce solution to optimize their existing WooCommerce and WordPress setup.

We crafted a solution that addressed their need to accommodate varied administrative, pricing, marketing, and inventory requirements for each country, alongside integrating API capabilities for seamless mobile app integration. Here’s how we approached it.

Crafting a Domain Name Strategy

When building an ecommerce presence across multiple countries, choosing the right domain structure is crucial. For this client, we had to decide between country-specific domains (e.g., shop.ae) or subdirectories (e.g., shop.com/ae).

Subdirectories emerged as the preferred choice. This approach allows the brand to consolidate domain authority, which is beneficial for SEO, while also simplifying technical maintenance.

To ensure a localized and seamless user experience, we implemented region-specific content and enabled automatic geolocation-based redirection to the appropriate subdirectory.

WooCommerce Architecture for Multi-Country Ecommerce

The client was already using WooCommerce, but expanding it to serve 20 countries required a rethinking on how it is setup and configured.

The setup revolved around three options: a single WooCommerce installation, multiple independent installations, or a WordPress Multisite configuration.

We chose WordPress Multisite. This architecture allowed us to:

  • Maintain independent sites for each country, enabling distinct pricing, inventory, and localized content.
  • Manage plugins, themes, and global settings from a centralized backend, streamlining updates and reducing technical overhead.
  • Customize tax rules, payment gateways, and shipping methods to meet the unique requirements of each country.

Integrating API for Mobile App Support

To complement the web platform, the client required APIs to support a mobile app that would enable seamless data consumption and real-time updates. We utilized the native REST APIs provided by WordPress and WooCommerce, ensuring seamless integration and consistent functionality. This API integration provided:

  • Product Synchronization: Ensuring product listings, stock levels, and pricing remain consistent across the app and web platform.
  • Order Management: Enabling customers to place and track orders directly from the app while syncing with the WooCommerce backend.
  • User Authentication: Allowing secure login and profile management through the app.
  • Region-Specific Customization: Delivering localized app experiences with country-specific content and settings.

Final Thoughts

Creating a platform for multi-country ecommerce is no small task, but with the right tools, it becomes a manageable challenge. By combining WordPress Multisite and WooCommerce, we built a system that simplifies operations while allowing local customization. The integration of WordPress and WooCommerce’s native REST APIs ensures smooth communication between the web platform and mobile app, delivering a seamless user experience.

This solution is designed to adapt and grow as the business expands, balancing global control with regional flexibility. It enables consistent branding, efficient management, and reliable functionality, making it a strong foundation for scaling ecommerce across borders.

Do you have ideas or experiences with multi-country ecommerce platforms? If there’s something you’d do differently or a better approach you’ve tried, I’m all ears—let’s discuss!

]]>