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 / contoh-nginx.conf
Created June 3, 2025 04:59
contoh nginx http2 port 80 not redirect
# Global Rate Limiting Settings
# These settings define how Nginx will manage the rate of incoming requests across all services.
# 'warn' log level means only significant events (like requests being limited) are logged.
# The 'global' zone tracks requests based on client IP, allowing 10 requests per second.
limit_req_log_level warn;
limit_req_zone $binary_remote_addr zone=global:10m rate=10r/s;
# --- HTTP Traffic Handler (Port 80) ---
# This section defines how Nginx processes standard, unencrypted web requests on port 80.
# It's intended for traffic forwarded by a load balancer, potentially after SSL termination.
@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 / gist:a3846de604e5f6ed95d48368389f7471
Created April 12, 2025 04: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