Skip to content

Instantly share code, notes, and snippets.

View linuxmalaysia's full-sized avatar
🏠
Working from home

Harisfazillah Jamel linuxmalaysia

🏠
Working from home
View GitHub Profile
@linuxmalaysia
linuxmalaysia / Goaccess_for_nginx_access_log.md
Last active March 23, 2024 22:10
Terminal-Based Log Analysis with GoAccess for Nginx

Unleash the Power of Terminal-Based Log Analysis with GoAccess for Nginx

Running a website necessitates constant monitoring. However, wading through complex web interfaces to analyse server logs can be time-consuming. Enter GoAccess, a free, open-source tool that empowers you to analyse your Nginx server logs directly from the terminal.

Why GoAccess?

  • Blazing Speed: Gain real-time insights instantly, ditching the wait for reports.
  • Terminal Magic: Analyse logs directly from the command line, perfect for SSH access or terminal enthusiasts.
  • Flexible Output: Go beyond the terminal with reports in HTML (ideal for sharing and visualisation), JSON, and CSV formats.
@linuxmalaysia
linuxmalaysia / rsynctoserver.sh
Last active May 15, 2024 23:27
Old School Backup Using Rsync - Yeahhh on SCO Unix (BSD Style) - Convert to Linux Bash
#!/bin/bash
# Script to transfer directories from a remote server using rsync over SSH
# Harisfazillah Jamel (LinuxMalaysia)
# Circa 2006 For SCO Unix and BSD
# Adjust for Bash Linux 16 Mei 2024
# Target remote server details
# User need to be create and remote backup dir need to own by the user
# RADD can be local or remote IP
@linuxmalaysia
linuxmalaysia / configure_pgbouncer.sh
Last active September 15, 2024 02:16
# Harisfazillah Jamel - 11 Sept 2024 # Need to create systemd template for pgbouncer@.service and pgbouncer@.socket # By using so_reuseport in pgbouncer setting # and copy of /etc/pgbouncer/pgbouncer.ini to /etc/pgbouncer/pgbouncer.ini # Do this after all the tune and test run with single pgbouncer done. # https://www.2ndquadrant.com/en/blog/run…
#!/bin/bash
# Harisfazillah Jamel - 11 Sept 2024
# Need to create systemd template for pgbouncer@.service and pgbouncer@.socket
# By using so_reuseport in pgbouncer setting
# and copy of /etc/pgbouncer/pgbouncer.ini to /etc/pgbouncer/pgbouncer.ini
# Do this after all the tune and test run with single pgbouncer done.
# https://www.2ndquadrant.com/en/blog/running-multiple-pgbouncer-instances-with-systemd/
# https://www.enterprisedb.com/postgres-tutorials/pgbouncer-setup-extended-architecture-use-cases-and-leveraging-soreuseport
# Please check for running pgbouncer if you find this script in your server
# ps -ef | grep pgbouncer
@linuxmalaysia
linuxmalaysia / download-elastic-assets-manifest.sh
Last active May 22, 2025 01:05
Download Elastic Assets Manifest GNUPG for airgap installation
#!/bin/bash
### Script mudah untuk download asset dan manifest
### daripada elastic downloads bagi tujuan
### Internal repo kepada Elastic Fleet.
### use with own risks
### buat directory ini bawah html /usr/share/nginx/html
### Harisfazillah Bin Jamel 28/12/2024, update 26/03/2025
### Added Manifest and GNUPG - 20250522
### Ubuntu / Debian - apt install nginx
@linuxmalaysia
linuxmalaysia / Install_WSL2_Move_AlmaLinux9_Another_Drive.md
Last active April 1, 2025 01:47
Install WSL2 and Move AlmaLinux 9 to Another Drive

HOWTO: Install Almalinux 9 WSL2 and Move AlmaLinux 9 to Another Drive

TL;DR

A guide for myself—born from my professional experience as a Linux system administrator and enhanced with AI tools to ensure comprehensive coverage and clarity for technical audiences.

This guide details the process of installing the Windows Subsystem for Linux version 2 (WSL2) on Windows 11 Pro and installing AlmaLinux 9 onto a non-default drive (D:), ensuring a secure and efficient setup.


Phase 1: Installing WSL2 on Windows 11 Pro

@linuxmalaysia
linuxmalaysia / setup_elasticsearch_podman.sh
Created April 1, 2025 04:05
Script to set up Elasticsearch 8.17.4 using Podman with the hardened Wolfi image, based on the official Docker documentation.
#!/bin/bash
# Script to set up Elasticsearch 8.17.4 using Podman with the hardened Wolfi image, based on the official Docker documentation.
# Note: Using Wolfi images might have specific kernel or dependency requirements.
# https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docker.html
# GNU GENERAL PUBLIC LICENSE Version 3
# Harisfazillah Jamel and Google Gemini
# 31 Mac 2025
# https://github.com/HarisfazillahJamel/podman-elastic-stack
# --- Script Description ---
@linuxmalaysia
linuxmalaysia / setup_kibana.sh
Created April 1, 2025 23:43
Script to set up Kibana using Podman with the hardened Wolfi image. This script should be run after setup_elasticsearch.sh.
#!/bin/bash
# Script to set up Kibana using Podman with the hardened Wolfi image,
# based on the official Docker documentation.
# Note: Using Wolfi images might have specific kernel or dependency requirements.
# https://www.elastic.co/guide/en/kibana/current/docker.html
# GNU GENERAL PUBLIC LICENSE Version 3
# Harisfazillah Jamel and Google Gemini
# 2 Apr 2025
# Script to set up Kibana using Podman with its own custom kibana.yml.
@linuxmalaysia
linuxmalaysia / almalinux-hardening.sh
Last active June 15, 2025 14:21
This script is designed to enhance the security and monitoring capabilities of an AlmaLinux 9 system by installing and configuring various security-related tools and making some system-level adjustments.
```bash
#!/bin/bash
# By harisfazillah Jamel with Google Gemini Help
# 20250411
# This script is designed to enhance the security and monitoring capabilities
# of an AlmaLinux 9 system by installing and configuring various security-related
# tools and making some system-level adjustments.
# --- Initial System Setup ---
@linuxmalaysia
linuxmalaysia / Set Prompt GenAI Untuk Projek Migrasi MariaDB & AlmaLinux.md
Created May 18, 2025 22:44
Set Prompt GenAI Untuk Projek Migrasi MariaDB & AlmaLinux

📘 Set Prompt GenAI Untuk Projek Migrasi MariaDB & AlmaLinux

Dokumen ini mengandungi Prompt Umum dan 12 Prompt Khusus yang boleh digunakan bersama-sama untuk mendapatkan jawapan yang terperinci, tersusun dan teknikal bagi tujuan migrasi, penalaan prestasi dan penyediaan SOP bagi MariaDB dan AlmaLinux.


🧠 Prompt Umum (Untuk Digabungkan)

Sebagai seorang Jurutera Sistem Linux yang berpengalaman, anda ditugaskan untuk menjana Dokumen Prosedur Operasi Piawai (SOP) dan panduan langkah demi langkah yang terperinci bagi projek migrasi dan penyediaan semula persekitaran pangkalan data.

@linuxmalaysia
linuxmalaysia / check_deletable_verbose_robust.sh
Last active May 20, 2025 23:20
This script is a robust Elasticsearch index assessment tool designed to help you identify and manage old or inactive indices for .ds-logs and .ds-metrics. It connects securely to your Elasticsearch cluster, lists indices for a specified month and year, and determines their deletion status (e.g., whether they are a write index for a data stream).…
#!/bin/bash
# By Harisfazillah Jamel with Google Gemini Help
# 20250521
#
# This script is a robust Elasticsearch index assessment tool designed
# to help you identify and manage old or inactive indices for .ds-logs and .ds-metrics.
# Configuration - Adjust ES_HOST if necessary
ES_HOST="localhost:9200"
CERT_PATH="/etc/elasticsearch/certs/http_ca.crt" # Path to your CA CA certificate