How to use docker compose to setup AWStats

Have added changes to incorporate both generating AWStats logs and starting up AWStats service in a single docker compose file at KarMeng / docker_awstats — Bitbucket

Sample docker compose for AWStats

This is an easy and simple example that beginners can use to generate web statistics using AWStats.

Required softwares:
Hashicorp Vagrant 2.4.1
Oracle VirtualBox 7.0.14

Continue reading

ElasticSearch 8.12 docker compose do not work

Error message exited 137

The first error that will be face on get go is the error “kibana Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap” and exiting error “dependency failed to start: container docker-es03-1 exited (137)”.

Searching mentioned error on google or the internet will yield result that advice swap memory and memory limit hit.

Continue reading

ElasticSearch 8.12 kibana cluster using vagrant and docker compose

Pre-requisite:
– VirtualBox 7.0.14
– Vagrant 2.4.1
– Windows 10 or better OS
– 16GB RAM (10GB RAM are required for creating ElasticSearch with kibana; 1GB and 2 x ElasticSearch node; 4GB each, rest of the RAM for VM host OS)

Overview:
There are 2 layers of virtualization, first the Virtual Box, then the docker engine running in the Virtual Box VM running on Ubuntu 20.04 focal.

Orchestration used in the host OS level; Windows 10 are the hashicorp vagrant. The vagrant is used to configure the VM Ubuntu OS to be configured to run properly configured docker and Ubuntu 20.04.

Then docker compose v2 are used to create the ElasticSearch 8.12 cluster or stack.

The downside of this example, vagrant up needs to be run initially to configure the VM Ubuntu 20.04 OS. I have yet to discover if Vagrant has the ability to bootstrap grub and configuring the sysctl to allow the docker engine to run properly with the ElasticSearch 8.12 stack.

Continue reading

Using of legacy built in command of MS DOS copy con

Usage of copy con is possible in modern Windows OS command prompt is possible

copy con is a legacy command that allows a plain MSDOS to create text file such as autoexec.bat and config.sys

From my experience, the command is supported from MSDOS 3.30 till today. Have yet to test this command in Windows 11 OS.

To commit and save the file into disk, use CTRL + Z

This command was learned/discovered during the days before existence of Internet, by attentively looking over the shoulder of seniors, who are not willing to teach during computer club session.

@echo off
netsh wlan show profiles |findstr All > tmp.txt
for /f "tokens=2 delims=:" %%a in (tmp.txt) do (
echo %%a
netsh wlan show profiles name=%%a key=clear
)
del tmp.txt

This batch script will list out list of saved wifi profiles, save the profile into text file tmp.txt

From the file tmp.txt, print out the 2nd token from the text file which will returns the WiFi profile name, then using the same command to expose WiFi key in clear text.

How to upgrade an old laptop that is lagging

First assuming that compatible hardware is available, get compatible SODIMM RAM. and identify type of hard disk your laptop can use.

General idea, check the laptop user manual to identify what are the maximum RAM that are supported total, what are the maximum RAM supported in a slot. And importantly does the motherboard chipset of your laptop supports SODIMM that are different capacity. Clock speed as long as its higher than the laptop spec, the motherboard chipset will automatically tune the RAM Clock speed to match the maximum speed supported by the motherboard.

For context, the old laptop for upgrade is an Acer Aspire E5-475 which comes with 4GB RAM, 1TB HDD that has an Intel i5-7200U CPU at 2.5GHz.

Generally, a laptop should be serviceable, however by opening the service area, it will void the laptop warranty, ACER Aspire E5-475
Continue reading

Measuring how much time vagrant up is using to complete orchestration

A little bit of effort to search the net and encountering the solution, powershell will is a simple way to measure time spent executing a command. In Linux environment, time command can be used, but in this post, it is limited to Windows environment.

Based on the conventional wisdom from the documentation of Measure-Command of powershell. The command would be as follows:

Measure-Command {vagrant up}

However, by running the above powershell command, the output to the screen will be not available.

Hence, more searching in the internet (Source: time – Timing a command’s execution in PowerShell – Stack Overflow) leads to the complete command below:

Measure-Command {vagrant up|Out-Default}
Console output is shown when the command running is being piped into Out-Default

Based on the previous post of the vagrant orchestration of GitLab, the orchestration takes about 50 minutes in my computer with timedotcom broadband connection.

Total time spent for the command to end, 50 minutes plus.

Conclusion, measure-command is easy way but lack of detail such as time spent on CPU, IDLE time and network operations time. It will not be suitable for use if more details are needed.

How to use Hashicorp Vagrant to quickstart GitLab docker compose sample

The code of the project is available at chowkarmeng/vagrant_gitlab (github.com), the docker compose is based on the sample provided in GitLab Docker images | GitLab

The improvement done was to change the folder sync for virtual box into docker volumes.

First, git clone the repository https://github.com/chowkarmeng/vagrant_gitlab.git

Fire up the quickstart by running “vagrant up” in the localdev

The process will take hours depending on the speed of your computer and speed of your internet connection.

Continue reading

Making your windows RDP accessible from your home network

It is simple to make your computer in your home LAN accessible from internet.

The pre-requisite would be understanding how Network Address Translation works. To make the dynamic IP of ISP provide to your home internet access, feel free to research into finding Dynamic DNS providers. This will make it easier than using websites like whatismyip.com . And you just need to fire up the RDP client, and use the Dynamic DNS FQDN which will be always pointing to your static IP.

Depending on the network equipment used in your home or provided by your Internet Service Provider (ISP), you may need to look for NAT or in my case IPv4 port mapping.

The screenshot above, shows how to create a NAT mapping or a IPv4 port mapping for a computer with LAN IP, 192.168.100.12, take note that the port of RDP is 3389 and the protocol used is TCP. Hence, the internal port must be numbered 3389.

External port set to 3389 are for the sake of simplicity.

If there are more host in your LAN need to be accessible from the internet remotely using RDP, there is no need to change the default port of RDP of your host.

Instead, use the known port that is not blocked by your ISP. Example assuming that higher port numbers are not blocked by your ISP, you could use 13389, or 23389, or 33389 or 43389, or 53389 or 63389, as long as it is not more than 65535 or lesser than 1024. Those port number can be used as the External port number, while maintaining the internal port number to 3389.

Setting up custom domain in Zoho mail for free

From the previous post, this is definitely a follow up to enable my vanity email.

I was recommended by a friend to try our Zoho mail as it is free and offer use of customed domains.

Here are the results and how to get started.

First sign up a free plan with Zoho at Zoho Mail Pricing and Editions – Free for 5 Users

Do not panic, scroll down to view the free plan sign up.

Continue reading

DNS routing traffic for subdomains using AWS Route 53

Long explanation in AWS Routing traffic for subdomains – Amazon Route 53

GROUND RULE or RULE OF THUMB of DNS, NEVER change the NS record of your domain in your Domain registrar before completing setup of your DNS server. The result may cause 72 hours of outtage.

Using my domain karmeng.my as an example, the objective is to have chow.karmeng.my to be a valid domain for email hosting which offers customed domain.

Continue reading