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 / download-manifest-esagent.sh
Last active May 22, 2025 09:14
Script for Endpoint Security manifest download and version check
#!/bin/bash
### Script for Endpoint Security manifest download and version check
### This script is extracted from the main Elastic Stack Airgap Installation script.
### Created with Google Gemini
### Internal repo kepada Elastic Fleet.
### use with own risks
### buat directory ini bawah html /usr/share/nginx/html
### Added Manifest - 20250522
### Ubuntu / Debian - apt install nginx
@linuxmalaysia
linuxmalaysia / delete_elasticsearch_indices.sh
Last active May 20, 2025 23:21
A Bash script to safely delete Elasticsearch indices. It prompts for user credentials, lists indices from a generated file (deletable_indices_YYYY.MM.txt), requires explicit confirmation, and provides post-deletion cluster health status. refer to check_deletable_verbose_robust.sh https://gist.github.com/linuxmalaysia/8d0e1997a3e4c24c0777062d7d91…
#!/bin/bash
# By Harisfazillah Jamel with Google Gemini Help
# 20250521
#
# A Bash script to safely delete Elasticsearch indices. It prompts for user credentials,
# lists indices from a generated file (deletable_indices_YYYY.MM.txt),
# requires explicit confirmation, and provides post-deletion cluster health status.
# --- Configuration ---
ES_HOST="localhost:9200"
@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
@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 / 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 / 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 / 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 / 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 / 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 / configure_pgbouncer.sh
Last active September 15, 2024 02:16
# Harisfazillah Jamel - 11 Sept 2024 # Need to create systemd template for [email protected] and [email protected] # 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 [email protected] and [email protected]
# 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