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 / es_ingestion_monitor.sh
Last active July 11, 2025 13:20
script for es_ingestion_monitor.sh
#!/bin/bash
# Configuration
ES_HOST="https://your-es-cluster.example.com:9200" # Your Elasticsearch host, IP address and port (e.g., "https://127.0.0.1:9200" or "https://<cloud_id>.es.<region>.gcp.cloud.es.io:9243")
# ES_USER="elastic" # If using username/password, uncomment and replace with your username
# ES_PASS="your-elastic-password" # If using username/password, uncomment and replace with your password
ES_TOKEN="your-generated-service-account-token" # If using a service account token, uncomment and replace with your token value
INTERVAL_SECONDS=10 # How often to check and calculate (e.g., 10 seconds)
# --- Authentication Header Setup ---
@linuxmalaysia
linuxmalaysia / php-fpm-slowlog.sh
Last active July 9, 2025 22:51
this script automates the process of sifting through potentially large slow log files to provide actionable insights into your PHP application's performance bottlenecks over time.
#!/bin/bash
# Define the path to your PHP-FPM slow log file
LOG_FILE="/var/log/www.log.slow"
# Check if the log file exists
if [ ! -f "$LOG_FILE" ]; then
echo "Error: Log file '$LOG_FILE' not found."
exit 1
fi

To help you craft a prompt for deep self-research across public information sources or AI knowledge bases, here's a structured approach and guidance on the details to include.

Your Self-Research Prompt Template

"Please conduct a comprehensive deep-dive research on [Your Full Name]. Focus on gathering publicly available information across various online platforms, historical records (if applicable and public), and any associated data within your knowledge base.

Prioritize information that reveals:
1.  **Professional Presence:** Roles, companies, projects, publications, presentations, patents, open-source contributions, and any publicly recognized achievements.
2.  **Academic Background:** Educational institutions, degrees, notable academic projects, research papers, or certifications.
# --- General System Resource Limits ---
# Increase the maximum number of memory map areas a process may have.
# This helps prevent out-of-memory errors for applications like Nginx that handle many connections,
# each potentially requiring its own memory mappings. Your value of 262144 is well-suited.
vm.max_map_count = 262144
# Increase the maximum number of file handles available system-wide.
# Nginx, especially as a reverse proxy or load balancer, opens a large number of file descriptors
# for incoming client connections, outgoing backend connections, log files, and cached content.
# Generated by nginxconfig.io
# See nginxconfig.txt for the configuration share link
# Note in comments by Harisfazillah Jamel and Google Gemini
# 15 Jun 2025
user www-data;
pid /run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 65535;
@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.