Exploring Microsoft Azure Portal: Setting Up GitLab Runner and Poste.io Mail Server with Amazon SES for SMTP

Introduction

In today’s cloud-driven world, managing infrastructure with services like Microsoft Azure and AWS has become a vital part of software development and deployment. In this post, I’ll walk you through my recent experience exploring Microsoft Azure, where I set up a Virtual Machine (VM) to host GitLab Runner for continuous integration and Poste.io as a mail server. However, I encountered a common issue — outbound port 25 was blocked, which is essential for sending email via SMTP. To overcome this, I integrated Amazon Simple Email Service (SES) to handle outbound mail.

This blog post details how I set up these services and how Amazon SES solved the port 25 block issue on cloud infrastructure, providing a seamless email-sending solution.


Step 1: Exploring Microsoft Azure and Creating a Virtual Machine

The first step in the process was to create a Virtual Machine (VM) on Microsoft Azure, which would serve as the host for both GitLab Runner and the Poste.io mail server.

Why Azure?
Azure’s cloud platform offers powerful resources, scalability, and a wide range of services. Its Virtual Machines are versatile and support various operating systems, making it perfect for my needs.

Here’s a quick rundown of how I created the VM:

  1. Access the Azure Portal:
    • Go to the Azure Portal and log in with your credentials.
    • From the dashboard, select Virtual Machines in the side menu and click Create.
  2. Configuring the VM:
    • Choose an operating system (I used Ubuntu 20.04 for its stability and support).
    • Select the appropriate size for your VM based on your workload. I went with a Standard B2s VM, which offers 2 vCPUs and 4 GB of RAM — enough for GitLab Runner and Poste.io.
  3. Networking:
    • When setting up the VM’s networking options, ensure that you configure inbound rules for ports such as HTTP (80), HTTPS (443), and SMTP (587) for mail communication.
    • Once done, click Review + Create and then click Create to spin up your VM.
  4. Access the VM via SSH:
    • Once the VM is created, you’ll be given a public IP address. Use SSH to access your new VM:

      ssh <your-username>@<your-vm-ip-address>


Step 2: Setting Up GitLab Runner on Azure VM

With the VM ready, I proceeded to set up GitLab Runner — a key component for running CI/CD pipelines on GitLab.

  1. Install GitLab Runner: SSH into your VM and run the following commands to install GitLab Runner:

    curl -L –output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
    chmod +x /usr/local/bin/gitlab-runner
    gitlab-runner install
    gitlab-runner start


Step 3: Setting Up Poste.io as a Mail Server

Next, I turned my attention to setting up the mail server. For this task, I chose Poste.io, a fully-featured mail server that’s easy to install and configure.

  1. Installing Docker: Poste.io runs within a Docker container, so the first step is to install Docker on your VM:

    sudo apt-get update
    sudo apt-get install docker.io

  2. Setting Up Poste.io: With Docker installed, you can now set up the Poste.io mail server. Simply run the following command to pull the Poste.io Docker image and start the container:

    sudo docker run -d \
    –name “poste” \
    –restart=always \
    -p 25:25 -p 80:80 -p 443:443 -p 587:587 -p 110:110 -p 995:995 -p 143:143 -p 993:993 \
    -v /your-data-folder:/data \
    analogic/poste.io

    This will expose the necessary ports and mount the data folder for persistence. You can access the Poste.io admin interface by visiting the VM’s public IP address in a browser.

  3. Initial Configuration: Upon visiting your server’s IP in a browser, you’ll be prompted to configure the domain, admin account, and other initial settings. Once set up, you can start managing email accounts, domains, and mail queues directly through the Poste.io dashboard.

Step 4: Overcoming the Port 25 Block with Amazon SES for Outbound Mail

At this point, I ran into a common issue: Azure (and most cloud providers) block outbound traffic on port 25, the default port used for sending SMTP email. This meant my Poste.io server could not send outgoing mail.

The solution? Amazon Simple Email Service (SES) — a reliable, scalable service that bypasses port 25 restrictions and allows your server to send outbound emails.

Setting Up Amazon SES

  1. Log into the AWS Console: Head to the Amazon SES Console and create an SES account if you don’t have one already.
  2. Verify Your Domain:
    • Navigate to Domains under the SES dashboard.
    • Click Verify a New Domain and follow the steps to verify your domain. This may involve adding DNS records provided by SES to your domain’s DNS settings.
  3. Create SMTP Credentials:
    • In the SES console, under SMTP Settings, generate SMTP credentials (Amazon will provide a username and password).
    • Make note of the SMTP server endpoint (e.g., email-smtp.us-east-1.amazonaws.com) and the credentials.

Configuring Poste.io to Use Amazon SES

Now, you need to configure Poste.io to use Amazon SES as the SMTP route for outbound emails.

  1. Modify Default SMTP Route (used by Poste.io): Change target SMTP server hostname Amazon SES SMTP hostname together with the SMTP username and password,

At this point, your Poste.io mail server is configured to send emails through Amazon SES, circumventing the port 25 block.


Step 5: Conclusion

Setting up a Virtual Machine on Microsoft Azure to run GitLab Runner and Poste.io for mail services is a powerful combination for managing your CI/CD workflows and email communication. However, the outbound port 25 block on most cloud providers can be a major hurdle for email delivery.

By integrating Amazon SES with Poste.io, I was able to successfully configure SMTP services, ensuring reliable outbound mail delivery. This solution not only bypasses cloud provider restrictions but also offers a scalable and cost-effective way to manage email sending.

If you’re facing similar challenges in your own cloud-based mail server setups, I highly recommend looking into Amazon SES for your email-sending needs. It’s a robust and dependable solution to keep your communication flowing smoothly!


Have you set up similar cloud-based systems or dealt with SMTP restrictions? Share your experiences in the comments below!

Migrating to AWS Malaysia Region: From Linux to Windows/IIS with Free SSL from ACM

For the past few weekends, I’ve been busy migrating my website and WordPress blog from my previous hosting provider to the newly launched AWS Malaysia Region. Initially, my plan was to set everything up using the classic Linux/Apache stack, but after evaluating my project requirements (And my expertise in IIS 😅), I decided to go with Windows/IIS instead. This decision was largely based on familiarity, support, and ease of use for what I had in mind.

After a few challenges, I was able to complete the migration seamlessly, and to top it off, I secured everything using the AWS Certificate Manager (ACM) which provided me with a free SSL certificate! In this post, I’ll walk you through some of the steps I took to make this migration successful, and provide some extra instructions for those of you planning to run PHP and Laravel on IIS. Let’s dive in!

Migrating to AWS Malaysia Region

AWS recently launched its Infrastructure Region in Malaysia, offering improved latency and performance for those of us working out of Southeast Asia. The timing couldn’t have been better for my migration.

Here’s a quick rundown of the migration process:

  1. Setting up an EC2 Instance: I spun up a Windows Server EC2 instance using AWS Elastic Compute Cloud (EC2). AWS made it easy to select the region closest to me—AWS Malaysia Region—and launch a server instance that met my performance needs.
  2. Installing IIS: Once my Windows Server instance was up and running, I installed IIS (Internet Information Services) using the Server Manager.
  3. Migrating WordPress: I moved my WordPress site from my old host to AWS manually by copy the directory and export the SQL.
  4. Setting Up SSL with ACM: Security is always a top priority, and I took advantage of AWS Certificate Manager (ACM) to get a free SSL certificate for my domain. ACM automates the provisioning and renewal of SSL/TLS certificates, ensuring my website is secure without the need for manual intervention.

Everything was running perfectly—until I realized I also needed to host a Laravel application on this server.

Enabling PHP in IIS for Laravel

If you’re planning to run PHP-based applications like Laravel on IIS, there are some additional steps you’ll need to follow. Here’s a step-by-step guide to get PHP up and running on IIS, and ensure that Laravel works without issues:

1. Install PHP on Windows/IIS

First, you’ll need to install PHP on your IIS server.

  • Download the PHP Windows Installer and choose the latest non-thread-safe version for your system.
  • Extract the files to a directory, e.g., C:\php.
  • Open IIS Manager, navigate to your server node, and click on Handler Mappings.
  • Add a new Module Mapping with the following details:
    • Request Path: *.php
    • Module: FastCgiModule
    • Executable: C:\php\php-cgi.exe (or wherever you extracted PHP)
    • Name: PHP
  • Once done, restart IIS.

2. Install FastCGI

To enable IIS to process PHP files, you’ll need to install FastCGI support.

  • In Server Manager, click on Add Roles and Features.
  • Navigate to Web Server (IIS) > Web Server > Application Development, and select CGI.
  • Install FastCGI.

3. Configure PHP with IIS

You need to tell IIS where to find the PHP installation. Here’s how:

  • Open your php.ini file (located in your PHP installation directory) and modify the following settings for Laravel:
    • max_execution_time = 300 (or more depending on your needs)
    • memory_limit = 512M
    • post_max_size = 100M
    • upload_max_filesize = 100M
    • extension_dir = "ext" (adjust this to your actual PHP extension directory)
  • Enable required extensions for Laravel:
    • Uncomment the following lines in php.ini:
      extension=curl
      extension=mbstring
      extension=fileinfo
      extension=openssl

4. Install Composer

Now that PHP is up and running on IIS, the next step is to install Composer and Laravel.

  • Download and install Composer.
  • Next, configure IIS to serve Laravel application.

5. URL Rewrite Module for IIS

Laravel requires the URL Rewrite Module to work correctly with IIS.

  • Download and install the URL Rewrite Module for IIS.
  • Add the following rewrite rules to your site’s web.config file located in the Laravel root directory:
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="Laravel" stopProcessing="true">
    <match url=".*" />
    <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.php" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

6. Database Setup

  • Install MySQL and set up your database.
  • Update the .env file in your Laravel app with the correct database credentials:
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=your_database
    DB_USERNAME=your_username
    DB_PASSWORD=your_password

After following these steps, Laravel app should be fully functional on IIS!

Wrapping Up

Migrating my website, WordPress blog, and Laravel app to AWS Malaysia Region using Windows/IIS turned out to be a rewarding experience. By enabling PHP and configuring the necessary components, I’ve ensured my applications run smoothly and securely in the cloud. Thanks to AWS’s robust infrastructure and ACM’s free SSL certificates, I’m confident my setup will handle future growth and challenges with ease.

If you’re planning to do the same or have any questions, feel free to reach out. I’m more than happy to help!


Key AWS Services Used:

  • EC2 for hosting the Windows/IIS server.
  • ACM (AWS Certificate Manager) for free SSL certificates.

Exploring AWS free tier and expanding my tech knowledge has been a blast, and I highly recommend it to anyone looking to dive into cloud computing. It’s empowering to manage your own cloud infrastructure, and AWS offers great flexibility, whether you’re using Linux or Windows!

Have you tried AWS for your hosting needs? Let me know your thoughts and experiences!

How Bard Generates Response

Bard generates responses by using a process called natural language processing (NLP). NLP is a field of computer science that deals with the interaction between computers and human (natural) languages. Bard uses NLP to understand the meaning of your prompts and questions, and to generate responses that are relevant and informative.

Bard’s NLP capabilities are based on a large language model (LLM). An LLM is a statistical model that has been trained on a massive dataset of text and code. This dataset includes text from books, articles, websites, and code from GitHub repositories. Bard uses this dataset to learn the statistical relationships between words and phrases.

When ask Bard a question, Bard uses its NLP capabilities to understand the meaning of your question. Bard then uses its LLM to generate a response that is relevant and informative. Bard’s responses are generated in real time, which means that you can interact with Bard in a conversational way.

How ChatGPT Generates Response

ChatGPT Website Screenshot

As an AI language model, ChatGPT uses a complex set of algorithms to process and analyze natural language input from users, generate relevant responses, and present them in a conversational manner.
ChatGPT generates responses using a combination of natural language processing (NLP) and machine learning techniques.

Here’s a brief overview of how ChatGPT generates a response:

  • Input analysis: ChatGPT first analyzes the user’s input to understand the meaning and context of the question or statement.
  • Knowledge retrieval: Once ChatGPT has understood the input, it retrieves relevant knowledge from its pre-existing knowledge base, which has been built through training on vast amounts of text data.
  • Response generation: Using this retrieved knowledge, ChatGPT generates a response that is both relevant to the input and as informative as possible.
  • Language generation: After generating the response, ChatGPT uses natural language generation techniques to present the response in a conversational manner that is easy for the user to understand.
  • Feedback learning: ChatGPT is also designed to learn from its interactions with users. By analyzing the user’s response to its replies, ChatGPT can learn from any mistakes it may have made and improve its future responses.
  • Pre-processing: The user’s input is pre-processed to remove any noise or irrelevant information, such as punctuation and stop words.
  • Encoding: The pre-processed input is then encoded into a numerical representation that can be processed by the machine learning model.
  • Model training: ChatGPT is trained on vast amounts of text data to learn patterns and relationships between words and phrases. It uses a neural network architecture called a transformer, which is specifically designed for NLP tasks.
  • Response generation: Once the input has been encoded and the model has been trained, ChatGPT generates a response by predicting the most likely sequence of words based on the input and its pre-existing knowledge base.
  • Decoding: The predicted sequence of words is then decoded into natural language using a language model that converts the numerical representation back into human-readable text.
  • Post-processing: Finally, the response is post-processed to add any necessary punctuation, capitalization, or other formatting before being presented to the user.
Published
Categorized as Technology

5G in Malaysia

As of today, there is only 1 major telco in Malaysia have yet to roll out 5G services which is Maxis.
Today DiGi turning on 5G only for some of the postpaid plan (not including the one I subscribe).

I on the other hand subscribe UNIFI Mobile #Bebas Prepaid with 30-day free unlimited 5G data pass.
Hence, I able to perform 5G Speed Test around Shah Alam area few days back.

Get 5G SIM card here

Published
Categorized as Technology

Upgrade from Windows 11 21H2 to Windows 11 22H2

Windows 11 22H2

Windows 11 22H2 (also referred to as the “2022 Update”) is available starting September 20 2022 and if you plan to upgrade your device running Windows 11 21H2 or Windows 10 as soon as it becomes available, you will be able to proceed using the official ISO file, Windows Update and Installation Assistant.

Problem is my PC did not receive this update and I found out 1 method which is using Installation Assistant from here.
It take less than 1 hour to complete the update.

You could refer here on What’s new in Windows 11, version 22H2.

Samsung Note in Windows 10 / 11

Samsung Galaxy S22 Ultra with S Pen

I have upgrade from Samsung Galaxy S10 to S22 Ultra for some time now.
S Pen also become one of the tools that I use in my daily life and because of this, I also used Samsung Note.
I am also using Windows 11 and the app was not available to download.

Here is the solution I use.
Simply open Command Prompt & type: winget install "Samsung Notes".
Agree to the prompts by typing “Y” and finally installed Samsung Notes without issue on my Windows 11.

Samsung Note in Windows 11

Published
Categorized as Technology

Samsung x Starbucks

Samsung x Starbucks

Samsung in South Korea announced a collaboration with Starbucks and only available in South Korea.
One of its accessories caught my attention: the latte art case for the Galaxy Buds.

The buds case is resembles a tiny white mug with a handle and latte art on top.
The buds inside could be seen if you flicked the top up.
The mug itself bears the recognizable green Starbucks logo.

As a person who enjoys coffee and likes going to Starbucks every once in a while to get himself a latte with a caramel drizzle, this case greatly appeals to me.
However, I have to agree this is a bit big and impractical the case actually is. I can’t imagine putting the entire clump into my pockets like how I would with caseless buds.
But if the case is cute enough, I’d find a way to live with it.

Samsung mentions that all of its Starbucks-themed accessories are made with eco-friendly materials.

Here are all the Apple Pay promotions that are currently available in Malaysia

Apple Pay & Samsung Pay

Soon after Apple Pay’s long-anticipated introduction in Malaysia, banks and businesses are already running specials to encourage customers to use Cupertino’s contactless payment system.

AmBank and Standard Chartered, two participating banks, are offering payback offers for Apple Pay purchases while Maybank isn’t offering any particular refunds, certain businesses are running special Maybank-only deals.
Here are all of them:

AmBank (valid until October 31)

  • 50% cashback on first Apple Pay purchase (capped at RM20)
  • RM50 cashback when you spend minimum RM849 on Apple device with AmBank Credit Card/-i, add card to Apple Pay and make first Apple Pay transaction (first come, first served)
  • Up to RM158 cashback when you sign up for AmBank Credit Card/-i and perform eight Apple Pay transactions (minimum RM10 each)
  • Up to RM218 cashback when you sign up for AmBank Signature Priority Banking Visa Infinite Credit Card/-i and perform eight Apple Pay transactions (minimum RM10 each)

Standard Chartered (valid until August 18)

  • 100% cashback on first Apple Pay purchase (capped at RM10)

Maybank

  • TGV Cinemas: Get one free regular popcorn with purchase of regular popcorn with Apple Pay
  • Starbucks: RM10 rebate with minimum spend of RM30 with Apple Pay (first come, first served; we verified that this is exclusive to Maybank customers)

As a reminder, Apple Pay lets users make purchases using their iPhone or Apple Watch, the former requiring only Face ID or Touch ID for verification.
To add your card (only Maybank, AmBank and Standard Chartered credit cards and Maybank debit cards are supported for now) to your Wallet, you’ll have to either scan the card using your iPhone’s camera or enter the details manually.
Apple Pay is available at all businesses that accept contactless credit card payments, including Visa payWave as it adheres to the NFC standard.

Published
Categorized as Technology